> Do you have any tip for learning js at it's fundamentals? I would recommend: - https://eloquentjavascript.net/ - https://javascript.info/
Ask HN: Changing my mind about JavaScript
21–30 of 73 posts
Re: Ask HN: Changing my mind about JavaScript
#22Once I feel the need for TypeScript, I've done something wrong. For example, built my whole frontend with JavaScript or built my backend in JavaScript.
JavaScript's use case for me is sprinkling it where needed in browser. Anything extra and it feels wrong tool for the job.
Frankly, I believe whole existence of TypeScript is a mistake – we should've never used JavaScript at a scale where static typing becomes necessary.
Having said all that, I'd love to be able to write gradually typed JavaScript (i.e. TypeScript) in the browser. Gradual typing is still greatly beneficial, even in my sprinkles.
Re: Ask HN: Changing my mind about JavaScript
#23I would recommend using Typescript and a strict linter if possible. TS is essentially modern Javascript plus static typing (so by learning TS, you also learn JS as a side effect), and strict linting rules will reject outdated Javascript features and nudge you towards the 'good parts'. With those two things (a static type system layer, and strict linting) JS is actually a quite decent language nowawadays, especially i…
My main complaint: the default compiler settings are pretty loose, presumably in the interests of erring on the side of letting Javascript code through by default. I'd recommend going through the available project settings carefully and switching on more of the checks. eslint is also a good idea I think - and a similar comment applies. (I activated pretty much everything, and dialled it back as I found myself getting annoyed by things that felt like poor value for moneey.)
Re: Ask HN: Changing my mind about JavaScript
#24JS is no longer as slow as people say, especially when developers are cautious about memory allocations and time complexity.
Re: Ask HN: Changing my mind about JavaScript
#25I still much prefer strongly typed languages for anything that needs to be maintained, and i've always hated JS with a passion.
What finally convinced me that JavaScript might have it's merits was working on an application written in TypeScript. In my opinion (and not everybody elses) TypeScript fixes a lot of "flaws" not only JavaScript but any duck typed language.
I've long used type hints in Python, but they rely on the editor/tooling to find stuff that doesn't match, where TypeScript finds it compile time. Sure, it's all javaScript in the end, but considering that JavaScript can compare Apple and Orages and decide they're all tomatoes, having compile time type checking is a god sent.
Re: Ask HN: Changing my mind about JavaScript
#26My (unpopular?) take is that JavaScript should suffice. Once I feel the need for TypeScript, I've done something wrong. For example, built my whole frontend with JavaScript or built my backend in JavaScript. JavaScript's use case for me is sprinkling it where needed in browser. Anything extra and it feels wrong tool for the job. Frankly, I believe whole existence of TypeScript is a mistake – we should've never used J…
Re: Ask HN: Changing my mind about JavaScript
#27If you just want to hack around it, hey just use it as any other scripting language
Re: Ask HN: Changing my mind about JavaScript
#28TypeScript adoption over plain JS is HUGE in the recent years, I wouldn't be surprised if it becomes the native default in browsers some time in the future.
Re: Ask HN: Changing my mind about JavaScript
#29I 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 l…
> 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.
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).
Re: Ask HN: Changing my mind about JavaScript
#30Most stuff written in javascript makes me nauseous. The entire NPM ecosystem is a parody of software development. But you can ignore essentially all of the libraries and still get work done.