News for hackers. Stuff that matters.
Re:Advice to my younger self: become allergic to the churn by MiroF on Thursday August 08, 2019 @12:07PM (#20645775)
what killed Javascript for me (and I think many others) is that there is no idiomatic way of writing Javascript. There is no "javascript"-y way of doing things (unless you count callback hell).

I'm not saying that a language should only offer one approach to a problem, but there should be general guardrails and guidelines. A shared vocabulary. None of that exists in modern JS

Re:Advice to my younger self: become allergic to the churn by _bxg1 on Thursday August 08, 2019 @01:35PM (#20646611)
The same criticism (which is a valid one) is doubly true of Lisp, but Lisp doesn't take half the flak that JavaScript does.
Re:Advice to my younger self: become allergic to the churn by marshray on Thursday August 08, 2019 @01:54PM (#20646825)
"There are only two kinds of languages: the ones people complain about and the ones nobody uses."

- Bjarne Stroustrup

Re:Advice to my younger self: become allergic to the churn by vkou on Thursday August 08, 2019 @01:54PM (#20646817)
That's because there's three or four orders of magnitude more JS code out in the wild, then there is Lisp code.
Re:Advice to my younger self: become allergic to the churn by bobthepanda on Thursday August 08, 2019 @04:45PM (#20648528)
The problem is that the original paradigms were pretty terrible but JS has to keep (as much as reasonably possible) backwards compatibility to not break the web. If you forked JS and made changes to clean it up that weren't backwards compatible, you'd have a hard time convincing browsers to take it, making the whole exercise sort of moot.

The fact that we have things like the Wayback Machine is a testament to how this approach, while terrible for developers starting out or working in a legacy codebase, has enabled us to preserve what is now a significant portion of contemporary cultural history. AFAIK there is no similar archive of programs for, say, Java or C.

Re:Advice to my younger self: become allergic to the churn by mceachen on Thursday August 08, 2019 @01:41PM (#20646680)
"Standard" [1] and "Airbnb" [2] seem to capture some amount of sensible guidelines. Adding Prettier [3] gets you something akin to gofmt, and adopting standard eslint rules [4] can help too.

[1] https://standardjs.com/ [2] https://github.com/airbnb/javascript [3] https://prettier.io/ [4] https://eslint.org/

Re:Advice to my younger self: become allergic to the churn by MiroF on Thursday August 08, 2019 @02:26PM (#20647166)
You're talking about style, I'm talking about idioms. Those aren't the same thing!
Re:Advice to my younger self: become allergic to the churn by mceachen on Thursday August 08, 2019 @07:05PM (#20649807)
I think idioms and style have some level of overlap.

Semicolons could be considered idiomatic or stylistic, for example. Requiring strict equality operators feels more of an idiomatic way to avoid bugs, rather than simply whitespace. Eslint certainly has a number of rules that are more idiomatic than stylistic.

If you're touching on the lack of consistency in, say, open source javascript, I agree, code is all over the place. Also, I think you're looking at a language that has had dramatically more evolution (especially in recent time) than most other popularly used languages. Old code without promises and suffering from callback hell feels archaic.

However, I think if you look at, say, TypeScript repos (which is cheating, I know, it's not javascript), there is more homogeneity, at least from what I've seen.

Re:Advice to my younger self: become allergic to the churn by heavenlyblue on Thursday August 08, 2019 @07:40PM (#20650057)
>> language that has had dramatically more evolution

Of course it evolved. It’s easy to evolve if it was literally nothing in the first place.