MEAN stack question
Page 1 of 1
PumpAction
[Schmadmin]



Posts: 26759

PostPosted: Thu, 19th Mar 2015 00:41    Post subject: MEAN stack question
So I'm going to attend a 24h programming competition this friday, where we will work with some gb of data (xml, xls, csv) and create apps that access these data.

For years I was lazy and just went ahead with my xampp setup (mainly apache, php + mysql and html/css/jquery for the frontend). But I always hated the backend stuff where I had to take care of the communication and parsing/translation of data from/to SQL and so on.

Because of the stuff I do at work, I came into contact with angularjs, and I think it is really great but then I also got to play with meteor! Boy that was great, especially mongodb was fantastic.

I implemented LDAP authentication into meteor and realized, that it is still far away from productive use and will require a lot of time from my side to master it.

Angular on the other hand is a pretty straight forward frontend framework. So I tried to find the best way to create an alternative dev stack to my old and shitty xampp.

On the mongodb site I saw that they suggest a nice mean stack
M. MongoDB (NoSQL DB)
E. ExpressJS (Webserver)
A. AngularJS (Frontend, + I'll use bootstrap to save some time, remember it's a 24h competition)
N. NodeJS (Backend)


Now apparently there are already some prebuild stacks, like MEANjs and Mean.io .

May I ask what the benefit is of using such ready stacks and why I shouldn't just download nodejs (or should I go for io.js?!), npm, bower and then just download angular, express and mongodb into it?

Bonus question: Mongoose looks interesting, but I like the simplicity of pure mongodb access via js (through node.js of course). Is Mongoose' added complexity worth for smaller approaches?


=> NFOrce GIF plugin <= - Ryzen 3800X, 16GB DDR4-3200, Sapphire 5700XT Pulse
Back to top
VGAdeadcafe




Posts: 22230
Location: ★ ಠ_ಠ ★
PostPosted: Thu, 19th Mar 2015 16:28    Post subject:
This is hella interesting, I'm also tired of the same old php + jqueried javascript and html+css clusterfuck ...

I'd like to finally be able to create a website more as an appplication instead of some glued together technologies full of deprecated bullshit and ten different ways to do the same things.
Back to top
PumpAction
[Schmadmin]



Posts: 26759

PostPosted: Thu, 19th Mar 2015 16:57    Post subject:
I set up everything yesterday evening, finished my first tutorial and I am already sold. This is a great and fast way to get productive very fast and very easy! Totally recommended!

Just as a small log, I did the following to get ready:

Download & Install:
Git, io.js (you can also take node.js, they are basically the same) & MongoDB.

Then I created a project folder. In there I did the following:
With io.js(node.js) comes npm. With which I installed
ExpressJS
MongoJS (and to make the parsing of the incoming json messages easier, I also installed body-parser)
& and I globally installed Bower. (npm install -g bower)

I created a subfolder called public where I installed the following using bower:
AngularJS
jQuery
Bootstrap


All of this takes less than 30 minutes Smile

during installation with npm & bower I always used the flag --save (f.e. bower install angular --save) so that the dependency is automatically saved in the package.json/bower.json (which you should both initialize once before installing any npm or bower packages by simply typing npm init/bower init in the corresponding directories).


BTW I created the subdirectory public to store my whole web facing files in (css, js, html, images etc) and make it easier to serve those.


Follow this simple tutorial if you want to create a simple mean app, that guy is quite slow, so you should be easily able to follow every step Smile



=> NFOrce GIF plugin <= - Ryzen 3800X, 16GB DDR4-3200, Sapphire 5700XT Pulse
Back to top
tainted4ever
VIP Member



Posts: 11336

PostPosted: Thu, 19th Mar 2015 19:24    Post subject:
I personally prefer Laravel with Mysql, but since you liked the MEAN stack so much Pumpy, I recommend you check out meteor.js:

https://www.meteor.com/


Sense Amid Madness, Wit Amidst Folly
Back to top
Werelds
Special Little Man



Posts: 15098
Location: 0100111001001100
PostPosted: Thu, 19th Mar 2015 19:50    Post subject:
The problem is that you're still entering technology that is already obsolete or has some issues that are problematic in bigger environments. Angular I personally really hate, as they have not only changed their philosophy a million times, they also do a *lot* of things that both front- and backend developers hate. With a lot of these hip frameworks (Angular's just one of them) there's too much code duplication (yes, let's have business logic in both places), doing things in the wrong place (HTML in your JS files, ewwwww), having pure client-side rendering. Just look at most "SPA" implementations; almost empty response from the server, after which it takes a few seconds for the fucking JS to fire up just because the developer hates doing server-side shit or is simply too dumb to do it. And Angular is slow.

Angular2 looks like it's heading in a better direction, but the future lies with web components and they're not embracing them 100% yet. Polymer, X-Tag, Bosonic are far more interesting as they keep front end code on the front end, back end code on the back end and don't prevent you from properly caching responses server-side.

And then there's Node, which has got so many people understanding how it works so wrong. A lot of people go "omg async so cool"; but unless you take great care, there's nothing asynchronous at all, your request will often still need to wait for all those operations on the one (!) I/O thread it runs with. It's bloody fantastic to quickly build small APIs with, but once you go bigger it is bottlenecked by design. There are ways to get around it, but it isn't asynchronous in the way many people think it is. And if you have long running I/O, that _will_ be a problem as Node will end up blocking itself on the I/O thread. And that's aside from callback hell, which really is a thing.

Things like jQuery are definitely on their way out too for those serious about front end performance. More and more developers actually realise that what they use jQuery for can be done quicker with plain JS, as long as you actually know JS. Things like underscore.js or lodash still provide the utility.
Back to top
PumpAction
[Schmadmin]



Posts: 26759

PostPosted: Thu, 19th Mar 2015 20:18    Post subject:
Yeah, I'm basically done with jQ too. Meteor is really nice Tainted, but it's still a mess. And Angular has indeed changed quite a bit from the first time I used it til now. Yes, it's quite slow and it's dirty but I can't limit my dev to chrome only and have to wait a bit until Object.observe is supported by more browsers.
+ my main intent is to have a rapid development environment for the 24h challenge.

I love doing pure JS and CSS stuff, most of the stuff I am proud of is pure, without any external library anyway...

Regarding Polymer, yeah that one I tried as well and I think that Angular will disappear soon in favor of webcomponents, or just simply merge some approaches after they've gone 2.0. But Polymer is simply not ready for anything serious as well. If you want performance you should do everything by hand anyway Smile

And as with anything, most of those libs started to tackle a specific problem, where they are good at and are bad and badly performing when used for something that doesn't fit them.


=> NFOrce GIF plugin <= - Ryzen 3800X, 16GB DDR4-3200, Sapphire 5700XT Pulse
Back to top
tainted4ever
VIP Member



Posts: 11336

PostPosted: Thu, 19th Mar 2015 20:48    Post subject:
Honestly web development in its entirety seems like a mess these days. I have a very hard time picking what stack to use for new projects, and I'm not satisfied with anything I've discovered so far. It doesn't help that a lot of "cool" stacks these days are really immature and shouldn't be used in production at all.

Any suggestions from you guys would be welcomed, since you seem much more experienced.

I so far stuck to PHP/MySQL because it's stable, a known quantity, available everywhere, and I've ended up selling my code to over 200 customers, 99% who run on cpanel shared hosting.

But it's a colossal pain in the ass. I'm fine with MySQL and the PHP ORMs for it are nice, but PHP, even with a modern framework (Laravel), is just a mess.

I'm starting a new personal project now, and would like to move away from it.

I might check out Django next, but I have very little Python experience. RoR seems like a mess too, I've debugged large Ruby codebases in the past, and I would rather avoid it.

I wouldn't mind developing in Java, but everything that's Java-based is an overly verbose mess. Adding a DB connection involves touching 3 different xml files, each with its own messed up schema, and then copy pasting a bunch of initialization code off of Google. The only thing that looked remotely ok was Play, but it seems like that's all Scala biased, and Java is a second class citizen there. I might give it another shot soon, if Django doesn't work out.

ASP.NET looks nice, but I've seen people use Mono in production and I've tried using it myself once. It's not pretty, but I might give it another shot. I really don't want to host on Windows. They say they'll port it to OSX and Linux in the coming year or so, so I remain optimistic.

I love C# and .NET and took a look at NancyFX. Again, very easy to work with and looks nice for small things, but running it in Mono for production seems like a shitshow. I don't want to spend my evenings debugging random crashes/performance lockups.
https://github.com/NancyFx/Nancy/issues

I'm horrified by modern Javascript, but am willing to give it a shot if someone can convince me it's worth it.


Sense Amid Madness, Wit Amidst Folly
Back to top
Werelds
Special Little Man



Posts: 15098
Location: 0100111001001100
PostPosted: Thu, 19th Mar 2015 21:06    Post subject:
I keep seeing people who say PHP is a "mess" but I don't understand it. How is it any more or less of a mess than JS, Ruby or Python? That said, I personally don't work with any of the big frameworks so perhaps my view is skewed; the framework I work with I've pretty much built myself so I have full control over what happens. The problem with any framework in any language tends to be that they try to cater to all use-cases, which inevitably leads to a mess. Rails and Django are no better.

The languages themselves all have retarded things in them (they all suck Very Happy); on the whole I still think C#/.NET are better than most of them, but unfortunately with .NET for the web you're gonna have to decide between either using ASP.NET, which is absolutely horrible (just look at the shitty markup it produces and you'll see the tip of the iceberg) or not using it and ending up doing a lot more work. And it's slow. I haven't used Nancy though Smile

Honestly, the thing that has my attention the most right now is Go. It has a very solid stdlib, the majority of community libraries are of great quality thanks to what is shaping up to be a great community and it is ridiculously fast because it's a compiled language, yet also has a good garbage collector. As a language it does have issues (no generics whatsoever, no enum, not even real classes) but in my testing so far none of that has been a major issue and certainly not as annoying as JS' epic type failures or PHP's. It is statically typed, which I like and does have a few features that other languages do lack. The way return types are implemented, defer (<3), goroutines are all great little features. Unfortunately I haven't had time to develop anything major with it yet, but so far I like it quite a bit.
Back to top
tainted4ever
VIP Member



Posts: 11336

PostPosted: Thu, 19th Mar 2015 21:28    Post subject:
Hi Werelds,

I agree with you completely. I actually think all JS/Ruby/Python/PHP frameworks are a huge terrible mess Smile So it's not that I think one is better than the other; they're all equally horrible to me. I just want to pick one now that I can be productive in, and stick with it.

I have some hope for Django because I've head nice things, but we'll see...

Glad to hear you also like C# Smile And I agree with you, ASP.NET looks like a terrible rabbit hole that I don't want to dive down. Although they're saying ASP.NET 5 is going to be very different, so I'll give it another shot, but I don't expect it to work out.

Go looks very very very interesting, and I've haven't done anything large in it either. I love all the sample code I've browsed though, I love the philosophy, and I love where it's going Smile That being said, it's still a bit too young for me, especially web development.

-t


Sense Amid Madness, Wit Amidst Folly
Back to top
VGAdeadcafe




Posts: 22230
Location: ★ ಠ_ಠ ★
PostPosted: Thu, 19th Mar 2015 23:34    Post subject:
Holy shit I just did a little test app with Meteor.js to see what's up.


Now my pants are all wet.
Back to top
PumpAction
[Schmadmin]



Posts: 26759

PostPosted: Fri, 20th Mar 2015 14:28    Post subject:
Yeah, but Go for productive use still far away. And I didn't want to kick off a general discussion but was merely for something to rapidly create something Wink Sadly I don't have that many dev tasks in my daily work and am working more on the architecture side and performance analysis... Maybe I should search myself another company Smile This is also a reason why I join this challenge. It's about open data and what can be done if you access GB of actual and historical data and you can do with it... It's a first for me so I am quite excited and also terrified. I know something of everything but I'm not sure if there won't be experts on the single areas Smile


=> NFOrce GIF plugin <= - Ryzen 3800X, 16GB DDR4-3200, Sapphire 5700XT Pulse
Back to top
PumpAction
[Schmadmin]



Posts: 26759

PostPosted: Fri, 20th Mar 2015 16:59    Post subject:
i feel like an old fuck. All those youngsters xD


=> NFOrce GIF plugin <= - Ryzen 3800X, 16GB DDR4-3200, Sapphire 5700XT Pulse
Back to top
PumpAction
[Schmadmin]



Posts: 26759

PostPosted: Sat, 21st Mar 2015 21:06    Post subject:
Aaand I am home again, haven't slept a bit. Won two first place prices with our random team, had great fun Very Happy


=> NFOrce GIF plugin <= - Ryzen 3800X, 16GB DDR4-3200, Sapphire 5700XT Pulse
Back to top
tainted4ever
VIP Member



Posts: 11336

PostPosted: Sat, 21st Mar 2015 22:04    Post subject:
Good job ! Smile hope they were cash prizes


Sense Amid Madness, Wit Amidst Folly
Back to top
Werelds
Special Little Man



Posts: 15098
Location: 0100111001001100
PostPosted: Sun, 22nd Mar 2015 00:09    Post subject:
Nice Pumpy..did you get a hoo..wait, you're married, can I have the hooker? Cool Face

tainted4ever wrote:
That being said, it's still a bit too young for me, especially web development.

PumpAction wrote:
Yeah, but Go for productive use still far away.

Except that it's the exact same age as Node. It's been around for 6 years, only difference is that Node got popular quicker because every dipshit who's ever dabbled in JS started fiddling with it.

From what I can tell, that has only been a good thing though, because most of the community packages are actually of really great quality exactly because there weren't that many people using it.

I am currently planning to rewrite one of our tools into Go, will report back with how it turned out Razz
Back to top
PumpAction
[Schmadmin]



Posts: 26759

PostPosted: Sun, 22nd Mar 2015 23:46    Post subject:
Got a 1 year card for 50% reduced price on fares for long distance travels within germany and a raspberry pi 2 Smile


=> NFOrce GIF plugin <= - Ryzen 3800X, 16GB DDR4-3200, Sapphire 5700XT Pulse
Back to top
Page 1 of 1 All times are GMT + 1 Hour
NFOHump.com Forum Index - Programmers Corner
Signature/Avatar nuking: none (can be changed in your profile)  


Display posts from previous:   

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group