Hello,
I am thinking about teaching my students JavaScript first so that they can start creating websites and make their career, what are your thoughts?
I’ve studied with (now) engineers and there is large portion of people having a hard time with even the concept of a function. We learned C(++) at the time. I guess being forced to learn about what the hardware does kinda messed with people being able to just think about algorithms. As a first programmig language to just write some basic functions I like Python, but to be honest I don’t understand what’s going really going on behind the scenes either. But C is a really solid choice, as what’s really happening is easy to reason about (at least unoptimized) and every other language will have to abstract these same concepts.
C takes the cake
bashIf you’re wanting to teach programming concepts, I would start with scratch instead. This can be taught to little kids or older students. It’s what the free comp science class from Harvard starts with
The answer is Python
C teaches a whole variety of low level concepts that are helpful in any comp sci field. That’s my vote. Python holds your hand too much and JS would require more to get started. If they aren’t shooting for a comp sci degree and are just looking for helpful scripts then python would be fine.
What grade sudents is this for? Do you intend for this to be a dedicated class/semester or just a single unit? How good are they at operating a computer? (Typing, clicking, etc)
These are the questions that need answers before any meaningful advice can be given.
C and python simultaneously.
As a first language, JS is too much. They would need to learn three languages to make websites (JS, CSS, and HTML).
I’d start with Python. It’s easy to learn, and modern Python gives you the tools to write code that’s easy to read and follow without being too verbose.
uvshould make things very easy to setup too. Installuv, then give them a starter repo with the Python version set.uv runshould just work after that, no manual venv/conda/etc nonsense involved.I mean, they’ll probably learn more from C. But please. You can do better than javascript. At least teach them python or something.
I would teach Typescript. Being able to write the types down and hover things to see what types they are will definitely help them.
I think C would put them off. I also wouldn’t go with Python, in case they want to do things like write games or make websites, which are common tasks you can do with Typescript but not very well with Python.
Python has PyGame. For webdev it has some libraries but those do not really teach any basics.
Python’s performance is too poor to do anything serious. Go and look at the screenshots from Pygame. They look like ZX Spectrum era games.
Compare that to something like PixiJS.
After reading through some of the comments, here is my opinion.
C would be a good language IF you know your students plan to get into IT, specifically a sector where the low level knowledge is useful. Beyond that, I assume your students probably use windows and I personally always find it a pain to work with C on windows outside of full IDEs like jetbrains and Visual Studio. It’s also a lot more work till you get some results that you are happy about. Unless you start with an Arduino, which I find pretty nice to get students interested in embedded stuff.
I don’t like JavaScript because I find it a mess although it is very useful for anything web related.
Given you said in another comment that this is meant to be a general purpose skill for your students I would strongly recommend python. While I dislike the dynamic type system, it is a very powerful language to get stuff done. You can quickly get results that feel rewarding instead of running into hard to fix issues that turn your students off of programming in general. Also it’s very useful outside of IT as a scripting language for analyzing data in basically any field or for generating nice plots for some document
Probably JS as the fact that every computer has by default everything you need to execute JS. But there is a bunch of browser stuff you have to worry about before you can do anything with it. I’m not sure how you learn JS before html.
With Python you can do simple command line stuff without having to really know anything else. You can learn one concept at a time.
That being said, people have a lot of familiarity with browsers and it might feel less abstract. JS might a better choice for demystifying coding. Python is probably a better choice for accomplishing anything useful.
Without knowing anything about your students, it’s hard to say. If I were the student I’d much prefer to be taught C, but that’s because I have an existing interest in computers and a desire to develop systems programming skills. I wouldn’t like to teach JS to anyone because it’s a bad language and I don’t want students to go away making more web 3 slop but if they actively are interested in making web 3 slop that’d be a case for teaching JS. I’m of the pedagogical school of teaching students what they are actually interested in learning. They might not know enough about programming to know which language they want to learn off the bat, but maybe ask them what sort of software they’re interested in making. If they want to make websites, you might want to teach them something like Python with Flask, as something less bad than JS as well as easy enough to learn.
Imo C is a good teaching language as it teaches you a lot about how computers work, as well as the fact that nearly everything runs on C. It is “harder” though, and imo is also for students who are actually interested.
The fact that every computer has a browser where they can practice javascript probably makes it the better option. Python would probably require, on Windows, some setup that isn’t what you want to spend time on, and may be a barrier to them trying stuff on their own time at home.






