Live data from Hacker News

Hard-won lessons: Five years with Node.js

blog.scottnonnenberg.com

291–300 of 365 posts

Re: Hard-won lessons: Five years with Node.js

#291
Sorry to say. Node.js isn't the problem. It is a symptom.

Devs these days are craptastic coming from dev->systems with devops nonsense. Just stop forcing this terrible language into server and js is as fine as it will ever be client side.

Re: Hard-won lessons: Five years with Node.js

#292

This looks like how I used to work with BASIC back in the 80s: > I finally added extremely verbose logging ... started adding logging ... Verbose logging to the rescue ... I had the right logging in place ... My first step was to jump in and add some key logging statements ... added extremely verbose logging Weird to see people happy to be limited to such stone-age work-flows when fully capable debuggers have existed…

Frankly, I find your condescending insults to "x-developers" to be a sign of unsophistication, that aside, in my experience, logging is preferable to running a debugger in most situations. Logging gives you an immediate output about the particular state you're concerned with as opposed to using a debugger which slows you down while you fiddle with breakpoints, slowly step through code, hover your mouse over variables…

Are you really implying writing a bunch of print statements is more "professional" than a debugger? Debuggers are incredibly useful in tracking certain things down and don't make you write and then remove a ton of logging statements. Sometimes logging is easier, sometimes debugging is, and not just for "junior devs".

Re: Hard-won lessons: Five years with Node.js

#293
post #211
post #15

I can't imagine choosing to write Javascript on the server, but considering its popularity I'm wondering if I'm wrong. So I'm curious as to the reasons people chose Node.js and whether you would recommend it, anybody willing to share their experiences?

To use words from Yaron Minsky, JS is no OCaml but it has a surprisingly decent "dynamic range", even though it doesn't look like it. (Yes, I'm pretty sure I'll end up being ridiculed for writing that, but... hear me out) Its easy to quickly put up a prototype. There are a ton of libraries for everything, and most come with copy-pasteable examples. Yes, this is frowned upon, and with good reason - but for prototyping…

addendum: turns out things are better in OCaml as well since OCaml threads will yield at not only IO but also memory allocation points.

Re: Hard-won lessons: Five years with Node.js

#294
post #15

I can't imagine choosing to write Javascript on the server, but considering its popularity I'm wondering if I'm wrong. So I'm curious as to the reasons people chose Node.js and whether you would recommend it, anybody willing to share their experiences?

I'm the biggest JS-on-the-server sceptic of them all, given my past experiences. But this was pre-typescript. If a TypeScript ORM with automatic schema migrations and decent expressiveness comes around, I'd be willing to give NodeJS another shot. But so far, nothing comes even close to the productivity of Django + ORM + Django Rest Framework. For your typical CRUD app, this will walk circles around any current JS sol…

It sounds like you are describing C# with Entity Framework. Throw in the self-hosted OWIN webserver and WebApi or Nancy and you're good to go.

I'm not really up on the state of DotNet Core or whatever they are calling it this week, but when that is shaken out, I'll be interested so see what kind of inroads it makes on Java and Python in the Unixy server world.

Re: Hard-won lessons: Five years with Node.js

#295

This looks like how I used to work with BASIC back in the 80s: > I finally added extremely verbose logging ... started adding logging ... Verbose logging to the rescue ... I had the right logging in place ... My first step was to jump in and add some key logging statements ... added extremely verbose logging Weird to see people happy to be limited to such stone-age work-flows when fully capable debuggers have existed…

It also sounds to me like they didn't have any proper unit tests, which is quite a low-hanging fruit for sorting algorithms.

Also, while I agree mostly with you, there are cases where logging is more useful for debugging than using step-through debuggers. However, such problems are usually related to concurrency where a debugger may alter or even hide the problem, not stuff like this here.

Re: Hard-won lessons: Five years with Node.js

#296
post #126

Earlier quoted context omitted.

> while everyone claims node's dependencies are hell, I love the choice available (although over time, it's tiring). So... at one place I work, we use nodejs. There are so many modules added using so many files, that we ended up not being able to use our packaged application - extracting the package into a holding dir before moving into place meant that we ran out of inodes on the filesystem (stock 8GB ubuntu ext4 cl…

I had this issue initially when I was developing on Windows. We hit the limit of Windows's 255 char file path limit. We also have had issues with node_modules takes minutes to download to the point that we basically had to cache it in our CI builds - which in itself was a really bad idea (thankfully Yarn seems to fix a lot of those issues)

Seriously. NPM/bower downloads are at least 50% of our CI build time - which also includes compiling a largish C# solution, running unit tests, generating PDF documentation, building an installer, and putting everything through ReSharper code inspections.

That's when those download/install steps don't just fail for some unrecorded reason.

Re: Hard-won lessons: Five years with Node.js

#297

Earlier quoted context omitted.

Most Java people I know use IDEs mostly just to edit and debug the code, and does the builds/runs/tests from the command line.

What do you mean with "just to edit"? Aren't there any (compilation) errors, warnings displayed anywhere?

Yeah there are, sorry, a this point I consider them basically auxiliary editor features. I forgot that some other languages don't have this luxury.

Re: Hard-won lessons: Five years with Node.js

#298
post #229

Earlier quoted context omitted.

Well, to an extent this is a subjective question. With node, you get npm with it, npm is what everyone uses, and npm is clearly what you should be using too. Moreover, the basic functionality of npm is very very easy to understand. I find the Java ecosystem terrifying by comparison. I have no idea whether Maven is what I should be using or if I should be using something else instead -- having it as a separate downloa…

You should probably learn to expand your comfort zones more effectively, if the Java ecosystem terrifies you.

It's not that it's terrifying. It's just... why make it harder for myself? Even if it's one step (which it isn't), why? If the only reason you can give is I need to expand my comfort zone, sorry, I'll keep my comfort zone small and productivity high.

Re: Hard-won lessons: Five years with Node.js

#299

Earlier quoted context omitted.

It's not just the types, it's the whole APIs, culture etc. Java, for example, is no picnic, whether it can now infer some types or not. In Python I don't even need a main().

How is if __name__ == "__main__": main() different from a main()?

You don't even need that.

  print("hello world")
will run just fine

Re: Hard-won lessons: Five years with Node.js

#300
post #84

Earlier quoted context omitted.

I'm the biggest JS-on-the-server sceptic of them all, given my past experiences. But this was pre-typescript. If a TypeScript ORM with automatic schema migrations and decent expressiveness comes around, I'd be willing to give NodeJS another shot. But so far, nothing comes even close to the productivity of Django + ORM + Django Rest Framework. For your typical CRUD app, this will walk circles around any current JS sol…

Have you seen typeorm? https://github.com/typeorm/typeorm

I have. It's a great improvement over other ORMs in the NodeJS space but pales in comparison to Django's ORM. At least for now.

Relationships must be done manually, including joins, traversing, and many to many.

Sometimes doing:

w = Widget.objects.get(pk=2) w.category.author.name

Is just all you need. And Django makes that trivial.

Post reply on HN