4 ms·
How can a language be a mess? I hear lots of personal frustrations. But saying a language is a mess is too short sighted I believe.
by holoduke 3y ago
How can a language be a mess? I hear lots of personal frustrations. But saying a language is a mess is too short sighted I believe.
- solardev 3y agoCorrect me if I'm wrong, but aren't most languages designed and controlled by some relatively centralized organization, whether a company or a nonprofit? Javascript, on the other hand, is a loose standard that different companies kinda sorta adhere to. It was a rushed one man project put out to compete with Java back in the 90s, then every browser tried to do their own somewhat compatible implementation. Javascript became the lowest common denominator, winning out not because it was better than say Java or ActiveX or Flash or whatever. It was just commonly available. Fast forward a couple decades, the situation is both better and worse. We at least have ECMAScript now, and the core language has certainly gotten better and more dev-friendly. Unfortunately, what ECMAScript covers is so limited and the standard lib is still so poor that lodash and similar are common just for basic data manipulation, not to mention the hundred DOM abstractions like React or Vue or Svelte, and occasionally Angular. And client-side state is its own nightmare, and then persisting things into cookies/localstorage/indexedDB is a whole other can of worms, along with different ways to do pub sub. Being tethered to file-based HTTP and HTML means that even basic routing is a hack on top of a hack. There is no standard package manager, and npm is a third party project, which can't agree on which module format to use. Libs from like 2 or 3 years ago will often be incompatible with new code. And that's just assuming you're using a browser. Outside of that there's not even a standard runtime, between Node, Deno, Bun, etc. Typescript is yet another third party add on, not something baked into the language. Eslint, prettier, etc. are all third party things. In the old days a lot of this used to just be baked into the language itself, or at least an official IDE . If you ever had a chance to use Visual Studio (Not VSCode) in the old days, everything was so well designed and integrated, from code organization to the standard libs to the UI editor. Nowadays there's 300 ways from 200 companies to do anything in Javascript, none of it particularly good or secure or performant or easy to read. In a way it's natural selection, I guess, with different implementations all competing for supremacy, but it definitely is messy. Every time I use JS (which is every workday) I can't help but wish some other, more coherent, language won out.
- gear54rus 3y agoThat's exactly what makes it powerful and ensures it's bright future. It is not controlled by one entity and non-working approaches die out by themselves and there's constant innovation. Calling that a mess is just personal problems.
- stevage 3y agoThese are...weird criticisms. You basically seem to wish you were coding within a monopoly, for a single platform controlled by a single corporation. Perhaps Swift is where you would like to be? JavaScript does incredibly well for the constraints it operates within. The fact that Node and Deno etc even exist is pretty remarkable given the primary purpose of JS. The fact we even have ES modules is in large part because the third party NPM worked so well. Things start out messy then they gain traction and get standardised. JS isn't a loose standard at all, it's incredibly well defined, and few of its original Netscape origins really remain. You have a bit of a point about TypeScript. It'd definitely be nicer if this was part of the language and didn't require so much third party tooling. It seems plausible that this too might happen in a few years. Perhaps browsers will gain first class support for it.
- solardev 3y ago> These are...weird criticisms. You basically seem to wish you were coding within a monopoly, for a single platform controlled by a single corporation. You know, I never really thought about it that way, but I think you're right! <lazy dev hat>That WOULD be nice! A standard way to do anything, no need for unnecessary reinventions of the wheel... progress would slow down a bit, sure, but that's OK, nobody can keep peace with this lightning-fast explosion anyway, and slow and steady is more sustainable than volatile bubbles everywhere anyway. I think I would enjoy working in such a system...</lazy hat off> <open source hat on>Unfortunately, that'd also mean a closed ecosystem and we probably wouldn't have had the amateur dev boom that HTML/JS/CSS and its visible source gave us. I hate the messiness of that ecosystem, but I can't deny that the openness gave a boatload more people opportunities than the closed platforms. Maybe that's just the price we have to pay =/ </hats away> > Perhaps Swift is where you would like to be? I never tried. Is it nice? As a user I find iOS quite obnoxious, but maybe developing for it is different...?
- yencabulator 3y agoThis is how a language can be a mess: [] + [] = '' [] + {} = '[object Object]' {} + [] = 0 {} + {} = NaN Array(16).join('wat' - 1) + ' Batman' = 'NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN Batman' https://www.destroyallsoftware.com/talks/wat https://www.destroyallsoftware.com/talks/wat
- mardifoufs 3y agoYou can find examples like these for basically every single language.
- lifthrasiir 3y agoThis is misleading, as the original talk executed them in the statement context where the preceding `{}` is an independent statement. `({} + [])` etc. are much more consistent.