In my short career as a hacker, I've played with a lot of environments from Java with NetBeans and Swing, to Joomla running PHP and finally, Node + JavaScript. All of the languages/frameworks I've worked in have their advantages and disadvantages (though I'd have to think harder about some to find advantages). When it comes to application size, Node is unique.
This isn't about how many megabytes Node core is vs. PHP core. Rather, let's investigate the average size of a supporting application. Disclaimer: In each ecosystem, there are many different ways one could form a product. I only have experience with a limited segment of them. Read on at your own risk.
PHP and Java both have large, complex systems that try to do as much as possible. Joomla in particular has a wide variety of functions and methods that'll "save you time." (So long as you can understand their obtuse docs). WordPress, ZendFramework, et. al. all try to provide the user with as much "stuff" as possible (and if they can't, the user can also get plugins etc for above).
Node doesn't. Node has the philosophy of simple. Each package in npm does one thing. At first, this may bug you. It seems inefficient to have such a decentralized system, ripe for error as some plugins don't connect with other packages and middleware. Plus, you've got to learn how to work with all these systems. There isn't a magical button to push to make everything work (yet).
Despite these downsides, I still think that Node has the advantage here if flexibility is your priority (and it should be). If one were to build a website with Joomla, you'd be forced to either use their database object which still doesn't use prepared statements [0] or roll your own PDO system. If you have to replicate work done by the system you're working in, there's something wrong with the system.
Node's decentralization prevents that sort of problem. Even if I choose the most popular "framework" on node, Express, I still am free to choose other solutions (or roll my own) to my heart's content. Even better, npm provides a one-stop-shop for organizing and updating all of the packages. As you'll come to learn, decentralization doesn't mean we can't have standards.
Fortunately, the world of open source has virtually guaranteed that we won't be left adrift if the original authors leave the project. This still doesn't mean that relying on a single software package for development is a good idea. If something goes wrong or isn't available, you could be stuck high and dry. Consider refactoring and reorganizing if you find you've been leaning on products too big to fail. They probably will, at the worst moment.
This is all based on personal experience. Want to hear more about it? Ask me on Twitter, or in a comment below.
[0] They're fixing this in 3.0, but PDO's been around since 2005 for crying out loud!
No comments:
Post a Comment