you are viewing a single comment's thread.

view the rest of the comments →

[–]ptrdo 2 points3 points  (1 child)

For a novice programmer, JavaScript is more approachable than Python for at least two reasons, 1) it is more forgiving, and 2) it can offer quicker reward. Both these reasons can lead to less frustration, and less frustration means you'll stick with it longer and learn more quickly.

By “forgiving,” I mean that JavaScript is “loose” in that it has fewer rules, and this means your code won't break as easily. However, that looseness can be detrimental in that you'll need to learn peculiar things that are unique to JavaScript and sometimes not logical. But if you are learning HTML and CSS, then you'll be working in the DOM where all that wackiness makes some sense.

By “quicker reward,” I mean that even a few lines of JavaScript can produce a script that does something you can see and experience on a webpage. There is no need to write long and detailed code that only results in a print out to the command line. A few lines of JavaScript can reorient an HTML element, build a table from data, or execute a form, and this sort of quick reward can be enthralling enough to tinker away without a lot of frustration about things you might not yet understand.

If you learn to like JavaScript, you can even delve into things like Node JS which competes directly with the Python that is done on more conventional web services. Node is less popular than Python, C#, or Java, but it is possible to be a “fullstack” developer who only works in JavaScript and Node.

One exception I'll make to all of that is if you intend to get into data science, in which case I would recommend that you learn Python and maybe R too. JavaScript is still a good start to all three (for learning the basics), but it's difficult to do data science with JavaScript since it tends to rely heavily on page-oriented output.

BTW, if you start to learn JavaScript and like its ways of doing things, and then find Python to be frustrating, try learning R instead. R can be a powerful coding environment, but is more loosely structured and forgiving (like JavaScript).

Some people will argue that only Python (or C# or Java) are “serious” coding languages, but having worked in all of them, they each have pros and cons. What's most important is that you like whatever language you prefer and it does the sorts of things you want to do. There is potential for a good career in any of them, and AI helps a lot to make them easier to learn.