Hacker News new | ask | show | jobs
by metastew 4667 days ago
One advantage of the MEAN stack is that you only need to know javascript to start developing on it, which saves time and brainpower to get started.

That being said, I'm curious if there are other advantages to learn the MEAN stack?

3 comments

Javascript is a harder language then most web development languages when you really get into it (OOP, inheritance, scope, first class functions, callbacks, closures, compile time errors). If you go into it thinking your going to save brain power you may be in for a rude awakening.

The advantage is you can do real time async stuff a lot better then with other frameworks.

> OOP, inheritance, scope, first class functions, callbacks, closures, compile time errors

How does any of that make it harder than "most web development languages"?

> The advantage is you can do real time async stuff a lot better then with other frameworks.

How so? AFAIK, the only difference is that in Javascript you can only do async stuff, you don't really have a choice.

OOP: This is done with Functions not Classes. Inheritance: Theres at least 3 different ways of doing this, 2 of them suck again use Functions instead of Classes. Scope: Variables outside a function are global and theres no block scoping. First Class Functions: This is not something most people are used to and can become confusing Calbacks: Callback Hell, you can shoot yourself in the foot and mess up your code if you don't put extra thought keeping things organized and thinking through async/sync Closures: Theres function scoping but not block scoping, this can be confusing if you're used to block scoping Compile Time Errors: Theres very few compile time errors. If you are using a Function that requires the "new" keyword and you forget it your code will still run and all sorts of wacky things will happen.

Yes other languages have these features but they are harder in Javascript, thats why Javascript is a harder language.

Look into Meteor.js - try doing that in PHP. That's how so. And you can write Sync code if you want to.

I know all this, but I still don't think it's any harder than other languages. I have been following Meteor since the beginning, but I'm not impressed anymore to be honest. Seeing the video for the first time was quite shocking, but in the end they didn't really deliver. Using it is still a pain.

> try doing that in PHP

Meh, PHP is still the king, and it will stay there for a long time. Languages and platforms with crazy features pop up every day, but that's not enough for actually getting things done. You need a community, mature libraries, and a healthy ecosystem in general.

If you want something challenging try Clojure. It is by far The Best Language (tm) IMO, but you still can't even build a website with it. The only web framework available died and got separated into libraries, and everyone ends up wiring everything the way they can. Some people use Java libraries, some others reimplement everything. It's pretty messy.

Most javascript code is actually synchronous. It is the event loop (xhr requests, timers, timeouts, etc.) that is async. TLDR, some parts of the language are sync, some are async
I've just kicked off my latest project using the MEAN stack.

The main advantage for using the stack has been a huge time saving in getting the project set up. NodeJS and express is hugely flexible about how you structure your source, which can also be a downfall in the additional mental load of deciding where stuff should go. MEAN does this for you.

The disadvantage has been where I want to do things differently from how MEAN is set up. For example, MEAN uses Bootstrap v2, I wanted Bootstrap v3. It was a slight faff updating it. It would probably be harder if you eg. wanted to use MySQL instead of MongoDB.

There is still a lot that you need to learn before you will get an app fully up and running, but with MEAN you can get cracking on stuff before you know it all. I don't know anything about Grunt yet, but can still use the Grunt file provided to run the server.

Well worth using in my opinion.

It's super simple to set up. We're actually thinking of doing a Firebase version of our tutorial, as there would be no local set up (other than hosting the static files).