Live data from Hacker News

Why is a Java guy so excited about Node.js and JavaScript?

blog.sourcerer.io

71–80 of 117 posts

Re: Why is a Java guy so excited about Node.js and JavaScript?

#71

Earlier quoted context omitted.

As someone who has to deal with Spring stack traces and React/Redux stack traces on a daily basis ... I'll take React/Redux 100% of the time. There is a lot to complain about both but I think the Java boilerplate mess is at least one order of magnitude worse. Just one man's opinion, anecdotal evidence, YMMV, etc.

I'm a Redux maintainer. FWIW, I'm always open to suggestions on how we can make using Redux easier and better for everyone (example prior discussion: https://github.com/reactjs/redux/issues/2295 ). We're currently working on a "starter kit" package that's intended to address some of the most common concerns about using Redux, and hope to make it an official Redux-branded package in the near future. I'd appreciate any…

I made an alternative to Redux that requires a lot less boilerplate. Could you take a look? I'd love to know what a Redux contributor thinks.

https://github.com/JonAbrams/SpaceAce

Re: Why is a Java guy so excited about Node.js and JavaScript?

#72
post #68

It's not Java, it's the java culture. Yes, Maven and Gradle are weirdly complex, but they are workable. And .jar files are just downright amazing compared to most other things (I'm looking at you madman Python dependencies!) Hint: maybe you could come up with something like npm for Java ? Maybe it's waiting to happen? And Javadocs are mundane but still better than 'nodocs' which is the standard on Node.js which reall…

The standard for Node.js is highly modularized code where every module gets a README with examples and usually fairly comprehensive documentation. If you mean that you think Javadocs format and type of details is ideal or ideal for JavaScript then please study JavaScript and Node.js more.

And increasingly type definitions too.

Re: Why is a Java guy so excited about Node.js and JavaScript?

#73
post #66

Earlier quoted context omitted.

Exactly, I deal with npm on a daily basis and I really wish deterministic builds were more of a concern in the javascript/npm universe. I can't count how many times a project broke because a "minor" release came out and broke existing code. Also the majority of projects have a caret in their package.json package versions so you automatically get the updates.

https://docs.npmjs.com/files/package-locks has been the default for awhile. Are you using a pretty old version?

> It is highly recommended you commit the generated package lock to source control

Fixed the Javascript way, layers of workarounds.

And if you indeed need to update a dependency, you need to regenerate the lock.

But the main difference is that when that happens, the onus to verify all packages transitive unpinned dependencies still result in a working combination (of which there is no guarantee) is on the receiving developer, not on the package maintainer.

Re: Why is a Java guy so excited about Node.js and JavaScript?

#74
I develop a very complex, 500K+ LoC Java application. It implements a natural language sentence parser that is integrated with a specialized lossless data compressor. I use:

- No IDE, just a simple text editor

- No ORM, hand-written SQL code

- My build tool is a Python script that marshals a javac call

- I have just a few JAR file dependencies, which are checked into the repo

- My own simple unit test and integration test framework

For me, Java Just Works. It's literally been years since I've encountered a problem with the actual language. Yeah, there can be a lot of boilerplate. Yeah, there are some issues with complex type manipulation. But those limitations almost never cause me any real pain.

Re: Why is a Java guy so excited about Node.js and JavaScript?

#75
post #40

Earlier quoted context omitted.

Wha? I don't think so. An npm-like framework could work for Java. The difference between classloading and node.js 'require' module loader is not super relevant. Frankly - the reason that Maven and Gradle are more sophisticated is because many Java projects are massive compared to most JS projects, the amount of complexity, various kinds of packaging, testing etc. necessitates some inherent complexity in modules. Java…

npm works because you can have lodash v3 and lodash v4 existing at the same time, at runtime. Node sees two pieces of code at different locations on disk, and loads them twice, considering them to have no relationship. This means that a library can turn its API completely inside out and not cause dependency hell. Your dependencies can update their sub-dependencies in their own time. This means there's no pressures ag…

> the terrible chaos that is npm

I don't get how anyone can call it beautiful and productive. Ever take over/inherit some 'older' node code and try to update it or even get to work... it is hell. Even worse if it is from the time when there were competing forks of nodejs, so you have to try to figure out which it prefers. And maybe even then it won't run. (probably because npm's version notation can be unpredictable, so npm install still installs a version that breaks something even though it shouldn't)

Re: Why is a Java guy so excited about Node.js and JavaScript?

#76

I don't really care what this guys credentials are; he claims npm and yarn are better than maven and gradle but doesn't bother explaining why (and it's evident he hasn't used gradle) Nor has he moved beyond a Java 6 mindset considering the things he complains about in terms of modularity, verbosity and even strict type checking. The fact that he thinks that the IDE race is between Eclipse and Netbeans is telling. As…

Being nitpicky here: you mention this somewhat in your comment, but I just want to stress that redux is absolutely not necessary to your react application (though a lot of beginners think it is a "must know" because every blog article says you need to know it). React in and of itself allows you to achieve the same functionality of redux (and a fairly complex app) without the need for a bunch of boilerplate code. Of c…

Indeed, we’ve built pretty big and solid apps without redux (when it did not even exist). After that we investigate “flux” and eventually we decided to adopt redux, that was easy for new hires.

Re: Why is a Java guy so excited about Node.js and JavaScript?

#77

I develop a very complex, 500K+ LoC Java application. It implements a natural language sentence parser that is integrated with a specialized lossless data compressor. I use: - No IDE, just a simple text editor - No ORM, hand-written SQL code - My build tool is a Python script that marshals a javac call - I have just a few JAR file dependencies, which are checked into the repo - My own simple unit test and integration…

Yours is a very niche case where you built an application that is perhaps used by other applications downstream.

The author's gripes are mostly with the day-to-day java web application development that is being done in large firms (which I could even believe is the majority of Java development work).

Re: Why is a Java guy so excited about Node.js and JavaScript?

#78
post #40

Earlier quoted context omitted.

Wha? I don't think so. An npm-like framework could work for Java. The difference between classloading and node.js 'require' module loader is not super relevant. Frankly - the reason that Maven and Gradle are more sophisticated is because many Java projects are massive compared to most JS projects, the amount of complexity, various kinds of packaging, testing etc. necessitates some inherent complexity in modules. Java…

npm works because you can have lodash v3 and lodash v4 existing at the same time, at runtime. Node sees two pieces of code at different locations on disk, and loads them twice, considering them to have no relationship. This means that a library can turn its API completely inside out and not cause dependency hell. Your dependencies can update their sub-dependencies in their own time. This means there's no pressures ag…

The same class, loaded by different classloaders, is a different class.

Thus, you can load different versions of the same library at the same time, by loading them with different classoaders. Even, the same version.

Now, there's necessarily the problem of which one of them a particular piece of code wants to use, which is determined by which classloader loaded that piece of code. You also can (and routinely do) have a path of nested classloaders that load different things.

Java was designed this way, right from the very beginning.

The problems with java are:

  1. somewhat verbose ("readable")
  2. stuff hacked on (generics etc)
  3. C-style configuration-over-convention
  4. enterprise culture

Re: Why is a Java guy so excited about Node.js and JavaScript?

#79
My observation is that if you use Java mainly through large frameworks, you won't mind as much switching to JavaScript. When using large frameworks, most of your day is essentially spent doing what I think of as configuration work -- making things fit together, rather than actual programming.

That's not a value judgement -- I'm just describing very different jobs.

If you are a configuration programmer then it really doesn't matter much what language you use. In fact, the simple ergonomics of the tools for a given set of tasks may be more important than the language itself.

Re: Why is a Java guy so excited about Node.js and JavaScript?

#80

It's not Java, it's the java culture. Yes, Maven and Gradle are weirdly complex, but they are workable. And .jar files are just downright amazing compared to most other things (I'm looking at you madman Python dependencies!) Hint: maybe you could come up with something like npm for Java ? Maybe it's waiting to happen? And Javadocs are mundane but still better than 'nodocs' which is the standard on Node.js which reall…

It is a mystery to me why Python never managed to deal with the single biggest reason why it is unusable for serious software development.
Post reply on HN