Live data from Hacker News

If you're using Node.js, you're doing life wrong

codeslinger.posterous.com

81–90 of 100 posts

Re: If you're using Node.js, you're doing life wrong

#81
post #61

Earlier quoted context omitted.

That works, but I think it's overkill. Generally the "don't argue like a jerk" method is sufficient.

And if you aren't good at it it's easy to come off as condescending. Thereby also causing you to be written off as a jerk. Socrates was smart. He was also executed for being irritating.

No, he was executed for "advocating for new gods and against the gods of the city" (that was the actual charge).

You know, much alike someone insulting Mongo, Rails or Node in certain communities... (or Java, CL etc in others).

Re: If you're using Node.js, you're doing life wrong

#84
post #19

I haven't used node.js before, but I see 2 main points being made about it, by proponents and detractors respectively: * It uses non-blocking evented IO so it can scale well. * It is single threaded so it can't scale well. Someone teach me: which of these statements is true?

I think largely non-blocking I/O is a means to an end. Non-blocking I/O allows one to implement a single-threaded event loop, which allows one to skip all the overhead associated with multithreaded systems. It's not the non-blocking I/O which necessarily makes it more scalable, it's the fact that you avoid the heavy cost of context-switching and the memory and CPU complexity of thread creation.

Re: If you're using Node.js, you're doing life wrong

#85
post #72

If you get really angry about the choices other people make for their own work, you're doing life wrong.

Eh. It's not limited in scope to someone else's work. I have done a decent review of a number historical computer science papers, I can confidently point to a number of things that have been pointlessly reinvented over the years at least once, if not 2-3 times. It's like, why are people using these really bad technologies (node for instance)? There are are solid and advanced technologies that have done all these thin…

>>Perl has spent years working towards something that is starting to look a good deal like Lisp in Perl 6.

Good example of your point, this is one of the things frustrating me in life.

Most of the scripting languages have long been working on becoming larger subsets of Lisp. They still mostly haven't gotten close in e.g. efficient compilation.

But sure, it would be cool if the Perl 6 e.g. really implemented a good macro system without sexpr functionality. Something to look forward to.

I really don't understand how the Lisp people failed taking over the world. (Sigh, I should have helped instead of being sidetracked after univ. :-( Maybe I should start looking into Perl 6 development.)

Re: If you're using Node.js, you're doing life wrong

#86
post #81

Earlier quoted context omitted.

And if you aren't good at it it's easy to come off as condescending. Thereby also causing you to be written off as a jerk. Socrates was smart. He was also executed for being irritating.

No, he was executed for "advocating for new gods and against the gods of the city" (that was the actual charge). You know, much alike someone insulting Mongo, Rails or Node in certain communities... (or Java, CL etc in others).

Also for corrupting the youth.

Again, much like Mongo, Rails, and Node. :)

Re: If you're using Node.js, you're doing life wrong

#87
post #32

If you get really angry about the choices other people make for their own work, you're doing life wrong.

Approaches that become popular and highly publicized definitely impact everyone else's work in that field. Teams decide to migrate to those approaches, discarding others, based on perceived popularity, shallow impressions, small amounts of experimentation. Often, this is all we have to go on. But team members who have an intuition that the approach may have more problems than are first visible now have a choice, to e…

People need to understand that decisions should be made based on the team's current skill set. If your team is comprised of Java developers, time shouldn't be wasted on researching node.js; rather they should focus on how to leverage their Java knowledge with Scala. It frustrates me to hear people falling for the hype machine and falling hard when they could have easily avoided by asking themselves two questions: what's the path of least resistance to shipping our product out the door, and what's the opportunity costs relative to alternative paths?

Re: If you're using Node.js, you're doing life wrong

#88
post #77

Earlier quoted context omitted.

Off the mark? Perhaps. Wildly so? Unlikely. But if that's so, then simply view this as an explanation for why I don't use server-side Javascript. And Node is still a tool built around a language implementation which is going in a different direction from where a server side environment/general-purpose language needs to go.

You're welcome to use whatever you like, of course — I'm just saying that you haven't really raised any specific objections that couldn't be (and haven't been) leveled against most other languages. Ignoring the confusion of a language and a framework, so far, your concrete objections seem to be: • Node.js is a framework built by people other than the language's core maintainers (which is true of most frameworks) • If…

No, there is no language v. framework confusion on my part. What I'm arguing is a concrete, fundamental fact that pertains to both the framework and the runtime.

I'm not sure what I can do to clarify the point anymore: the V8 engine is created and maintained for the purposes of speeding up a web browser's processing of Javascript within the context of an HTML document. The goals of the team implementing the runtime are not to create a general purpose language, they are to create an engine which excels at one specific use case, and granted this use case is broadening over time.

But to address your point: yes, the developers of Pyramid (to take an example) have not to my knowledge submitted code to e.g. optimize networking functionality in core Python so that it better suited their specific needs. On the other hand, the Python team has had an excellent track record in observing and adapting to trends within their community -- the introduction of WSGI is one such example.

The Python community has a PEP process for generating discussions about what the language needs. To my knowledge, there is no discussion within the V8 developer community about how to make the engine more suitable for server-side programming. And how would you begin the process of adding general programming features to the language itself? Join ECMA?

If you're really concerned about other people's language choices, you're going to need concrete reasons, not just generalities, vague insinuations and your own personal preferences.

Excellent editing. Much less combative.

EDIT: Actually I'd like to add a couple more things:

Node.js is a framework built by people other than the language's core maintainers (which is true of most frameworks)

That is not a point of contention. That is a simplistic reduction of my point which conveniently serves your argument.

If you want to add fundamental language features, you can't just force it into the core implementation, but will have to implement your own offshoot (which is true of most languages, including, for example, Clojure)

This entirely misses the question -- why use a language whose core feature set does not cover your use cases? Why use a language where you must extend the language to get fundamental features? Moreover, no you will not have to implement an offshoot to get core features. At the risk of repeating myself: when you have control over the direction of the language's evolution, you can petition and propose changes.

Re: If you're using Node.js, you're doing life wrong

#89
Okay, let's play a little game. I'm going to describe a scenario (using Python; feel free to substitute the equivalent Ruby terms if that makes it more relevant for you).

You're a pretty good Python developer. You know, and feel comfortable with, not just Python, but the entire ecosystem. Virtualenv, pip, the whole nine yards. And now you're working on a really nifty Django app, maybe a CRM or something, when you realize...

...damn. This app really needs a lot of functionality ripped out and shoved in the browser. I'm losing my marbles writing spaghetti jQuery code, but what I really need is some client side templates.

So you poke at it, and think about it, and you realize that the proper design of your app is really a bunch of client-side code using Backbone, and a server that just handles authentication and is otherwise a thin RESTful wrapper around your database.

Great! But at this point, most of the actual code you will be writing is Javascript. Your server could be written in, practically, anything. And there's some compelling reasons to leave it in Python. On the other hand, if you switch to node.js it means all your code is in the same language (which is nice). It also opens the door to being able to use the same code on both the client and the server - which is really good. Client-side templates are nice, but being able to render them on the server when you need to is practically a requirement. And Python's support for rendering Javascript templates is very limited. And if you're a Python coder, you'll probably want to be writing your client in CoffeeScript anyhow, which requires having node.js installed, so, at least for development, just have the whole damn stack in node.js. You can always hack together a little RESTful server in Python later if you decide that node.js isn't right for production.

Seems simple enough, right? And as you can probably guess, I just went through this process. And so now we have this blogpost, which is saying...well, it's not really clear what it's saying. That I should be using Scala, I guess. This is, frankly, so wrong it's embarrassing.

1) Even if the JVM was just so amazing and awesome, I'm not a JVM developer. The ecosystem is radically different. As a Python developer, I'm able to install, configure, and be productive with node.js very quickly. npm, nvm, coffeescript, and we're away. My IDE of choice (PyCharm) even supports CoffeeScript. There is very low impedence. Switching to Scala...where would I even begin?

2) I'm doing this because I need to write a client side app. That must be written in Javascript, or something that compiles to Javascript. Scala is neither. And while there are JVM language that do, there are some major concerns with their suitability, maturity, and tooling. Clojurescript looks great, but it's not something you pick because you think coffeescript is too new and little used!

3) The rant would be more compelling if the author came across as someone who actually knew anything about Python, Javascript, or node.js. Contrary to his assertions: Javascript does have namespaces. Python and Python developers have ALWAYS been convinced that modularity is good. And Python developers are still quite aware that dependency injection is a way to solve problems with the design of Java which aren't even relevant to their language of choice.

4) Also, if you don't grok callbacks, it doesn't mean you are a bad programmer. But it might be worth keeping in mind that there are plenty of programmers who do, and they're going to laugh at you when you reveal you don't. Not to mention that there are plenty of ways of programming in node.js WITHOUT callback spaghetti, and revealing that you have no clue about the framework your slagging is not going to improve your credibility.

5) To continue the theme, insulting a framework for not scaling well may work better if you don't reveal that you don't know how it scales in the same paragraph.

Re: If you're using Node.js, you're doing life wrong

#90
post #80
post #78

Earlier quoted context omitted.

This was my first thought. Languages require different design principles. If you're calling JavaScript "spaghetti code", then you're doing it wrong.

Languages require different design principles. If you're calling JavaScript "spaghetti code", then you're doing it wrong. He's calling node style callbacks spaghetti code. Which it is, and it's a known problem, and there are several half-baked solutions for it.

Node.js isn't picking up a new paradigm. The issue is very present in JavaScript, and it's easy to write spaghetti code since the language by itself doesn't offer much structure. It's possible to write very clean JavaScript / Node.js code, but it takes a different approach over how you design / develop apps versus a class-based language.
Post reply on HN