Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Two points for you: 1) CoffeeScript does not require Node...npm may make it much easier to install, but you can definitely run it without installing Node. We run the compiler as a Maven plugin, but it's distributed as JavaScript and all you need is an interpreter. 2) There are templating languages that have interfaces in both JavaScript and other languages to allow the same templates to render on both the client and the server. We use Java on the server, so we're looking at Closure Templates, but for Python, you might want to look at Mustache.

If you've already finished your project, I'm not going to try to convince you to move away from Node, but if you've got a lot to do still, you might consider sticking with Python. I'm not saying that Node isn't a workable solution on the server side, I just don't think it's proven that it is the way that Python and other, more mature platforms have. I don't give too much credence to inflammatory posts like the one being discussed, but when I see posts like: http://news.ycombinator.com/item?id=2519674 from a developer I respect, it gives me pause. That post is 18 months old now, so the situation could have changed.

There's something to be said for building things you know are rock solid and won't result in 2am notifications. That's my perspective, so I try to stay away from the bleeding edge. For stuff that's not critical, I'm more ok with taking a few risks. But someone's got to be the one that takes those risks in a mission-critical environment to figure out which of the new technologies will become proven and which will fail, so I disagree that these people are doing life wrong. If it wasn't for people like them, my way of doing life right wouldn't work.


besides templates and simple validations, sharing code doesn't seem to work out all that well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: