13 ms·
JavaScript for Impatient Programmers
- gmiller123456 5y agoFor people who have taken the time to read it, or taken enough time to evaluate it: is there really anything in this book that would appeal to "impatient programmers"? From what I've looked at, it seems to be a fairly typical programming book, and I fear the title might be deceptive.
- tartoran 5y agoFrom what I gather it has a good table of contents from which you can jump to the section you’re intetested and ignore the rest. That’s good for an inpatient dev who needs to learn what they need at the moment of the inquiry.
- Nullinker 5y agoVery nice and comprehensive resource. I don't consider myself impatient but appreciate the high information density and the ability to quickly skip past the parts that I already know and actually learned a few new things.
- ropeladder 5y agoAgreed. This looks like something I will be coming back to. Rules of thumb, recommendations, and reasons for their recommendations -- I'm in heaven. Too few resources hit the sweet spot between introduction and arcana.
- jmnicolas 5y agoIf I was impatient to learn JS I would gasp at the number of chapters (45)!
- ryannevius 5y agoA resource I commonly turn to when I’m feeling impatient is Learn X in Y Minutes: https://learnxinyminutes.com/ https://learnxinyminutes.com/
- DonHopkins 5y agoThat's a great resource, but not a miracle cure for ignorance or magic pill for knowledge and skill. If you're actually serious about learning to program, then it's going to take more than a few minutes of your life to learn. But if you can't stomach investing more than a few minutes in learning to program in JavaScript or any other programming language, then you should really find something else do to with your extremely limited time. Teach Yourself Programming in Ten Years, by Peter Norvig: https://norvig.com/21-days.html https://norvig.com/21-days.html The last time I posted a link to this important essay, impatient people who weren't very serious about investing any time in learning or reading simply and immediately responded to the title, but didn't bother to actually follow the link or read and respond to any of Peter Norvig's brilliant essay (and probably didn't even know who he was), so here is an excerpt. >Researchers (Bloom (1985), Bryan & Harter (1899), Hayes (1989), Simmon & Chase (1973)) have shown it takes about ten years to develop expertise in any of a wide variety of areas, including chess playing, music composition, telegraph operation, painting, piano playing, swimming, tennis, and research in neuropsychology and topology. The key is deliberative practice: not just doing it again and again, but challenging yourself with a task that is just beyond your current ability, trying it, analyzing your performance while and after doing it, and correcting any mistakes. Then repeat. And repeat again. There appear to be no real shortcuts: even Mozart, who was a musical prodigy at age 4, took 13 more years before he began to produce world-class music. In another genre, the Beatles seemed to burst onto the scene with a string of #1 hits and an appearance on the Ed Sullivan show in 1964. But they had been playing small clubs in Liverpool and Hamburg since 1957, and while they had mass appeal early on, their first great critical success, Sgt. Peppers, was released in 1967. This essay is a classic that's been discussed on HN numerous times: https://news.ycombinator.com/item?id=27411276 https://news.ycombinator.com/item?id=27411276 https://news.ycombinator.com/item?id=20543495 https://news.ycombinator.com/item?id=20543495 https://news.ycombinator.com/item?id=16574248 https://news.ycombinator.com/item?id=16574248 https://news.ycombinator.com/item?id=5519158 https://news.ycombinator.com/item?id=5519158 https://news.ycombinator.com/item?id=3439772 https://news.ycombinator.com/item?id=3439772
- ai_ia 5y agoThis essay, which has helped fixing my initial mindset a lot, is directed for complete beginners. The website OP mentions is for someone who already knows how to program well in one or more language and want to take a quick look at another language syntax.
- armchairhacker 5y agoMy "real" advice for impatient programmers: just start programming, and every time you encounter a problem google it. Don't know how to setup node.js? Google should lead you to `npm init` or a starter. Getting some weird syntax error? Google it. Once you learn the basics, want to do X? Google it and determine a) how to do X, or b) if X can't be done / is bad practice. Just by diving head-first into whatever you're trying to accomplish (or a toy project if you just want to learn), eventually you'll start to get the hand of syntax, libraries, and general programming style. But read articles every once in a while on best practices so you aren't learning the "wrong" way to do things. The big drawback is that there are a lot of Google results that are outdated, novice, or flat-out wrong. You have to really learn how to do research on the internet. But this is a skill you should learn because you can apply it to anything. My general advice: consult official docs whenever possible; Stack Overflow is reliable but check the answer's comments to see if it's outdated; use Reddit to compare X vs. Y; try to avoid long wordy articles on bloated sites, generally the better the writer = the better the article and more likely it's accurate.
- threatofrain 5y agoI'd also add my own 2 cents: if you're Googling stuff related to syntax then make MDN your first stop; or you might consider one of MDN's many entry points to learning JS. Also check out prominent Discords/Slacks/etc because it's nice to have human help when you're blocked, and sometimes you need opinions rather than facts.
- malshe 5y ago> "My "real" advice for impatient programmers: just start programming, and every time you encounter a problem google it." In my experience, this is a terrible advice. However, many of my students follow this advice over my protests and only a handful of them actually learn anything at the end of a long masters program.
- bruce511 5y agoI agree. But over the years I've come to understand there are two kinds of learners; a) "I learn what I need to accomplish this task". This is observed as question/answer and only the simplest version of the answer is needed. So something like "how do I create a variable x and assign 10 into it. All he's looking for is x = 10 b) The second kind wants to understand the nuance of what's happening, so they can apply that nuance to future code. They are looking for an answer, but the are interested in the working that leads to the answer. So in the above example they want x = 10 var x = 10 let x = 10 options{x:10} and so on. They digest when to use one and when to use another, and they delight in using the correct form in the correct place. In my experience (a) programmers will get through tasks quickly, but with shallow understanding. They will eventually have all the tools, but lack the ability to see the big picture. They struggle to read other people's code. On the other hand (b) programmers learn much more slowly, they take a lot of time to accomplish tasks because they are being distracted by their curiosity. But after that investment they easily outstrip their peers in productivity, and more importantly can do things that an (a) type programmer can never do. What I've come to accept though is that giving a (b) answer to an (a) questioner just leaves them confused. They asked about assignment, and a discussion of scope just leaves them befuddled (since they don't know what scope is anyway). Which can be frustrating to the answerer who is a type (b). Type (a) should not be doing a Masters program in the first place, so I feel your pain in that regard. Google is great when you're out in the world, but it's a terrible way to "big picture" learn.
- underdeserver 5y ago> Impatient > Table of contents takes 15 minutes to read
- giantrobot 5y agoMy biggest hurdle with JavaScript was getting things to happen in order. Functions can be unexpectedly colorful[0] and contortions and boilerplate is needed to deal with that. What was unintuitive to me was a lot of interactions with the DOM are asynchronous without being explicit about it. So you've got to chain a bunch of asynchronous calls together to make sure a sequence of events occur. Most other languages make this sort of asynchronous callback hell explicit. Once you understand this aspect of the language it's an annoying (to me) idiosyncrasy but manageable. Before you understand it there's a lot of pouring over poorly written tutorials that gloss over it like it should be obvious. [0] https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/ https://journal.stuffwithstuff.com/2015/02/01/what-color-is-...
- simlevesque 5y agoDo you have an example of a DOM operation that is async ?
- giantrobot 5y agoCreating a new element on the DOM, especially when it is creating a new script element. It takes non-zero time to load and parse but returns control to JavaScript immediately. So you need to wait on the element with like onLoad before calling a function in that script. There's some more instances I've forgotten. The situation is better now with promises but it was a pain in the ass just a few years ago.
- simlevesque 5y agoWell, yeah, some DOM elements have async side effect, but they are still added to the DOM synchronously. Creating the element and loading it's content are two completely separate things.
- giantrobot 5y agoThat's non-obvious to people from other languages, at least it was to me. The asynchronous nature of DOM manipulation also comes up when the DOM gets large and you naively try updating elements querying by tag or class. It's idiosyncrasies aren't deal breakers but they're non-obvious. They also crop up once you're into medium complexity code. At the level of simple/trivial code machines and JavaScript engines are fast enough to paper over naively written code. But you get to a certain level of complexity and you get bit by some colored function issue or something. It's annoying bringing something up where JavaScript is not the primary focus of the project. This is all anecdotal, there's plenty of people that might never have issues. But it was all stuff that tripped me up around 2009-10 having to write some JS after not having touched it since before you could make XHRs or manipulate the DOM directly.
- mrkentutbabi 5y agoI really don't understand why people hate JS so much. I myself a primarily a JS dev, and now a TS dev. TS made the experience so much so much better. JS is like pretty much a programming language for average software engineer like me. Sure, JS build system is a pain. I am the go to build system guy for almost every company I've been with, I worked with Grunt, Gulp, Webpack 1,2,3,4 and etc and yes I hate it, but other than that it works really well. If you don't touch frontend you can pretty much forget build system entirely. npm init is so easy. Async is easy as well. I really don't understand the hate, what am I missing? Maybe I'm too dumb for other programming languages. I did try various languages from Java, Elixir, Haskell, Rust, Go, Ruby, Python and JS is simply the best in productivity, expressiveness, ease of use and performance balance. As long as you don't code in a clusterfuck way, it is so easy to write JS and compose JS functions. Just use functions everywhere, no need class. JS is very readable. Like, seriously, Python has Python2 vs Python3 package and build/deployment problem. Haskell is difficult and the tooling is abysmal. Rust is difficult and too much choices to just write this and that. Ruby has no tpe system and slower than JS. Python is also slower, no good async, and its type system is not expressive as TS. Go's type system isn't expressive enough. Java type system is too much and JVM is complicated. Scala is complicated. JS/TS is: - simple/easy to use - pays the bills (you can go anywhere and find jobs as JS/TS dev in almost every company in the world) - everywhere, like from IoT to robotics to game development to server to frontend to regular scripts - easy programming language to do Leetcode style interview as well - if you wanna do Option/Maybe style error handling like Haskell/Rust/Go you can do that with TS, just wrap try catch and return the error with neverthrow library. This makes TS programming bliss!!! I freaking love it If you don't want to care about setting up NodeJS + TS, now you have Deno, who's pretty much out of the box everything just works. JS/TS is such a super boring language it feels like cheating your way out of software engineering. It is a language made for dumb people like me, maybe that's why it has no appeal for hardcore programmers. I owe to JS/TS on changing my life and giving me a good living. Like, seriously I don't understand the hate...
- bigyikes 5y agoI think a lot of JS haters haven’t spent much time with modern JS. That’s how it was for me, at least. I would laugh at JS wat-isms and think back to the old days of jQuery spaghetti. Python was my favorite language. Now I’m a full time JS/TS developer and I love the language. It’s a dream to use. The syntax is concise and logical, the ecosystem is vibrant, and the barrier to entry is low. I wish there was more JS in the scientific, CV, and ML spaces — Python is still superior here, imo — but otherwise JS is my go to. It’s no wonder we see the rise of Electron apps - the developer experience is just so much better.
- Madmallard 5y ago>For impatient programmers >45 modules
- justinpage 5y agoAnother resource to consider for Modern JavaScript: https://javascript.info/ https://javascript.info/
- Juju_z 5y agoI like how clean this guide is. Are there any similar guides for Python as a quick reference?
- Lamad123 5y agoI bet even the patient wouldn't put up with that gigantic list.. 45 "chapters" is kinda too much!
- oblak 5y agoHN: Is today's hectic javascript making you tense and impatient? Me: Shut up and get to the point! Yeah, it's a futurama quote On topic: This is quite a list so I just clicked a random link and voila: > 7.1.1.3 Assertions > An assertion describes what the result of a computation is expected to look like and throws an exception if those expectations aren’t correct. For example, the following assertion states that the result of the computation 7 plus 1 must be 8: > ... > assert.equal(7 + 1, 8); > There is also assert.deepEqual() that compares objects deeply. What? Am I going crazy? Have my years of wild hedonism finally caught up with me? I don't see jest mentioned but fired up my browser's console and sure enough, there is no "assert" in my window. What am I missing here?
- backoncemore 5y agoI got my start in programming in the early 2000s with Perl and, shortly after, PHP. I went through school mainly with C++ and Java and got a job as a .NET developer after. I say all this because I fucking hated JavaScript with a passion. From the time of my initial foray into programming until my later years, I hated it. It was always a joke of a language that, honestly, caused me to develop such a bias that I nearly refused to use it, for a very long time. Several months ago I decided to put my prejudices aside and began playing around with Nodejs and React. The main motivation was trying to learn more about front end development and guess what? I really enjoy JavaScript. JavaScript is a very enjoyable language to play with. It has come such a long way despite, literally, all odds. The ecosystem is scattered. The build system is the most hacky monstrosity you’ve ever encountered. But, that’s one of the reasons I love it. It feels like the essence of what I feel when I imagine hacking. And not only that, it uses a unique (at least to the paradigms I’m used to) execution model that is very performant. These are just a lot of words for me to say I love JavaScript.
- codethief 5y agoI dunno… I started around the same time as you, also with PHP. I posted this comment[0] the other day where I tried to put into words how much I hate JavaScript and, judging from the reactions I got, it seems the community is pretty split on this one. [0]: https://news.ycombinator.com/item?id=29193470 https://news.ycombinator.com/item?id=29193470
- nirav72 5y agomy background is similar to yours. I still hate JavaScript somewhat. But I can tolerate it a bit more than I could 10 years ago. Possibly because of advancements in development environments and tools.
- levmiseri 5y agoFor people that want to learn/improve in javascript in a more 'entertaining' way — I made an educational javascript RTS game: https://yare.io https://yare.io
- Lordarminius 5y agoI read the previous version of this book and found it very good. Highly recommended.
- cschmidt 5y agoI will say I’ve read this book all the way through one and a half times, at which point I decided it wasn’t a good book. I’m an experienced programmer new to JavaScript, so the target market for this book. It is terrible for reading from start to end, and has lot of details and obsolete language features I just didn’t care about. I looked around a bit and found the perfect book for me: Modern JavaScript for the Impatient by Cay S Horstmann. A terrific way to learn JavaScript.
- ultrasounder 5y agoThanks for Your extensive review on Amazon `This is an exceptionally good book. If you know how to program in some other language, and want to pick up JavaScript, then this is your book. It did an excellent job of explaining everything in a logical order, telling a good story. Read through the 300 or so pages from start to finish and you'll be set to move on the JS web framework of your choice. (The recently updated JavaScript: the Definitive Guide seems the other alternative, but it is 665 pages to wade through.) I especially liked how the author came up with 5 golden rules to follow right up front, such as "avoid automatic type conversion". JavaScript has so many crufty historical flaws, and by following these rules, he doesn't have to explain all the weird historical stuff. That cut out a lot of laborious explanation of things you shouldn't do anyway. The examples were very well chosen. They focused on the important stuff, yet still explained the key gotcha's inherent in the language. Every paragraph seemed to have an important point. It is a shame this is only the 85th most popular JavaScript book (as of now). It deserves to be better known. It is a classic, and perhaps the best computer book I've read since "The Go Programming Language". Highly recommended.`. Will add this to my read-list after I complete WatchAndCode
- seodisparate 5y agoAs someone with a C/C++ background, this gist was a good reference for those times I needed to use Javascript: https://gist.github.com/yig/8744917 https://gist.github.com/yig/8744917
- bern4444 5y agoWhat I like about JS is I can write nearly everything with const. Functions are const, data is const, and I rarely use classes. It removes a lot of overhead, avoids this questions, and makes everything consistent and so makes spotting similarities and differences easier. I can do const myFunc = () => 2; const res = myFunc(); It helps with the mindset of treating functions as data that can be acted upon similar to how data can be.
- ironmagma 5y agoYes, but it’s with the caveat that (like C++) const does not mean that the whole value is constant. It doesn’t even really mean any part of the value is constant necessarily, just that the symbol cannot be reassigned. I don’t know that it eliminates that many questions, but it does eliminate one question, which is whether that variable will be reassigned. Arguably that doesn’t tell you very much.
- bern4444 5y agoIts more for style true, but I also try to avoid directly modifying an object's properties and values.
- shrimpx 5y ago“For impatient programmers” … 46 chapters.
- darepublic 5y agoIn regards to global references, this guide suggests not to use the window prefix but doesn't really explain why except to note that it's unnecessary. I am guessing this is because window is not available if the js is running outside the browser. But if the code is intended to be run in the browser and won't work elsewhere I prefer adding the prefix to signal that.