News for hackers. Stuff that matters.
Re:If you're using Node.js, you're doing life wrong by irahul on Friday February 03, 2012 @11:36AM (#3547750)
The Ruby and Python communities are just now, many years after the hype has faded, learning that stuff like dependency injection and proper modularization are actually good things that help you maintain code over time.

This remark is off the mark. Dependency injection, as in injection by parameters and injection by constructors are so obvious people do it sub-consciously. A fluff word isn't needed for it. As far as IoC containers are concerned, I don't see Ruby/Python communities using it, mainly because half of it is fighting static typing.

And people are learning proper modularization now? Seriously? Python/Ruby has proper namespaces(ruby doesn't have it), modules, classes et al. Like any other languages, Python/Ruby has it's share of programmers who write spaghetti code, and programmers who don't.

Again, if he writes AbstractConnectionDepenencyInjectioManagerAbstractFactory and calls it proper modularization, I am happy Python/Ruby isn't picking it up.

Re:If you're using Node.js, you're doing life wrong by Daishiman on Friday February 03, 2012 @12:27PM (#3547975)
Seriously, at least as far as Python goes it has always donde modules and namespaces better than C++ or Java or Scala.
Re:If you're using Node.js, you're doing life wrong by bri3d on Friday February 03, 2012 @12:33PM (#3548006)
Agreed entirely - I find that this is an old debate between people who "love Java" and those who don't.

I posted some commentary on the same topic last time Nick Kallen's infamous "I love everything you hate about Java" blog got posted : http://news.ycombinator.com/item?id=3287777 .

What it boils down to is that Java likes invoking the names of design patterns with all sorts of pomp and ceremony (look, ma, it's an AbstractFactoryFactory!) while many more modern languages make similar design patterns natural.

Whether or not to like the ritual is up to the programmer, but I entirely agree that claiming that Ruby and Python are "just starting" or "don't" support patterns like dependency injection is absolutely baseless.

Re:If you're using Node.js, you're doing life wrong by rimantas on Friday February 03, 2012 @01:47PM (#3548280)

  > As far as IoC containers are concerned, I don't see
  > Ruby/Python communities using it, mainly because half of
  > it is fighting static typing.
Exactly. Jim Weirich gave a presentation on DI 2005 http://onestepback.org/articles/depinj/index.html also see a nice writeup by the Jamis Buck—the author of a couple of DI frameworks: http://weblog.jamisbuck.org/2008/11/9/legos-play-doh-and-pro...

http://weblog.jamisbuck.org/2008/11/9/legos-play-doh-and-pro...

Re:If you're using Node.js, you're doing life wrong by crcn on Friday February 03, 2012 @02:10PM (#3548401)
This was my first thought. Languages require different design principles. If you're calling JavaScript "spaghetti code", then you're doing it wrong.
Re:If you're using Node.js, you're doing life wrong by batista on Friday February 03, 2012 @02:36PM (#3548518)
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.

Re:If you're using Node.js, you're doing life wrong by crcn on Friday February 03, 2012 @03:44PM (#3548892)
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.