Live data from Hacker News

JavaScript for Impatient Programmers

exploringjs.com

41–50 of 104 posts

Re: JavaScript for Impatient Programmers

#41

I 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…

> Async is easy as well.

An off-topic question: how do modern development practices using async code avoid race conditions and intermittent heisenbugs?

Re: JavaScript for Impatient Programmers

#42
post #38

My "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 tr…

I always found this way too clumsy, because you learn X but accidentally miss Y, and X becomes your tool of choice at places where it doesn’t really fits best or at all. Javascript traditionally had NO good language guides, and this one looks pretty like the one you should read in advance. Other resources are either more library reference-like, very situative or for unclear standard, not exhaustive, or just stupid an…

Start with Javascrip, the Good Parts.

Re: JavaScript for Impatient Programmers

#43

My 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…

If you were developing in JS in 2015 this hurdle is understandable.

Re: JavaScript for Impatient Programmers

#44

My "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 tr…

I like Google, or better Stack overflow, when you’re at your desk writing code. Books (preferably paper books), to browse in free moments when not working.

I used to keep a paper copy of “JavaScript pocket reference” on me, and pull it out on the train, or just sitting around at night, to help get the concepts.

Re: JavaScript for Impatient Programmers

#45

Very 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.

Agreed. 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.

Re: JavaScript for Impatient Programmers

#46

I 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…

I have done JS for several years and TS more recently. I think TS really fixes a lot of the issues that arise while building large systems in NodejS. But I think people are right to hate on the dependency nightmare that is npm. I could complain about several other things but really they apply to most popular dynamic languages...

Re: JavaScript for Impatient Programmers

#47
post #41

I 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…

> Async is easy as well. An off-topic question: how do modern development practices using async code avoid race conditions and intermittent heisenbugs?

I like async. It's is easy to reason about. In what paradigm are race conditions avoided completely? I know Rust avoids "Data Races" but not race conditions as far as I'm aware.

Re: JavaScript for Impatient Programmers

#48

I 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…

I believe the JS criticism is more about the culture and ecosystem than the language itself. In short: Most if not all JS devs are more interested in playing with specific tools and APIs rather than dealing with and/or implementing programming patterns and principles. In the last decade "small modules" skyrocketed the popularity of NPM and a lot of people pushed the idea of "don't reinvent the wheel just 'npm install' everything" and sadly it stuck. Basically all JS-related discourse reduces down to "use X instead of Y!". It started with packages, then libraries, then frameworks, and now meta-frameworks – hell even meta-meta-frameworks if you count the people raving about Blitz. It's like that period when young devs couldn't tell the difference between jQuery and JS but way worse. So yes, in a way you are in fact cheating your way out of software engineering by installing neverthrow or whatever. I mean the language is already pretty damn high-level already.

Re: JavaScript for Impatient Programmers

#49

My "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 tr…

The problem with this method is that you don't know what you don't know.

Agreed, this is how you end up with people hard-coding hundreds of iterations because they don't know what arrays or loops are. I think it's better to learn top-down and bottom-up simultaneously, by building your own projects as well as taking a more structured fundamentals course.

Re: JavaScript for Impatient Programmers

#50

I 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…

I don’t like JS and try to avoid it wherever possible. I have written some, but I’m not an expert by any means.

My problems with JS/TS:

Simple to start, but hard to program robustly and defensively. Due to the lack of typing, a lot of the codebases I’ve seen end up with extensive input validation code, which often uses fancy tricks that are hard to parse (unless you already know them). Typescript helps with this, but it is not the same as a proper type system because it is optional. Usually I run into runtime problems due to type errors with library code which doesn’t have types (or has the wrong ones).

The core language is filled with weird edge cases in coercion. jsfuck.com and https://www.destroyallsoftware.com/talks/wat are examples. This doesn’t affect my day-to-day code, but it’s equivalent to C undefined behaviour for me. A bunch of hidden rules that I don’t really want to extensively learn and understand, but which will bite me when writing anything moderately complex. ‘===‘ is good, but I think it’s really easy to miss the extra equals, especially if you write code in other languages a lot.

Lack of standard library (in Nodejs). For quick things, I find Python a lot better. The scant JS standard library has been widely criticised. This is a contributing factor to the absolute explosion in the dependency graph whenever you start pulling in a lot of the common dependencies. IMO, Go and Rust both do a better job despite having comparably easy package mangers.

Although some JS code is easy to read, I’ve seen lots of examples of overuse of functional indirection. Maybe it’s something I will start recognising the patterns once I’ve come across them more, I end up ragequitting JS codebases much more often than other languages. Despite its flaws, Go in a good editor is an absolute joy to understand new codebases.

I’ve found a combination of Python, Go and Rust to be the ideal combination. Each has its flaws, but for any specific use case, I can pick one I’d rather use than JS.

Post reply on HN