An unofficial, read-only Hacker News reader.

2035 came early (opens external site)

1037 points by setheron 4 days ago | fzakaria.com | 382 comments on HN

View full thread · View on Hacker News

Comment thread (1)

  1. Same. I actually very much enjoy JS compared to most other languages. It's always been cool to hate on JS.

    A lot of juniors see JS hate as a way to make themselves appear more experienced. If you say you hate JS, it's a kind of flex because it implies that you've tried multiple languages and concluded that JS is the inferior one because it imposes fewer guardrails than the others and has a few nasty gotchas (which they all have, if you're being honest).

    C's gotchas are pretty nasty if you ask me; mess up a pointer reference or forget to check a buffer's size and you've given an attacker root access. That's as nasty as it gets.

    Even a hyped language like Rust has issues in terms of build time, gaps in concurrency safety (e.g. lock issues/complexity), async (function coloring) complexity, panics as a DoS attack surface.

    Sometimes a language provides some kind of safety but simultaneously incentivizes anti-patterns and runaway complexity. Actually this point highlights what I like about JavaScript; although it isn't the most safety-conscious language (though at least it does a pretty good job protecting from remote code executions via buffer overflows), it is succinct and the lack of guardrails incentivizes people to keep function interfaces simple which encourages high cohesion and loose coupling. JS punishes you big time for not designing your architecture carefully. I also like this about Python. Python code, in practice, is quite succinct and pleasant to read.

    TypeScript's type safety is nice in theory and great in the hands of an experienced architecturally-minded engineer, but it also allows sloppy coders produce overly complex but functioning spaghetti code. An ugly TypeScript codebase can go much further than an ugly JavaScript codebase, but the day of reckoning is often worse with TypeScript as it requires more heavy-handed, less localized, refactorings; even its flaws can create the illusion that TypeScript is useful because it does a great job at pointing out where the different spaghetti stands aren't making contact in the right way but it does nothing in terms of alerting you that "this project is a tangled mess of spaghetti code.'