Subscribe / Unsubscribe Enewsletters | Login | Register

Pencil Banner

MEAN vs. LAMP for the future of programming

Peter Wayner | June 23, 2015
LAMP diehards take note: The flexible simplicity of MongoDB, ExpressJS, AngularJS, and Node.js is no joke

JSON everywhere

AngularJS and MongoDB both speak JSON, as do Node.js and Express.js. The data flows neatly among all the layers without rewriting or reformatting. MySQL's native format for answering queries is, well, all its own. Yes, PHP already has the code to import MySQL data and make it easy to process in PHP, but that doesn't help the client layer. This may be a bit minor to seasoned LAMP veterans because there are so many well-tested libraries that convert the data easily, but it all seems a bit inefficient and confusing. MEAN uses the same JSON format for data everywhere, which makes it simpler and saves time reformatting as it passes through each layer. Plus, JSON's ubiquity through the MEAN stack makes working with external APIs that much easier: GET, manipulate, present, POST, and store all with one format.

Node.js is superfast

Apache was great, but these days, Node.js is often flat-out faster. A number of benchmarks show that Node.js offers better performance, while doing much more. Perhaps it's the age of the code. Perhaps the Node.js event-driven architecture is quicker. It doesn't matter. These days, especially among impatient mobile device users, shaving even milliseconds off your app's performance is important and Node.js can do that, while offering a Turing-complete mechanism for reprogramming it.

Depth matters

PHP lovers like to cling to the great libraries of code that are built for dominant platforms like WordPress or Drupal. They have good reasons to be proud, but their advantages are evaporating as Node.js catches up.

The Node.js package manager, Npm, makes it even easier to share code, and the public repositories targeting Node.js are growing quickly. While the PHP crowd may lead at this moment in time, the future may favor Node.js. Plus, incumbents often prove to be brittle in the face of shifting trends. Each attempt to modernize an entrenched platform like Drupal with a new version means that many more developers may be letting their eyes wander toward the newer, more nimble platforms built around Node.js.

AngularJS is fresh

It's not exactly fair to compare the "A" in "MEAN" with anything in the LAMP stack because LAMP doesn't include an analog. If you want to do anything on the client side, you're on your own. Sure, there are plenty of good PHP-based frameworks that work with MySQL, but each is a bit different and moving in its own direction. WordPress, Joomla, and Drupal, for example, offer differing strategies, and it's hard to switch between them, let alone port code from one to the other. Anointing one client framework adds consistency and stability.

It also helps that AngularJS was built by folks with 20 years of experience building Web apps. They knew well enough to leave the design work to HTML and CSS. They also figured out how to add a bit of JavaScript to scan the HTML. The designers of AngularJS looked at what humans do well, then tailored the JavaScript to support the humans. The templating system and the logic layers are dramatically cleaner than what we've seen before, in part because the team figured out simpler ways to leverage the local power of JavaScript to guess what you are doing.


Previous Page  1  2  3  4  Next Page 

Sign up for MIS Asia eNewsletters.