Live data from Hacker News

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

blog.sourcerer.io

111–117 of 117 posts

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

#111
post #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.

I'm kind of sad that someone would downvote this without really asking why I might think Python isn't suitable for serious software development.

The main reason is that it isn't a language that is nice to users. It shifts the entire burden of setting up an environment to run the Python application in. Which means that installing software tends to be a messy affair at the best of times, and a complete mystery to most non-programmers.

The difference between a good professional software developer and someone who is a just hack, is empathy with the user. Having an obvious way to package applications allows developers to be nice to their users. Python never provided that, so rather than producing nice binaries (or something akin to Jar files) it just dumps the problem of assembling the bits in the user's lap. That's a dick move.

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

#112
post #51

Earlier quoted context omitted.

I'm glad that the workflow works so well for you. In my case, it doesn't. I'm maintaining libraries and also applications that use those libraries. For libraries, you need your setup.py to be kept up to date, as requirements.txt doesn't do anything when you pip install a library package. Of course, requirements.txt is necessary when you want to run the libraries's tests, since few things are as frustrating as having…

You seem fixated on setup.py I have literally never cared about that file in 20 years of python development. Keep the work flow simple and problems tend to disappear.

You can't create a Python library without a setup.py file. Some of the things that I develop are Python libraries, so, having a setup.py file is a must. It would seem that you aren't developing the same types of things as I am - which is totally fine. But, I've been trying to describe my particular use cases, and for those use cases, the Python tooling isn't great. My use cases aren't that niche, and, they aren't invalid. They are different than yours, but, that doesn't mean that I'm not keeping it as simple as I can.

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

#113
post #95
post #53

Earlier quoted context omitted.

> Why would I care if a requirement is direct or a dependency? If it's a dependency it's a requirement. Period. Let's say I need package A. And, package A depends on package B, but, I'm not otherwise using package B. 1. I want to say that I need package A, >=1.0 and 2. When I deploy to production, I want to make sure that the deploy is repeatable. If the last time I deployed, I had package A==1.2.3 and B==4.5.6, then…

Ok, but still, why should I care if a package listed in requirements is dependency? What difference does it make in the real world? And `pip freeze > requirements.txt` writes out version of the package that `pip install` later installs. Very very seldom has this ever caused problems and I've been doing Python for over 8 years. I just really don't get the "problems" you see here, they seem pedantic and theoretical rat…

You don't care, and thats fine. I, however, do care.

I prefer to keep the list of packages that I'm installing limited to just those that I actually need - maybe someone will argue this is unnecessary, but, I think that limited what you install to what you are actually going to use, as much as possible, is simple good behavior when you are installing onto your production servers. If I have a flat list of packages in a requirements.txt, its super hard to keep track of which ones I'm actually using as opposed to those that some other dependency is using. And when some dependency stops using them, then, they tend to get stuck in requirements.txt for no reason.

Its hard to keep track of what the actual version requirements for those packages are - which means its hard to keep them updated. As much as possible, I want to keep the versions of the packages I'm using up to date. or, at least have the option to do regular updates on some schedule that works for me and my team. But, when I have this flat list of locked packages generated by pip freeze, that becomes a big giant pain. It should just be a single command and then some testing.

These aren't niche or pedantic use cases. Just because my use case isn't the same as yours, doesn't make mine invalid, or even uncommon. I'm sure your use case works for you, and that's great - and I'm not going to describe it pejoratively just because its different than mine.

I haven't used NPM much, but, NPM at least does attempt to address some of these issues. I can't speak to how well it does. I do know that package managers for other languages, such as Rust's cargo, do address these types of issues and make addressing these types of issues first class concerns. So, its not like this is some giant unsolved problem in computer science - its just that most of the Python tooling doesn't.

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

#114

Earlier quoted context omitted.

Dependencies in python has evolved a lot in the last 2 years. You can use a simple setup.cfg to make them, and you can use a wheel like a jar if you want.

Ok, so there's some new mechanisms? That's not so much the issue - as Python package/dependency problems are not so much a problem of 'how it works' - it's an issue because nobody is on the same page. It's byzantine. If python dependencies boiled down to 'point to a directory' well then fine, everything would work that way and we'd build tools around it, docs would be clear etc. etc.. But as someone who uses Python s…

Actually, "point to a directory" works. Any directory can be added usong sys.path.append() and its python content becomes importable. No needs to do anything more.

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

#115
post #66

Earlier quoted context omitted.

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 d…

This is untrue. If you need to update one dependency; npm/yarn will update the lockfile with the minimal changes needed to update that one dependency. You do not need to regenerate the entire lockfile.

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

#116
post #90

Earlier quoted context omitted.

.NET Core took a lot of ideas from the node platform. Have you tried this?

We have, I haven’t personally done any of it in production because I didn’t really see a reason to use it over node. My coworkers did a few pocs though, and initially had to spend a lot of time actually getting it to work with deployment. I have no idea why that was, you’d expect it to just work considering it’s a complete Microsoft setup, but it didn’t work out. So it was a terribly expensive poc, because our most e…

I stayed away from Core because of the issues you mention, but it's gotten a lot better recently.

Did a POC for an API that wouldn't break anything if it had to be reworked, and it was a breeze.

Of course, if Node works for you, then it does :) but my recent experience is that Core has gotten better and merits consideration.

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

#117

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…

So on the off chance that anyone happens to look at this thread in the future: last night I decided to try implementing that stack trace display idea, and I got it working! Still needs better formatting, but the important thing is the data is there and viewable.
Post reply on HN