4 ms·
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 a
by irahul 15y ago
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.
- Daishiman 15y agoSeriously, at least as far as Python goes it has always donde modules and namespaces better than C++ or Java or Scala.
- bri3d 15y agoAgreed 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 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.
- rimantas 15y ago> 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 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-programming http://weblog.jamisbuck.org/2008/11/9/legos-play-doh-and-pro... http://weblog.jamisbuck.org/2008/11/9/legos-play-doh-and-programming http://weblog.jamisbuck.org/2008/11/9/legos-play-doh-and-pro...
- crcn 15y agoThis was my first thought. Languages require different design principles. If you're calling JavaScript "spaghetti code", then you're doing it wrong.
- batista 15y agoLanguages 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.
- crcn 15y agoNode.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.