Day 51 – First Day of MEAN

I didn’t do much coding stuff over the weekend. Before coming in Monday morning, pretty much all I had done was install Node. When I got to the Dojo, instead of the usual morning algorithm whiteboarding session, we watched an algorithm documentary! It was all about how important algorithms are to our daily lives without us even noticing. It was a neat documentary, and it’s available on Netflix if anyone wants to check it out: The Secret Rules of Modern Living: Algorithms

After the documentary, it was time to get cracking at the N in MEAN, Node.js. After installation and setup, the next step was to get acquainted with npm (Node Package Manager), which is the node equivalent of pip for Python. Back in Python we used pip to install “libraries” and now we’re using npm to install “modules.” Oh, and in Rails we installed “gems!” These are all just different names for the same thing: pre-built chunks of code openly available for use to make our lives easier. Later I’ll do a post about some cool node modules!

For the rest of the first day, we only used Node as a tool to run JavaScript files in the terminal. The first few chapters in the platform were all about JavaScript fundamentals and how to use OOP concepts in JavaScript. A lot of it was review since we’ve been using JavaScript daily for our algorithm sessions, but there were a few new topics, like object prototyping and how to use the “this” and “new” keywords effectively. Since JavaScript doesn’t have “classes” like Ruby or Python (actually now it does, but we’re still learning how to write JS the old fashioned way), we have to use constructor functions to create the equivalent of classes, and then the “new” keyword allows us to instantiate an object using the constructor function. Prototyping is a technique that allows us to save memory by storing properties or methods on a single “prototype” that all instances of a particular object have access to, rather than copying the same method or property over and over again for each instance. Pretty cool stuff, and it makes me wonder about memory management in other languages. I’ll have to do some more research about that later.

That’s pretty much it for day 1 of MEAN. Installed Node, did a bunch of JavaScript stuff. MEAN kinda feels like it’s going slower than Ruby was, probably in part because we’ve already been doing JavaScript algorithms for two months now, and also because Ruby/Rails had so many magical features and shortcuts. Next up: Day 2… at the DMV!

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s