3 ms·
> Can it be that JS is not good starting language then? @ozim, I don't believe you are trolling! JS is an absolutely awful language for beginners; it's a 155m
by denton-scratch 5y ago
> Can it be that JS is not good starting language then?
@ozim, I don't believe you are trolling!
JS is an absolutely awful language for beginners; it's a 155mm howitzer pointed at your foot. Although you can get the hang of the basics quickly, AND it runs in the browser (super-convenient unless you're headless), those "basics" that you thought you'd got the hang of turn out to have semantics that make sense, but are not what you expected.
I wrote JS (about 0.2 of my time, I guess) for my job, for about 20 years. I got 18 out of 25 on that test. Now, I think it was actually an easy test; I got a third of my answers wrong because I haven't learned about a third of JS semantics. I'm either not very good, or not as smart as I like to think.
A certain recent colleague of mine would probably have got 25/25; he was cleverer than me, and he was REALLY into Javascript.
Try a Pascal-type language, to learn an imperative-type language. Modula2 is better. Learning Prolog is (I think) purely declarative, so it gives you the view from the other side of the curtain - as it were. Forth is a perfectly-feasible beginner's language; it was the second language I learned.
I can't recommend any OO language for beginners. Not because I think all OO languages are way too difficult, only all the ones I've used. I haven't used Smalltalk.
I haven't used any flavour of Lisp. That language is so pliable that I'm sure there's a flavour that would be good for beginners.
[edit] Actually, I wish I had learned a functional language like Lisp as my starting language; I strongly suspect that would have made me a better programmer throughout my career.
- ozim 5y agoI am not trolling just a honest question based on parent poster experience. I agree OO is too much for any beginner. Getting started with procedural thinking + basic types is in my opinion a requirement. I agree nice parts about starting with JS is that basically only things you need is text editor and a browser. Unfortunately data types will show up one way or the other so there is no need of hiding those. Even in Excel creating formulas one has to understand text vs number and difference between '.' and ',' and how operating system configuration make sometimes '.' to be decimal separator and sometimes ','.
- Hermitian909 5y agoHaving designed programming curriculum, I have to disagree that the language is a bad language for beginners (though it is very far from ideal). To be fair the primary reason is not really a virtue of Javascript per se, but the fact that it runs in the browser is a large pedagogical gain that no other language can easily match and is hard to overstate. Learning to program is overwhelming for most students, and setting up your environment is a major component of that. Being able to run your code natively in the browser is a huge boon. Even better, having that code immediately be useable in a very real sense boosts motivation significantly. For most students it really is preferable to let students get very comfortable with basic code constructs before having to interact with the underlying system in any meaningful way. At the language level, Javascript also has some nice affordances that let you treat constructs as simpler than they are in your curriculum and expand on them later. I think the best example of this is `var`. Viewing variables as uncomplicated "buckets" that happily contain any data you want to shove in them is a good starting place when introducing the very first building blocks of something like if/else control flow. Most languages are built with semi-experienced programmers in mind and are ill-suited for many beginners and actively bad for children. As an easy example: as a developer I like seeing type specifications for numbers, but pedagogically having to introduce the difference between ints and floats on the first day is just empirically confusing for most students. Much better for them to be "magic" until you can properly motivate them to care (which can be just a few weeks in!) I could write on this topic far longer than I have, but the short of it is that Javascript has done a truly surprising number of things right for a teaching language. I'd still love to remove some of the zany examples here if I could though.
- jonny_eh 5y agoI wonder if Typescript would make a great first language, since a subset of it runs in the browser, but the IDE and compiler can prevent some very bad bugs.
- Hermitian909 5y agoIt might be a good extension after they'd spent a good amount of time in plain Javascript, 50-200 hours in depending on age IMO (younger -> more). Adding types is, again, confusing to most beginning students and adding any sort of build process is asking for tears. The bugs, while unpleasant, just aren't actually that bad pedagogically. Students readily accept explanations of the form "computers are dumb and do what you tell them, if you tell them to do something that doesn't make sense they will do something that doesn't make sense" which is close enough to correct to not give them a terrible mental that is difficult to unlearn later. Additionally, at this stage of learning students should be writing many small programs. Such programs are typically easy for teaching aids to debug in seconds (or to suggest a radically simplified re-write).