Over the past year I have had several projects at work (I feel like a real live consultant now) and I have used a few new technologies and tools on those projects. The skills that have really come a long way are my JavaScript skills.
I know what some of you might be thinking, “WTF, JavaScript?!?”
Yes. JavaScript. It’s not as cumbersome and taboo as it was back in the 90s. There are new tools and frameworks out there that have actually made JavaScript not only easier but … dare I say it … fun?! The library that has made JavaScript easier, for me, is jQuery, which I have been using for a couple years now and I won’t write any JavaScript without it. There are two frameworks that I have played around with recently that have really made JavaScript kind of fun: Knockout and AngularJS (I know these are not the only two but they are the only two I have spent any time using).
I think I have gone on before about how much I enjoy the magic behind jQuery. I even saved a few on snipplr which have had a few strangers favorite, although I could probably improve on most of them with the newer versions of jQuery. Using jQuery will definitely make your web page feel very dynamic and that seems to be the paradigm we are going for these days. A “web site” is quickly becoming a legacy term and we are evolving into developing “web apps” – which is essentially a website that functions as if it were something running on your desktop (instead of in your browser). I’m sure the evolution and massive adoptions of tablets and mobile devices has been a major catalyst.
The jQuery syntax and plethora of plugins really makes developing web apps much easier and adds a level of enjoyment to it. In fact writing your own jQuery plugin doesn’t require any additional software or new syntax, they are still js files that just use existing jQuery syntax. I have yet to write one myself, but I really want to, someday … if I can think of a worthwhile plugin to write. I have noticed a drawback about jQuery lately; the more complex you make your page the more JavaScript you have to write. I have a couple of sites where there is more JavaScript code then actual markup and trying to find a specific function to modify can be an exercise in perseverance. When JavaScript code becomes increasingly verbose, that’s when frameworks like Knockout and AngularJS come in handy.
I’d like to go on about Knockout and compare it to AngularJS but I haven’t spent a lot of time recently enough with Knockout and I have spent quite a bit of time the past couple of weeks with Angular. I mostly started looking into Angular because its one of those terms that has been mentioned quite a bit around the office. Many folks have talked a lot about using it and it has been implemented at my next assignment. I wanted to go beyond just watching the Pluralsight videos and reading the tutorial on the website. I wanted to see if I can get it working on a website. Therefore I made one of my websites the guinea pig 🙂
Angular uses “directives”, which are essentially special attributes added to HTML tags that only mean something to Angular which tell Angular where it will be applying changes or reacting to events. While you can still use jQuery to handle some of your pages events, in Angular the controller will contain the majority of the code that needs to be executed. It does add a bit of brevity to your html pages.
If you have done any development using the MVC pattern your attention may have latched onto the word “controller”. In Angular you are essentially using an MVC pattern (although you will often see it referred to as MV* when folks speak of Angular). Your controllers are still written in JavaScript but I often create a controllers.js file and keep all my controller code there. Therefore, if you need to make a change to some logic and you know its going to be in a controller, it will be easier to find the bit of code you are looking for to make your change. No more scrolling through lines of JavaScript code, or hitting Ctrl-F to find a specific function (unless you are using several controllers, in which case I would encourage you to create multiple controller files).
I’ve only really just begun to dive into Angular and I’m already enjoying its power and brevity. As I continue to witness and invoke its prowess I’m sure to be inspired to write some more, however I’ve run on enough for now but I encourage you to check out all of the things I talked about (if you haven’t already).
I could get so much more accomplished if I only had minions!
Issue 110: Oh, wait, no, we’re just at one hundred and ten. I guess I have to move to Denver and nearly break my neck to get to 509. If you don’t know what I’m talking about, unless you are an NFL fan (the real thing, not the EA Sports kind) don’t worry about it. A completely random numerical title with a cultural reference just seemed like a fun thing to do. In any event, Warlords of Draenor pre-expansion patch is officially live. We all are having to learn how to play our characters again and we have to get used to the stat squish. Of course if you’re not playing WoW then all of that information is completely moot, but keep reading because I’m going stop referencing WoW now 🙂
October 13, 2007 will forever be the favorite day of my life, followed very closely by April 14, 2014 (after all the latter couldn’t have happened without the former). Since Octoboer 13th was just this past Monday, this seemed the appropriate TBT post. I’ll admit it was a day I never thought would happen to me; not many of us with that “computer geek” label are credited with having much luck in the romance department; but for what its worth, we do have amazing “grep” patience 🙂
This week the 6.0.2 patch is released, which contains pretty much all the expansion changes except the new zones. We will essentially be bidding farewell to Pandaria as everyone prepares for Warlords of Draenor by grinding the three new instances (and acclimating to the item squish and class changes). So as we bid adieu to Pandaria I want to reflect on my likes and dislikes of this expansion.
Issue 109: Isn’t that an awesome lunar eclipse. The “Blood Moon”, such an iconic event to happen in the month of October. Yes, fall is upon us and so are many a content patches and expansions. Obviously the gaming companies are gearing up for the Christmas season and the winter months for those that will be sequestered in their homes in the colder regions of the world. Blizzard, Bioware and the other companies are preparing content for your enjoyment while you endure the frigid winter months. Also,
This is a very fond memory. Pool Nights at Nick’s Pool Hall. It was so much fun just hanging out and shooting pool and having a couple of beers. This was a pastime Doug, Alan and I would partake in quite often during our latter years at Purdue. Everyone wanted to go to the Neon Cactus or Where Else, but I would have never chosen those places over Nick’s. I know one of the things that people will notice in this picture is my iconic Australian Fold-Up hat. I came back from a family vacation with that hat and it became something I was known for … although apparently I was the “creepy-guy-in-the-hat” according to my wife, whom I had barely known at the time (