top | item 41160753

(no title)

rauschma | 1 year ago

I have used many languages in my nearly 40 years as a programmer (Scheme, C++, Java, Python, Haskell, OCaml, Rust, etc.) and still enjoy JavaScript: It’s decent as a language and there is so much you can do with it.

Tips:

• If you like static typing, you’ll want to use TypeScript. It’s more work to set up, but it catches many bugs, especially subtle ones where JavaScript’s semantics are not intuitive.

• I learned a lot about JavaScript (and Node.js) by writing shell scripts in Node.js.

My books on JavaScript, TypeScript and Node.js shell scripting are free to read online and target people who already know how to program: https://exploringjs.com

discuss

order

tobr|1 year ago

> If you like static typing, you’ll want to use TypeScript. It’s more work to set up, but it catches many bugs, especially subtle ones where JavaScript’s semantics are not intuitive.

It’s worth looking at JSDoc as an alternative to regular TypeScript. No compiler to set up, and you’re restricted in a good way - less likely to get over-engineered types.

FireInsight|1 year ago

I find writing it too hard compared to TS, but in terms of functionality it's pretty good.

iamcreasy|1 year ago

How does your book Deep Javascript compared to You Don't Know Javascript? I just finished a Eloquent Javascript and looking for something advanced.

scary-size|1 year ago

> I learned a lot about JavaScript (and Node.js) by writing shell scripts in Node.js.

Totally! This will give you lot of insights into low-level working of JS. Of course, some Node.js specifics too. Reading from STDIN, parsing strings into structured data etc.

pavlov|1 year ago

For writing shell scripts in Node, there’s a helper library called zx created by Google.

I find it a lifesaver for the common occasion when I’m tempted to write a bash script but also know it’s going to need some slightly more advanced features (as in parsing a JSON, or just arrays that are not totally bonkers in syntax).