Live data from Hacker News

JavaScript for Impatient Programmers

exploringjs.com

11–20 of 104 posts

Re: JavaScript for Impatient Programmers

#11

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.

Which is better than thinking you know what you don't know.

The most important thing impatient programmers need to learn is TO NOT BE IMPATIENT, not how to learn a programming language in X minutes.

Learning patience will help you in all aspects of life.

Do you really want to share the road with somebody who learned to drive in 5 minutes, and doesn't have the patience not to speed, tailgate, run stop signs, red lights, and pass you on the right by driving on the sidewalk?

More "real" advice: Read LOTS of other people's code.

Need to use a library? Then first read the documentation, then read the source code, so you actually understand what it can do, how it does it, that it's not magic, what its limitations are, how to use it, and if you actually need it.

I've been working on learning and reading the D3 data visualization library for several years, bit by bit. It's a wonderful library, there's a whole lot to it, the code is brilliant and expertly written, and I've learned a LOT about JavaScript programming in general by reading different parts of it again and again.

https://github.com/d3/d3

Mike Bostock: 10 Years of Open-Source Visualization: Did I learn anything from D3.js? Let’s see…

https://observablehq.com/@mbostock/10-years-of-open-source-v...

>In honor of D3 1.0’s tin anniversary, I thought I’d reflect on lessons learned. This isn’t intended to be too comprehensive or serious — just a handful of observations as I look ahead to the next ten years. But I hope a nugget or two will interest you, too.

HN discussion:

https://news.ycombinator.com/item?id=26240339

Re: JavaScript for Impatient Programmers

#12

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 spent the last week doing exactly this after going over a decade without making a web page and having never done anything java related. The key thing for me was finding an existing website i liked that was hosted on github pages and used that as a template/example to see how things fit together. The learning curve at the very beginning was brutal, but once you get a few toeholds and can iterate things quickly start falling into place. The problem with the textbook approach is you don't know what you can skip until you already know it.

Re: JavaScript for Impatient Programmers

#13

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'm the type that likes to learn from some real, existing codebase. This is frustrating in the JS space, as you would have to have the right version of a bunch of stuff to do that, and how to use it. Libraries, packers, packagers, frameworks, minifiers, and so on.

Other languages have some of that sprawl, but none quite to the same level, and none with the same pace of change.

If you learn like me, my advice would be to have a list of potential candidate projects to learn from and move on to the next one when the tool and dependency hell proves too much.

Re: JavaScript for Impatient Programmers

#14
post #13

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'm the type that likes to learn from some real, existing codebase. This is frustrating in the JS space, as you would have to have the right version of a bunch of stuff to do that, and how to use it. Libraries, packers, packagers, frameworks, minifiers, and so on. Other languages have some of that sprawl, but none quite to the same level, and none with the same pace of change. If you learn like me, my advice would be…

I find that generally true of every other language except JS. You run `npm i` and all correct dependencies are installed.

Re: JavaScript for Impatient Programmers

#15

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 spent the last week doing exactly this after going over a decade without making a web page and having never done anything java related. The key thing for me was finding an existing website i liked that was hosted on github pages and used that as a template/example to see how things fit together. The learning curve at the very beginning was brutal, but once you get a few toeholds and can iterate things quickly start…

Most stuff getting slung around, as the parent mentions, is rooted in the kind of development that relies on NPM-adjacent tooling. The two things you mention (Java and modern Web development, especially something modelled after another thing found on GitHub Pages) tend to be miles apart in this decade. Where does Java come in to it?

Re: JavaScript for Impatient Programmers

#16

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…

How much time would you say is fast enough to build a full front end and back end login/authentication system in nodeJS with any db ? I mean including throttling, pwd reset, forgot email/pwd, 2fa, confirmation email etc? Most of the tutorials are notoriously outdated and won't work bc dependencies, but I have build one such app.

For someone who knows the J's basics , I mean

Re: JavaScript for Impatient Programmers

#17

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…

> every time you encounter a problem google it.

One "patience" problem I have is that problems are usually much more complex than they appear. Node is giving you some random dependency error? It's because you need to install X. But to install X you need to install Y. But to install Y you need to install Z. But Z requires some specific node version. But that specific node version will break A, and to not break A you need to install B which requires you to disable your Mac's SIP so that it can work with X. If I sniff that I problem will lead me to a hole like this I get so annoyed that I start avoiding that specific platform as much as I can.

Software is so fragmented nowadays that even setting up something simple requires you to handle tons of difference pieces for no good reason. Monopoly aside, this is one reason I like Apple having full control of iOS development.

Re: JavaScript for Impatient Programmers

#18
post #13

Earlier quoted context omitted.

I'm the type that likes to learn from some real, existing codebase. This is frustrating in the JS space, as you would have to have the right version of a bunch of stuff to do that, and how to use it. Libraries, packers, packagers, frameworks, minifiers, and so on. Other languages have some of that sprawl, but none quite to the same level, and none with the same pace of change. If you learn like me, my advice would be…

I find that generally true of every other language except JS. You run `npm i` and all correct dependencies are installed.

Was not my experience. The system npm was either too new or too old for the codebase I picked (can't remember). So uninstalled, installed a different one, then some unfixable issue with something called fsevents, other issues regarding "peer dependencies", etc. Similar issues with the second one I tried.

The third project I went with went much better, though it was still difficult to learn things (even if they are working) as every project seems to choose different build/deploy tools.

Re: JavaScript for Impatient Programmers

#19
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 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-...

Re: JavaScript for Impatient Programmers

#20
post #18

Earlier quoted context omitted.

I find that generally true of every other language except JS. You run `npm i` and all correct dependencies are installed.

Was not my experience. The system npm was either too new or too old for the codebase I picked (can't remember). So uninstalled, installed a different one, then some unfixable issue with something called fsevents, other issues regarding "peer dependencies", etc. Similar issues with the second one I tried. The third project I went with went much better, though it was still difficult to learn things (even if they are wo…

Sometimes I forget about npm v7-8 (the latest versions). They're "backwards compatible" if you consider "breaks everything" a form of backwards compatibility.

So maybe you're right. Perhaps everything is terrible everywhere.

Post reply on HN