Live data from Hacker News

Node.js is good for solving problems I don’t have

xquerywebappdev.wordpress.com

51–60 of 61 posts

Re: Node.js is good for solving problems I don’t have

#51
post #48
post #32

Earlier quoted context omitted.

Uhmm, I've been writing server side code for the last decade. I've also been writing front facing code for just as long. JavaScript works well for Node because it is a language that has evolved to be asynchronous. Not because some front-end web monkey n00bz know JavaScript. Although that is certainly a plus. Node.JS shines when you need to write network applications. It was advertised for this purpose by its creator.…

I don't actually think anyone should be using PHP. Just like MySQL gives relational databases a bad name, PHP does the same for server side programming. And yes actually trying to write a server in PHP would be ten times more insane. Node.js might be nice for writing servers but so is Twisted or straight Python, Erlang, C, even java with threads as someone mentioned.

MySQL gives RDBMS a bad name? What planet do you live on?

And how/why the heck would you write a web server in PHP when it was made to run embedded in a web server process?

Yes, I'm sure you could twist and mangle PHP so it could be used to write a standalone web server. But that would be assanine.

Re: Node.js is good for solving problems I don’t have

#52
post #3

Troll. Post made no sense and came to no conclusion. "The content server should not need to do hardly any IO. Why would an HTML content server need to write to the filesystem?" This just shows a blatant lack of knowledge about what constitues IO. FYI, network is IO, writing to console is IO, logging is IO. The point of an evented system like node (and others based around the 'select' or 'epoll' type calls is that you…

Not a troll. The post's point was that for your average web app, NodeJS doesn't solve any problems.

If you were building some kind of real time app like the Facebook social stream, then yes, it may make sense. But for your run of the mill web app that still treats HTTP as a fire & forget stateless protocol, then NodeJS isn't going to give you any advantage.

In fact, its single threaded design will prove to be far more disadvantageous than going with a setup of nginx and PHP/Ruby/Python.

Re: Node.js is good for solving problems I don’t have

#53
post #32

Earlier quoted context omitted.

Uhmm, I've been writing server side code for the last decade. I've also been writing front facing code for just as long. JavaScript works well for Node because it is a language that has evolved to be asynchronous. Not because some front-end web monkey n00bz know JavaScript. Although that is certainly a plus. Node.JS shines when you need to write network applications. It was advertised for this purpose by its creator.…

Traditional server-side solutions SUCK at this. Try writing a non-blocking server-side WebSocket server in PHP and distribute the load across all of the cores. Wouldn't the traditional way to do it server-side be to just write it in C/C++ or Java with a thread pool? Or if you prefer the evented model, Python+Twisted isn't old enough to really be traditional, but is pretty widespread; and some Java server-side apps ha…

> Wouldn't the traditional way to do it server-side be to just write it in C/C++ or Java with a thread pool?

I was a bit vague. What I should have said was that dynamic language solutions are bad at it. Certainly you can pull out C/C++, Java, Erlang, etc. but at that point, you need to compile and recompile when you change your code. You are dealing with dependencies, libraries, binary compatibility, and the usual complexities that come with compiled languages.

> Or if you prefer the evented model, Python+Twisted

Well, Node.JS isn't the only game in town, certainly. Competition is a good thing.

Re: Node.js is good for solving problems I don’t have

#55
post #50

Earlier quoted context omitted.

Like massive concurrency? Websockets?

For rather small values of "massive" perhaps (i.e. single-server?). Once you reach into realms where the label "massive" comes into play the importance of per-host performance is usually dwarfed by attributes like robustness and maturity.

[deleted]

Re: Node.js is good for solving problems I don’t have

#56
post #23

Earlier quoted context omitted.

- XML and HTML are good ways to structure data...sometimes. Other times, they're godawful. Especially if you're trying to pass data from one piece of code to another piece of code in order to do RPC-like things (server->client, for example). There's a reason that JSON is popular, and it's not because "it's the cool thing to do". - JSON is a strict subset of Javascript syntax. You can always eval() a JSON string to co…

http://timelessrepo.com/json-isnt-a-javascript-subset JSON isn't a strict subset of JS. Moreover, no, you should never eval() things which are untrusted. Do you really trust everything the browser tells you? No? Then why trust JSON? I'm not anti-JSON, I'm anti-JS. Browsers don't support other languages (except for VB, which bites, and Fx nightly support for Python, which I wish would become more widespread) so there'…

...I understand that eval() is dangerous. As noted in my comment.

Anyway, what do you count as a "real language"? I assume you mean Java. Which is...fine. But Java is not the answer for everyone.

Re: Node.js is good for solving problems I don’t have

#57
post #23

Earlier quoted context omitted.

- XML and HTML are good ways to structure data...sometimes. Other times, they're godawful. Especially if you're trying to pass data from one piece of code to another piece of code in order to do RPC-like things (server->client, for example). There's a reason that JSON is popular, and it's not because "it's the cool thing to do". - JSON is a strict subset of Javascript syntax. You can always eval() a JSON string to co…

http://timelessrepo.com/json-isnt-a-javascript-subset JSON isn't a strict subset of JS. Moreover, no, you should never eval() things which are untrusted. Do you really trust everything the browser tells you? No? Then why trust JSON? I'm not anti-JSON, I'm anti-JS. Browsers don't support other languages (except for VB, which bites, and Fx nightly support for Python, which I wish would become more widespread) so there'…

If JavaScript is such junk why hasn't any other language displaced it?

Re: Node.js is good for solving problems I don’t have

#58

Earlier quoted context omitted.

http://timelessrepo.com/json-isnt-a-javascript-subset JSON isn't a strict subset of JS. Moreover, no, you should never eval() things which are untrusted. Do you really trust everything the browser tells you? No? Then why trust JSON? I'm not anti-JSON, I'm anti-JS. Browsers don't support other languages (except for VB, which bites, and Fx nightly support for Python, which I wish would become more widespread) so there'…

If JavaScript is such junk why hasn't any other language displaced it?

s/PHP/JavaScript/g in any other conversation about PHP; the same reasons all apply, including ease of learning curve, deployment inertia, etc. There's a massive amount of parallel community and language development between PHP and JS, and I feel that it's worth pointing out.

Re: Node.js is good for solving problems I don’t have

#59
post #56

Earlier quoted context omitted.

http://timelessrepo.com/json-isnt-a-javascript-subset JSON isn't a strict subset of JS. Moreover, no, you should never eval() things which are untrusted. Do you really trust everything the browser tells you? No? Then why trust JSON? I'm not anti-JSON, I'm anti-JS. Browsers don't support other languages (except for VB, which bites, and Fx nightly support for Python, which I wish would become more widespread) so there'…

...I understand that eval() is dangerous. As noted in my comment. Anyway, what do you count as a "real language"? I assume you mean Java. Which is...fine. But Java is not the answer for everyone.

Java, C, C++, Haskell, Python, Perl, Ruby, C#, Go, Scala, and Clojure are all better languages for systems development. (In no particular order.)

Re: Node.js is good for solving problems I don’t have

#60
post #27

Earlier quoted context omitted.

I agree that js does support the async paradigm for the reason you mentioned; however, at the risk of sounding like I'm speaking for the op js would not be my first choice for system or server side programming. The simple reason being that javascript's behavior is often near inexplicable, many examples can be found here: http://wtfjs.com . I'm tolerant of that strangeness while manipulating the DOM but really only be…

Every language has it's own WTFs. Many of the ones in Javascript are shared with Ruby, Python and other interpreted languages. They hardly bite anyone in a real project.

If by real you mean yours fine; however, your projects are not everyone's. If you'd like you could respond with specific cases you've used javascript for system or server level programming.
Post reply on HN