Live data from Hacker News

The JavaScript ecosystem is delightfully weird

fly.io

241–248 of 248 posts

Re: The JavaScript ecosystem is delightfully weird

#241

Earlier quoted context omitted.

> a guy across the room suddenly stood up, walked over to the white board, and wrote "F*CK JAVASCRIPT" in massive letters >Guy must be having a bad day. He was having a bad day because he was doing stupid things with the code he wrote that led to problems. I've never had a problem with Javascript's type system, or having the wrong type show up where it shouldn't. I accepted the dynamic nature of JS long ago when it f…

> I've never had a problem with Javascript's type system, or having the wrong type show up where it shouldn't. I accepted the dynamic nature of JS long ago when it first came out in Netscape, and I adjusted my coding style accordingly Different languages have their own strengths and weaknesses as well as generally accepted coding practices and sometimes different paradigms. I find the folks who struggle the most are…

> I find the folks who struggle the most are trying to write JS as if they are still a C# or Java developer so they constantly run into square peg round hole issues and blame it on the tool. I love JavaScript. I also love C#. But you've got to approach how you solve problems with them differently. How you write long term maintainable code in both is different.

Weird take. Because the best way to write maintainable JS by far, whether you're using TypeScript to enforce it or not, is to keep all the lessons that informed the design of Java in your heart. Go ahead and decompose your program into classes and interfaces, eschew with clever tricks and just focus on readable code instead, and make sure you or anyone else can without much difficulty work out at any given point what the "shape" (type) of a value is.

Re: The JavaScript ecosystem is delightfully weird

#242

> When a bundler/transpiler encounters an import statement, they don't necessarily presume that the file being imported is JavaScript or even any of the variants mentioned above. If configured properly and you want to import a CSS or PNG file, it will happily do so for you. This is what I like to nickname "WebpackJS". Code that is simply invalid JavaScript and requires a carefully configured composition of webpack pl…

Oh I hate that shit. It feels so broken. Someone creates "a library" in CRA or webpack, and then you can't just import it in your project easily.

Re: The JavaScript ecosystem is delightfully weird

#243

I like javascript, but I always think about the time when I was working as a front end developer, and a guy across the room suddenly stood up, walked over to the white board, and wrote "F*CK JAVASCRIPT" in massive letters. I believe his concern was around the lack of type safety (this was before we used Typescript). And this was someone not prone to dramatic gestures. At the time I laughed. Guy must be having a bad d…

My experience with javascript as a non-software developer/non web person has often involved frustration. A good example is an experience I had a few years ago (circa 2018) My work acquired some new software which published some results using a REST endpoint. I wanted to pass some parameters to the endpoint get a response and display the response on a webpage. I'm used to working with Python/R and SQL databases it is…

Sounds like a perfect use for jquery. You don't always need to use the newest framework.

Re: The JavaScript ecosystem is delightfully weird

#244
I think it is a big plus that the JavaScript community embrace code generators.

I mostly write C++ for a living, and I use code generators all the time. Generating C++/Java/Typescript/SQL/… from high level declarations.

Code generators are great tools for automating away the necessary but no-thinking-required parts of a typical app. I am typically able to code generate more than 90% of the application code needed to implement a new client/server business system. So why not use it?

Re: The JavaScript ecosystem is delightfully weird

#245
post #68
post #7

Coffeescript was well before "tree shaking" (the JS ecosystem's way of spelling "dead code removal") and code splitting, both being relatively new things in the bundler world ("tree shaking" being introduced with rollup if memory serves). Then came Acorn, which gave way to a whole slew of JS transformation bits. It also didn't help that Node was fixed at 0.12 for years and years, and we had the IO.js fork until Node…

> As a maintainer of several large JS packages, and being so dreadfully burnt out on JS, there are other words I'd use to describe the whole thing than "delightful". My first project that used JS was in 1996, so I've been along the ride every step of the way. Up until today where I am working with all of this on an Angular 15 enterprise project. I actually would describe it as delightful, compared to what it was like…

I've been at it since DHTML as well. I miss ES5. It should have ended there.

Re: The JavaScript ecosystem is delightfully weird

#246
post #187
post #112

Earlier quoted context omitted.

Well, then you don't think the opposite. JS is a bad OOP or functional language, but a good prototype-based language. Bad thing that no one wants such language.

I can't disagree with the "no one wants" part unfortunately, no matter how good my counter-arguments can be.

Don't blame you. Hard to disagree with that. Ever since JavaScript became important (famous web 2.0 yay) everything in the JS ecosystem was about making it more like Java style OOP and recently more functional style.

There were so many shims to emulate that style of OOP.

Re: The JavaScript ecosystem is delightfully weird

#247

Earlier quoted context omitted.

I got quite used to the prototype inheritance style Javascript and really liked it. But I don't think it scales across teams as well as modern JS or Typescript. But for a small project with just myself or a few other skilled developers? I'd prefer old-school style JS semantics.

Yeah, I have some fondness for it myself, even despite listing some of the headaches I recall from past efforts. The fun/interesting/good news is that it is not technically an either/or in JS. Prototypes are still the underlying driver below the class syntax. There's absolutely still room for doing really interesting or cool things with prototypical inheritance, even doing things that aren't entirely possible with th…

Agreed, I still use it when I'm writing JS for personal projects. But at work, things have to pass code-review, be easy for someone else to modify in the future or write a bugfix for if I'm on vacation when the report comes in, etc... But I'll never fully give up that old-skool JS.

Re: The JavaScript ecosystem is delightfully weird

#248

Earlier quoted context omitted.

That'd be a little weird if that was Eich's "original vision" considering `Object.assign` didn't come out until ES6. Which was also when the `class` keyword was introduced.

Good catch. It’s been a while since I’ve been thought the ways of old JS so I’m misremembering. It’s all apocryphal anyhow.

It's not apocryphal if I'm the source. I wanted Self-ish prototypes and cloning but "Make It Look Like Java" orders trumped my wishes.
Post reply on HN