5 ms·
"JavaScript: The Good Parts" is a fantastic book, but anyone telling you to read it if you're coming at JavaScript as your first language is doing you a horribl
by georgemcbay 14y ago
"JavaScript: The Good Parts" is a fantastic book, but anyone telling you to read it if you're coming at JavaScript as your first language is doing you a horrible disservice.
It is a fantastic book for learning to avoid being bitten by all of the stupidity in JavaScript if you're used to programming in sane languages, but it isn't a tutorial or "Learn to Program" book by any stretch of the imagination.
To be completely honest, I'm a bit horrified people are learning JavaScript as a first language at all. The language does indeed have its "Good Parts" and it is incredibly useful because of its ubiquity, but I just wonder how many young brains are going be hardwired to think some of the design choices (the way block scoping works/doesn't work, equality, lack of modules, etc, etc) in current JavaScript versions are normal, when in fact they are very unfortunate.
- simonlc 14y agoJavaScript was my first language. I learned allthe basics of programming in it. I quickly got frustrated because I still did not know how to make anything complex. I switched to python and it almost was like easymode. With python I was much more able to learn how to make things. Now I'veswitched back and I hate it. I'm continually forced to go out of my way with js to make things work properly. Thought now at least I can work on html projects that I can share, python on the other hand can't do that.
- hmart 14y agoAside from the "Good Parts" debate, the Crockford JS site is extremely insightful http://javascript.crockford.com/ http://javascript.crockford.com/
- kevincennis 14y agoI learned JavaScript first, and I think in many ways I'm actually better off for it. Anyone who's serious about JS hears constantly about the problems of lexical scoping, type coercion, lack of modules, etc. When I moved on to learning PHP and Python, I largely knew what to expect - and found them both pretty easy (aside from PHP's standard library being ENORMOUS and impossible to memorize). On the other hand, I've seen people coming from classic OOP languages really struggle with things like first class functions and prototypal inheritance. I don't think the problem is that people are learning JavaScript as a first language. I think the problem is that a lot of people who write JS don't ever really learn it.
- deleted 14y ago[deleted]
- kevincennis 14y agoI don't mean to come off as snarky, but I'm not totally sure how this relates to my comment.
- deleted 14y ago[deleted]
- zimpenfish 14y agoU1> I've seen people coming from classic OOP languages really struggle with things like first class functions and prototypal inheritance. U2> He argues (and I agree) that prototypal inheritance isn't complicated unless you're coming from a very classical inheritance background. Aren't they the same point?
- kevincennis 14y agoHmm. There was another comment in the chain last night about why Dart doesn't use prototypal inheritance. That's what I was replying to. Must have been deleted and orphaned the comment above.
- philipwalton 14y agoJohn Resig made a similar point in an article discussing using JavaScript as an intro language for the Khan Academy. http://ejohn.org/blog/introducing-khan-cs/ http://ejohn.org/blog/introducing-khan-cs/ He argues (and I agree) that prototypal inheritance isn't complicated unless you're coming from a very classical inheritance background.
- Ovid 14y agoThe "classical inheritance background" frustrates the heck out of me at times. I strongly encourage developers to look at traits/roles -- http://en.wikipedia.org/w/index.php?title=Trait_(computer_programming) http://en.wikipedia.org/w/index.php?title=Trait_(computer_pr... -- for OO development and the first thing I have to do is to try to get them to "unlearn" class-based inheritance.
- groovy2shoes 14y ago> I just wonder how many young brains are going be hardwired to think some of the design choices (the way block scoping works/doesn't work, equality, lack of modules, etc, etc) in current JavaScript versions are normal, when in fact they are very unfortunate. Your concerns echo those of Edsger Dijkstra when he discussed the educational shortcomings of popular PLs in 1975: http://www.cs.utexas.edu/users/EWD/transcriptions/EWD04xx/EWD498.html http://www.cs.utexas.edu/users/EWD/transcriptions/EWD04xx/EW... For what it's worth, I share your dismay. However, I (and many others) cut my teeth on BASIC -- turned out just fine.
- calinet6 14y agoTrue. I think the best characteristic of a programming language is that you can do really cool stuff with it that makes you want to learn to program, and enjoy the results. Javascript has a monopoly on doing cool stuff in a web browser, so for that reason alone it makes it fun to learn. Heck, thousands of programmers (myself included, come to think of it) got started on programming because of "DHTML" and script kiddy DOM manipulations back in the days of Netscape. It was a gateway language. Fortunately I learned the fundamentals more thoroughly in Scheme...
- calinet6 14y agoAgreed, the best advice I can give is to learn core programming concepts (and if possible, computer science concepts) first, in a good language which elucidates them without getting in the way. Lisp is one, Python may be even better, Ruby wouldn't be bad. Then take on Javascript, since it has some complex ideas and constructs. Also "the way block scoping works/doesn't work" in JavaScript is weird, but it has closures and first-class functions, which are way cool and sort of make up for it. Coffeescript makes using these easy, thank goodness (these are the kinds of concepts I wouldn't want to deal with when learning how to program for the first time).
- ibudiallo 14y agoTo me javascript made perfect sense as a first language. If i had to start with pointers in C, i would have given up long long time ago.
- why-el 14y agoJohn Resig makes a good argument for JS as a first language. [1] [1] http://ejohn.org/blog/javascript-as-a-first-language/ http://ejohn.org/blog/javascript-as-a-first-language/
- jiggy2011 14y agoNo worse than us 80s kids who started with basic.
- PommeDeTerre 14y agoI think it is worse today in some ways. There was never the cult-like following of BASIC that we see with JavaScript. While there were people who did prefer BASIC for one reason or another, virtually all of them would readily admit that it was inferior to languages like C (and C++ later on), the various dialects of Pascal, and Fortran for any serious work. We don't see this when it comes to many JavaScript programmers today, however. A lot of them don't even know any other languages aside from JavaScript. Others refuse to acknowledge its many, many inherent flaws. This in turn leads to them trying to use it for serious work, often with disastrous results. This is especially apparent with node.js and server-side JavaScript development getting more and more hyped. I'd much rather deal with a BASIC programmer who at least knows and acknowledges the downsides of his preferred language, rather than a JavaScript programmer who either doesn't know or refuses to admit the vastly more serious flaws with his preferred language.
- jiggy2011 14y agoThere was a pretty big BASIC cargo cult back in the day. I didn't even really know what C/C++ were for a fair few years of programming apart from some vague notion that they were used for games because they were faster. In fact back then you had to pay for C compilers usually, whereas BASIC interpreters were often free with the platform so it was fairly common to have never used anything else. That became further cemented with Visual Basic it's legions of copy/paste & visual designer oriented developers. Javascript has a large following not because it's a particularly great language but because it is so ubiquitous. The draw of stuff like node seems to be more to do with code-reuse and having a language that is async-by-default rather than necessarily not knowing anything else.