Live data from Hacker News

JavaScript for Impatient Programmers

exploringjs.com

31–40 of 104 posts

Re: JavaScript for Impatient Programmers

#31

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

Yeah, I tried this approach and got as far as authentication. At that point Google would only tell me what not to do.

Re: JavaScript for Impatient Programmers

#32

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…

Broadly agree - JavaScript and typescript especially are an absolute joy and delight to code with.

I use TS professionally, and it is my go-to choice for personal projects too.

Deno and vscode have brought an extra dimension of awesomeness - I personally never liked using npm (and therefore node) and try to avoid it.

Re: JavaScript for Impatient Programmers

#33

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

Yes, node.js and JavaScript transpile issues in particular are super annoying. But idk if any book would help you with this either.

I recently discovered Vite (with pnpm) and so far I haven't had any annoying JS/npm/engine issues, so that would be my recommendation. Generally to setup something I either a) run ` init`, b) "create new project" in IntelliJ, or c) clone a medium-sized project on GitHub, then remove the code and leave the configuration files.

Re: JavaScript for Impatient Programmers

#34

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…

The problem with this is that sometimes a good tutorial gives you insight on how they do things in the language/framework way.

If I pick up something new and just try to piece things together using a sample project or whatever, I tend to think in ways from the most familiar language I work in.

Also without familiarity, you can’t judge if the sample you picked is super opinionated or does things in a weird way.

Re: JavaScript for Impatient Programmers

#35

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

It depends on what exactly your app is because you might be able to use existing solutions.

But my recommendation is Firebase or Supabase. These tools were basically designed for this type of webapp. I know a team of junior devs who created a production-app in a few weeks with Firebase. Firebase handles authentication, the database REST endpoint, and various other common webapp functionality, so that stuff is seriously achievable in hours. In Supabase "signup", "login", "login with provider", "send reset email" are all single JS functions.

Re: JavaScript for Impatient Programmers

#37

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

Right, you need some historical context to understand the situation. 10 years ago JS was a shitty language with a far worse ecosystem. It deserved the hate it got. Then ES6 came along 6 years ago or so and added tons of super valuable language features. Suddenly you don't have to deal with the hoisting semantics of var or worrying about what 'this' is all the time. It was so nice that people started using Babel to use the new features ASAP. Then a couple years later, once everyone has a transpiler in their build process without a second thought (this used to be controversial!), TypeScript comes along and provides another huge leap in how pleasant the language is to use.

Now it's a pretty nice ecosystem, but it used to be pretty bad. Not everyone's biases have caught up yet.

Re: JavaScript for Impatient Programmers

#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 and wrong. I’ve read a language guide A to Z for every PL I used in my life (a bunch), and can say by skimming through few rough/key topics that it is definitely a good one. No offense, but my advice is to not apply your advice when there is a good guide. You’ll save both your own time and the one’s who will come after.

Re: JavaScript for Impatient Programmers

#39

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…

Do you have an example of a DOM operation that is async ?

Re: JavaScript for Impatient Programmers

#40

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…

You cannot just google your way through it. There are times when you don't even know what to google. I remember as an early beginner being stuck with something that had to do with closures. I had no idea what was going on and didn't know what to google and when I asked questions on stackoverflow and reddit please started saying things about decorators and whatnot!!! It is only when I sat down and went through some kinds of structured tutorials that I knew what had stomped me. Sometimes, you ight just have to be aware of some problems even if you'd don't understand them properly but you are aware of their existence and what they are called.
Post reply on HN