I am a new teacher at polytechnic where we teach web development and basic software programming.

For years, the institution where I teach have taught C as their introductory programming language to people who are assumed to have no knowledge in programming.

I am investigating if there is a better option, and was thinking about JavaScript because it covers most of a similar structure to what we teach in C.

The reason I was thinking of JS is that a big part of the pathway that we teach goes into web development and JavaScript is used quite heavily in todays web development world.

The only direct difference I would encounter would be missing the user input via console that can be done in C. I suppose that would have to be replace by a simple HTML page, so that is not a biggy.

Is there any reason your experience, why JavaScript would be a bad way to start given the limited information I have given you? Or why would it be a good start?

I can see come pro's and con's to the change, so I am after some other programmers opinions.

Also, even though C is the intro language and does not leave the command line interface in the paper, the students are then expected to transition that knowledge into JavaScript and C# in the following year in 2 other subjects.

closed as primarily opinion-based by user40980, durron597, enderland, Telastyn, Javier Jul 30 '15 at 15:29

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    Well you can write horrible code in either;-) I guess the question for me would be how are you teaching them to structure their code? I'd say C is perhaps less forgiving and forces people to think more about what they are writing. – Jaydee Jul 30 '15 at 9:29
  • That is a good point, good habits are important from the start. – Jeff Kranenburg Jul 30 '15 at 9:31
  • 1
    They will not be interested in horrible or beautiful code in the beginning. They need to learn what programing means first. Some people manage to become web developers without really understanding what a Bit is. – Matthias Jul 30 '15 at 9:37
  • 2
    Welcome to Programmers.SE! When you atempt to use a tag that says "DO NOT USE THIS TAG, IT IS PART OF STCI BURNINATION EFFORT." why do you decide to use it anyway? – durron597 Jul 30 '15 at 13:55
  • Have you thought about Python? I can only recommend it for programming introduction – Bergi Jul 30 '15 at 14:30

I think JavaScript is not the best language to start learning programing concepts, mainly because of its "unusual" prototype approach.

C is meanwhile completely there were assembler was in earlier days. So I think not very interesting for most of the students. Where I think C++ now took the role of C. But I think C++ is not that interesting or fancy for students.

What I think is important to teach your students are the basic concepts of: Debugger, Breakpoints, Memory etc.

I think Microsoft's Community Edition together with C# as language would be a pretty good choice. Every student can also install it for free on his own machine.

If you dive directly into JavaScript you miss a lot of the fundamental parts that someone who has to do with Software should know. A C# Console Application I think is a good start.

But another point: Diving directly into web development I think is not a good strategy. It is too complex I think. Your students would miss the point what it really means to code and debug something.

If you still want to use JavaScript I think NodeJS development could be pretty interesting for your students.

  • Thank you for the feedback. There is paper that runs parallel with the programming paper that covers HTML, CSS and Git, that is why I thought of JS. I like your thoughts on the basic concepts. Vote Up – Jeff Kranenburg Jul 30 '15 at 9:41
  • After thinking about it, I start to agree with Matthias's viewpoint because when a web project is small, a non-rigorous approach might succeed; whereas most real-life practical projects are large enough that a lot of the software engineering skills (requirements, design, quality assurance, deployment, management, troubleshooting, etc.) are all necessary. Giving a superficial taste of simplicity and success is important for beginning students but attention must be brought to those rigorous issues at a later time - before the students finishes the course. – rwong Jul 30 '15 at 9:53
  • "Debugger" and "Breakpoints" are functions of the tooling and not fundamental programming concepts. There are target C platforms where you don't have either. – pjc50 Jul 30 '15 at 14:42
  • 1
    +1 for C# over JS. It's a no-brainer since C# is consistent and has the excellent free dev tools. – programmer Jul 30 '15 at 15:10
  • 1
    It's just that tools are much more changeable than concepts. Things like types, lambda calculus, iteration and recursion are concepts. The debugger is extrinsic to the language and just a way of inspecting what's going on. It's a map not a territory. It should be possible (although time-consuming!) to write mostly-correct programs on paper without ever actually running them. – pjc50 Jul 30 '15 at 16:09

It all depend of the purpose of the course.

If the goal is to teach programming fundamentals, consideration about actual usefullness of the language should be largely ignored. Javascript is nice because it is used in browsers. On the other hand it has a lot of problems that will distract your students from the core message of your course. Learning javascript later is not that hard once you understand the fundamentals about programming.

In this perspective, a better solution would be to stick to c (because it is low level), use python (because it is simple and consistent, and you will be able to focus on design), lisp (same but more abstract), haskell (if you want to focus on type systems) etc.

If the goal is to enable web designers to improve their skills, then obviously javascript is the way to go.

  • Yeah the distraction is a point, but I think you will have that with any language to a degree. I agree that JS is not hard to learn later. – Jeff Kranenburg Jul 30 '15 at 9:45
  • 1
    @JeffKranenburg although if your course is project oriented, building an interactive webpage can be a good motivation. But it requires a lot of knowledge (html, css, http) in order to get anything useful so it might be a bit though for total beginners. – Simon Bergot Jul 30 '15 at 9:47
  • Python would be a pretty good choice too. It gained much of relevance the last years. And for engineering students it can be very interesting. Also because it is a multi paradigm language. – Matthias Jul 30 '15 at 10:03

I would advise you to stuck to:

"Start simple. Build complexity on top of it."

JS with its prototype based inheritance is just to complex to begin with it. IMHO a good programming class should start low-complexity, low-level (C-console - as you already do - for example) and slowly move up to high complexity, high-level (C++ OOP, JS, PHP, etc.) - if you can somehow meaningfully connect the steps inbetween, that's a huge plus factor. That's a lot more important then teaching the latest hype-language IMHO.

Teaching more then one language (if there is enough time for it) can be particularly usefull to show the different approaches the languages take: interpretation vs. compilation, strong vs. weak typing, OOP vs. functional, class vs. prototype based inheritance, etc.

I would like to tell you how I was introduced to development ¹ - I really enjoyed it and I think it was a well thought concept and kept the class highly motivated at any step:

  • We started with a lot of theory building (compilers, debugging, etc). and then slowly begun building c console apps.
  • In the next step we were handed a RFID reader connected via RS232 to write an access-control software based on RFID cards (--> somewhat introduction to low-level component communication).
  • We then added a database for logging and user management purposes (--> entry-level introduction to SQL).
  • Afterwards our goal was to build a GUI to add/edit the user-base and train/program cards (--> introduction to IDEs using Borland C++ Builder)
  • We then got a second reader and were told the two should work together and one should centrally handle the authentication (--> introduction to socket programming).
  • ... (There were a few more steps, but I don't want to bore you - I guess you get what I'm trying to point out) ...
  • The final project was switching from C/C++ to PHP² to build a dynamic website to control the system via a webinterface (the PHP app spoke via TCP socket to the control server build earlier).

What I would like to point out: It was one big project from the (simple) start to the end, always stacking more complex parts onto the previous ones³.

(¹) - In my 3,5 years vocational education to a system-administrator - so programming wasn't our main study goal.

(²) - The step from C to PHP is in particular very easy, because they share a lot of the syntax.

(³) - Which of course often showed the limitations of the previous simple solutions.

  • 1
    +1 for reminding that C is simpler than "easier" languages (JS, PHP, etc). One of the first hard lessons on CS is that "easy" is often very complex. – Javier Jul 30 '15 at 15:34

JavaScript is a horribly poorly designed language, with a whole bunch of weird gotchas. I would avoid it as a first teaching language. I'd also avoid C. I think it's complexity and opacity hides the concepts you're going to want to concentrate.

I'd prefer Python. It's high level enough to make it easy to focus on core concepts, has some high quality accessible tools that mean you can introduce the debugger early on, and the immediate mode means that it's easy to "play" in it which helps a lot with learning.

However, since these students are intended to go on to C# why would you not start with that? It's a pretty good language to write in, the tools are excellent and you can start by building really usable things early on.


I think it depends on how rigorous you want to be with your intro courses, Khan Academy has a programming section that uses Javascript to teach programming concepts and it works pretty well because you hand wave quite a few things to start doing 'cool things' (that are generally handled by external frameworks or HTML5 APIs) and learn the basics of variables, functions, parameters, loops, etc.

If you want to talk about inheritence, data strutures, and scoping though Javascript may get in the way instead of making things easier... You'll also have to defer diving into types and generics because you just won't have them.

I'm surprised no-one has mentioned Java as an alternative yet -- the CS program at the school where I went started with Java, then moved to C with some assembly before branching out into other languages.

I don't really like Java, but I thought it was a useful starting point for learning because:

  • it uses C style syntax (unlike Python)
  • it lets you start out thinking in an object oriented mindset (unlike C or Javascript)
  • it's type system is pretty standard and easy to understand
  • it doesn't require manual memory management (like C or even C++)
  • it generally avoids a lot language specific paradigms or problem areas, examples include: list comprehensions and tuple assignment in Python, prototypal inheritance and scoping oddities in JavaScript, extension methods and delegates in C#

C# and Java are both fairly similar, but cross platform support for the CLR was not very mature when I started taking classes -- though this has been improved recently.

I also took the Udacity intro to programming course in Python and thought it was really quite good as well... and Python is usually just fun to write small programs with.


Not a good Idea.

Since you dont have the type system in JavaScript.

Your students will never know why there are 3 different levels of int float and double

  • 2
    there is a type system in JS... but it seems to be designed to confuse beginners. – Javier Jul 30 '15 at 15:36
  • 1
    Also important is here: Dynamic vs. static type systems. – Matthias Jul 30 '15 at 19:07
  • No use in being specific. The dynamic type system is the least of JavaScript's troubles. – Alternatex Aug 6 '15 at 15:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.