My view
In my opinion JavaScript can be a great choice to begin with, but it depends a lot on the resources you use and what technologies you try to use with it.
If you actually want to start learning software programming with JS, start with a very simple HTML page (just all you need to execute JS). Do not include any trending Framework, just concentrate on pure JS. Alternatively you can use Node, then there is no need to set up any HTML file.
I think, what learning JS can make difficult is the unnecessary flexibility it provides, but it is still important to understand the "bad" concepts, because you possibly will have to work with the code somebody else has written.
Good articles without explaining too early and too much unnecessary details can be very helpful to quickly learn how programming works. Just think about how equality with "===" is recommended, but knowing "==" is still worth it.
Your view
Please leave your opinion in the comments, even if you do not know a lot about JS. Every perspective is appreciated!
Top comments (9)
Beginning what?
For me the elephant in the room is the implicit assumption that learning a programming language will automatically teach you how to program.
There are people in the educational space that disagree with that assumption - they argue that more often than not "commercial" programming languages tend to get in the way of an efficient and effective learning process.
This lead to Data-Centric Introduction to Computing which uses Pyret (Bootstrap).
That said back in 1995 JavaScript was supposed to be "beginner-friendly" (hence ASI) but the intention was to give "non-programmers" the opportunity to add some interactivity to otherwise static web pages - not necessarily as a means to learn programming (by osmosis).
Now we're up to ECMAScript 2022 and JavaScript has acquired a lot of features from other mainstream languages making it a much larger language than it was 27 years ago. The code that is being written in JavaScript has also gotten a lot more complex.
Despite that JavaScript still has a flavour of it's own that can frustrate developers that come from other languages, wishing that JavaScript acted in accordance with the mental models they are already familiar with (mental models that can get in the way of using JavaScript effectively).
So while it may be easy to get started with JavaScript the "flexibility" you mention could get in the way of getting good at it.
Now this is just my biased observation but it seems "JavaScript masters" often have other programming languages under their belt. So perhaps part of the journey of mastering JavaScript is to learn and use some other language—preferably far away from the usual C-inspired imperative dialects—and then come back to JavaScript (or perhaps TypeScript).
Thank you a lot for your detailed response! With the quote, which is from me, I simply wanted to express, that JavaScript can be a way to begin learning how programming works in general. I agree on that knowing how to use a pogramming lagnuage does not necessarily teach you how to program "good programs", like large projects, which can be changed without big issues.
Also I would recommend not to stick to only one language, as you mention with the possible "journey" at the end.
IMHO it depends on the learner expectations or the purpose of learning to code.
Let's split it into three use-cases:
People want to learn something fast with working as junior dev
JS is the king at this moment (marketshare).
Now we have MERN stack which I think it's OK, BUT I really feel that Mongo is not the best DB to begin with.
To proper use a relational DB you need to learn about Database normalization , at least 1FN, 2FN, 3FN and Boyce Codd.
It helps you understand how to link data, Referential integrity and so on. It's a bit larger path but sure it will pay back when working with ORMs or in a real life project.
Even when creating your own data structures or thinking how to store or send information in a project.
People from other disciplines that want to build it's own website/webapp
Or learning how to code just for fun and show things to family and friends.
The LAMP stack has been the king for a single reason, It does not require to learn deeply, you can understand the basics and jump off to make wordpress/prestashop plugins relatively fast so you can have a strong base of code (a popular CMS) with a good support (most companies that offer hosting for WP, PS and so on help customers with some customizations).
People who want to learn the bowels of how coding works
IT students or junior devs in the industry that want to go deeply.
I'll suggest C or similar languages.
I think coding in a procedural way is more understandable at the beginning as things are executed from top to botton and one after the other. Each file is a context and if you forgot some stupid thing it breaks and you'll need to fix it.
Plus it makes you allocate the memory for your variables and so, thus you can understand what is happening behind the scenes in other languages environments/runtimes much better.
The knowledge that gives you coding for a while using C can be astonishing.
Thoughts?
Thank you, I like how you emphasize how JS allows to execute code without any error when trying something, which is possibly not ment to work. Some things like hoisting can make it more difficult to learn it, too.
Hahaha I read your comment with irony because I didn't mention those things but I realized that suggesting C is enough. 😆
Each language/environment has it's own pros and cons. Js is a flexible language that I love (I've preference for scripting languages such JS, Python, PHP, Ruby...) but those are just my preferences.
JS is not bad but reaching the point to be considered as not-bad-JS-Dev is probably a longer way than with other languages that are more strict.
That may be the reason for many people to engage quickly with TS and blame JS. Personally I think that it's ok to use one or another when it fits. Using TS in any case seems a bad idea even as a concept.
Sorry, if this has not been be best answer to your detailed response, but yes, your response kinda reminded me of how JS allows a lot, which is not always great.
I am currently working a lot with JavaScript and comparing with C#, C# is more strict. Surely not the same as C, but I hope you get the idea.
I also agree on that you can be pretty good with JS, but this possibly takes much time.
For TypeScript I know, that it only extends JS, it does not solve many issues, because these get not replaced and still exist. You actually need to make use of the "good" features of TS and avoid the "bad" ones from JS.
I hope this answer fits better this time.
No problem,
I understand what you say as I worked with C++, C#, Java, Python, PHP... in the past so got a nice overview of different programming languages, plus I saw good code and rubbish code in all of them thus I won't blame JS for that, instead work along with the team to improve the overall result of the code and its quality.
In technology there is nothing like good or bad. It's all about your interest + you also need to be aware what's going around in technology world so that you can also evolved with it. If its your interest Go Mann!! I am also coming up with series of JavaScript blogs from 0. Follow me for more. Cheers!! :)
probably better than python or any other higher level language