Hacker News new | ask | show | jobs
by neuronic 1608 days ago
I think learning is subjective. The NodeJS world is learning a lot about backend development I guess.

So, disclaimer, I am new to Typescript-NodeJS and the npm world but have a significant background in the JVM / Spring backend world with Kotlin and Java. I am also too young to be this cynic but I am honestly just baffled.

To me the entire NodeJS backend movement seems like they are "Java sucks!" hipsters jumping into the trendy JavaScript ecosystem of the modern web era just to show how cool and progressive they are (???) - all while rediscovering and reinventing backend features that have been invented and in widespread and battle-hardened use for 2-3 decades now.

Wow we are using NestJS, Jest, annotations, a dependency injection module and Typescript... congrats, you just rediscovered type systems, mocking, Maven and Spring Boot as they are very handy for backend development.

All while bloating your fresh hip ecosystem to an even uglier Frankenstein monster than you can find anywhere in the Java enterprise, transpiling back and forth with 10,000 config files to make framework XYZ interact with each other.

And then, JavaScript is running underneath with all its limitations and quirks that will reach feature parity with Kotlin with ES2048. But yea, I guess now you can send JSON natively between systems because it's first-class.

1 comments

As someone with a significant background in Node.js and a bit of experience in Java I think Node.js is much better in that respect.

Yes, we have things like NestJS, which I refuse to use precisely for the reasons that you point out: it looks like Java Spring and adds a lot of complexity where it is not needed.

I am also painfully aware that TS can be abused to write Java-like code but that's on the developer. However, the abuse notwithstanding, the fact that JS is a simpler language protects it from Java's key problem:

"Because the problem with object-oriented languages is they’ve got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire jungle."

My (limited) exposure to Java was quite painful because I had to deal with layers and layer of inheritance and abstractions that at some point made it very difficult to do what I needed to do. The language itself was fine except that it easily allowed for this sort of architecture.

Also, the advantage of writing the frontend and backend in the same language should not be understated.

Maybe the core issue is that you are just not a good programmer.
I’m being paid to believe otherwise. :)
> My (limited) exposure to Java was quite painful because I had to deal with layers and layer of inheritance and abstractions that at some point made it very difficult to do what I needed to do.

Hey — could you go into more detail about some of the times when inheritance and abstraction in Java were a problem, or when you had to deal with the gorilla issue?

I promise I'm not trying to catch you out or start a language war; as someone who lived in the Java world for a long time, I'm interested in which parts of it people who visited briefly have found annoying or painful to deal with.

It’s not really a language thing. I would never use Java again simply because it is owned by Oracle but I am sure it is possible to use it elegantly. Just that it seems this is not the mainstream way.

So this is going back 5 years or so. We were building an Eclipse plug-in to make an IDE for a scripting language used in our platform, for which we needed to extend another language plugin. I remember there were layers and layers of abstractions, to hook into which I had to do some dirty things. There was a lot of boilerplate that I had to write before I could even start working on what I needed to work on. Logic being scattered across many many classes some with multiple inheritance was not fun.

I also did a similar project in JS for a web-based IDE around the same time and it was just so much simpler to do.

Eclipse itself was not a joy to work with - good idea in principle but so slow and buggy to actually use.

I also got to look at the code of a JS library that some of our Java devs wrote (some sort of RPC plugin framework) and it was simply terrible in exactly the same ways - abstraction abuse.

So basically I get that sometimes this complexity is necessary but it usually isn’t. Like we had a WebUI app built in Java that took nearly a GB of memory to run because it was probably using some framework underneath that was designed for bazillion different use cases all of which were completely irrelevant in this case, but there was no choice to leave them out.

So I really love the simplicity of JS. I particularly love Node.js - it’s really a C++ framework with a JS API but it’s such a joy to use for all network service related things. Add some sensible use of TS (for the type system rather than the additional OO features that pretend it is not JS) and it’s now even better.