Getting started on JS Frameworks

This post is especially on a request. The main aim of this post is to help understand people on what’s what in the world of JS and make an informed decision if this arena is a good choice.

I personally think the JS Frameworks are here to stay and they will keep on prospering and progressing in future at least for the next 10-15 years. It will be a long time when there will be something else that will make JS frameworks obsolete. The explosion of JS Frameworks began after the introduction of NodeJS,the glorious JSRE ( Javascript Runtime Environment). It would be surprising to learn that NodeJS was initially introduced in 2009. So,for the past 7 years, many improvements from the open source community has honed it in several ways and recently it has become of the popular demands of the job market.

Before we jump into making decisions on the frameworks,let’s first understand what NodeJS is about. As I mentioned above and in my other post, NodeJS is just an JSRE. Ryan Dahl is the original author of this platform and the wiki on Node is a worth read. Prior to NodeJS, Javascript was used as a front end technology. It was used on the browsers to perform several operations. These included from making the web pages fancy to the introduction of wonderful world of AJAX. Since browsers were needed to render the Javascript, it is a no wonder that browsers have some kind of Javascript engine within them that help run the JS. Such a JS engine on the very popular browser, Google Chrome is called by the name V8.

V8, is top of the line,crème de la crème of Javascript engines and what the authors of NodeJs did is, they extracted this V8 from the browser and with some wrapping code of C++ around it, they were able to concoct a standalone Javascript engine and thus NodeJS was born. So NodeJS, is a standalone JSRE, which could be used just like any programming language like Java,Python,Ruby etc,. There are several advantages of NodeJs over other programming languages but that is out of the scope of this post.

When Ryan Dahl introduced NodeJS in 2009 at the JS Conf, it received a standing ovation. And just like any popular software language, it attracted lot of developers who in turn started writing frameworks around NodeJs. To my knowledge, the major frameworks that came out this sequence of events were MEAN, Meteor, Sails, Koa etc., Of course there are lot more such frameworks and you could do your due diligence before arriving at one, the most popular that are popular today are MEAN and Meteor.

MEAN: MEAN is a full stack framework which stands for Mongodb, ExpressJS, AngularJS and NodeJS. Using this framework, full stack applications could be developed with Mongodb as the database, Express for the web app framework and Angular on the front end and NodeJs for the backend.

Meteor: Meteor is also a full stack framework with NodeJS as its backend and I suggest you to read my post to get little more insight.

What I found personally is, both Meteor and MEAN are designed to be built on MongoDB. Although I don’t have anything against MongoDB, I somehow am not comfortable with the fact that it these frameworks are not database agnostic. Again, this is just my personal opinion and honestly there are about a million apps that are effectively using these frameworks so this formula apparently is a good one.

I have heard from many of my talented friends and colleagues that overall NodeJs and its frameworks are super awesome and they love working on it. So, what does it take a person to start working on either MEAN or Meteor framework? Here are some guidelines that you should consider.

  1. Do a little due diligence on NodeJS, I mean core NodeJS without the framework. Try to understand the inner workings of the language. Just to get you started, here is how to install it. I wrote it for Mac but it is equally simple and straight steps for Windows. Oh btw, if you are installing on Windows, then choose msi.
  2. Because both the frameworks depend on MongoDB, due diligence on MongoDB is also essential. Again, to install MongoDB, you can read this.
  3. Try to get webstorm ( or intellij). This is the best ide for JS development and even if you have to shed a little money on it, it is worth it. Tip: Try to see if you can get hold of a friend who is school. With a school email id, this IDE is free.Shake up all your contacts and find a student who can help you.
  4. Decide on a project. I am a strong strong believer in this. Think up of a project in your head and start working on using the above technologies.Without a project in mind, all the effort will be in vain and the satisfaction of learning something good can never be achieved.

Good luck.

Thoughts on JS Frameworks.

Too many fancy words for one day! Frankly over last year, I have been hearing a lot about the JS frameworks and honestly they were intimidating. Today I grabbed up all my courage and plunged into this JS world. Being a Java developer at heart, I do not have a good impression on Javascript. I do not know how this feeling came into my head but it did.  But, this is in fact the very characteristic which a software engineer should not have. I understand that technology is supposed to progress and engineers should embrace it with all the love and here I am.

One thing that bothered me( and still does) is the plethora of options in JS. Even from the days when I started with jQuery, there were too many names in JS World. Names like AngularJS,MeteorJS, NodeJS, ReactJS, MEAN stack etc etc.. are confusing. So I started with everything.( ofcourse not everything, but I started with some of the big players). When I say “started”, I literally “started” and I did NOT dig deep at all. I barely scratched the surface, just enough to make me familiarize of what’s what.

So here are my findings:

  1. AngularJS is for the front-end. It is much more approachable way than the standard libraries like jQuery.
  2. NodeJS is for the back-end. Simply put, NodeJS is JSRE ( Javascript Runtime Environment) with which you can build server side applications. It is the Javascript without the browser which you can run as a server on your machines.
  3. MEAN stack is basically MongoDB, ExpressJS, AngularJS and NodeJS.
  4. MeteorJS is a full fledged NodeJS framework with which you can build a complete app with front end and back end.

In my research, I read this amazing post https://wiki.dandascalescu.com/essays/meteor_js_vs_the_mean_stack which made me look into MeteorJS. So far am liking it as I am able to scoop up a sample app from meteor in matter of minutes. I think I will be working on it for few days to come and posting on it heavily. So please come back and check them out.

PS: If you are like me and trying to swim through JS frameworks, drop me a word about what you are interested in and why. It will be good to know on what I am missing.

 

Installing NodeJS on Mac.

I know, I know, there are lot of sources out there for this topic, but I still want to write this as a note to myself. Makes it easier to search 🙂

First thing I want to be clear is, I spent a little while looking for this and honestly the best resource is by people at NodeJs. So save time and end your search at https://nodejs.org/en/download/

I chose the .pkg installer and it will open up this window.

Screen Shot 2016-06-19 at 9.45.46 PM

From this step, it is pretty much click, click, click. Once this is done, just do a sanity check. Open up a terminal and type node -v. You should see some version in there.

Screen Shot 2016-06-19 at 9.49.26 PM.png

Now, to satiate the curiosity, let’s run a javascript command at terminal. First thing to fire up the Javascript engine on your machine is to hit node and then blast away. So I ran a couple of very simple commands and they look like this.

Screen Shot 2016-06-19 at 9.54.24 PM.png

That’s it folks. You have successfully installed a Javascript engine on your machine. Now you can use Javascript without the browser and use it as a backend technology! Enjoy!