Tuesday, April 24, 2012

SoCal Code Camp, San Diego

I will be giving not one, not two, but three talks at SoCal Code Camp, San Diego. The event will be held on the beautiful campus of UCSD, the weekend of June 23rd and 24th. Woody has promised to bring the Rock and Roll back to code camp, so this is not an event to be missed. There will be dozens of speakers giving even more talks, on all of topics devs need to know. And like all code camps, it is FREE, so there is no good excuse to not attend.

I will be giving the following talks:
  1. An Introduction to Node.js Development with Microsoft Azure
    1. JavaScript Test Driven Development using JsTestDriver and WebStorm 4.0
    2. jQuery Mobile, Backbone, and ASP.NET MVC - A Framework for Making Mobile Web Applications

    The first two talks are new for me. But I have been doing an increasing amount of my day-to-day coding in JavaScript. So I promise to present to everyone who attends, all the juicy nuggets of knowledge I have gleaned over the last year of hard-core JavaScript coding. The final talk is my favorite. The easiest way to go mobile is via jQuery Mobile. If you have heard me give this talk before, you may want to attend again. The source code is tighter, slides are fresher, and my barbs sharper. I will not bore you.

    So I hope to see all of you at SoCal Code Camp, June 23rd and 24th. If you do come, please stop by and say, "Hi!" I will be attending both the speaker's and geek dinner.

    So Cal Code Camp

    My Speaker Profile at SoCal Code Camp

    Monday, April 23, 2012

    WebStorm 4.0 Review

    I first got hip to the guys at a JetBrains a few years back while trying to find a nasty memory leak in a Windows app. I was using a free tool from Microsoft that was not helping me find the issue. I was contemplating writing my own tool, when a fellow team member suggested using dotTrace since we had a corporate license. Once I got comfortable with the tool, I was quickly able to find out that we had not one but several memory leaks. I resolved them all in less than two days. 

    My next encounter with JetBrains was winning a years license for ReSharper about a year ago. The license sat unused until most of the year had elapsed. Finally one Saturday morning I installed it. I was thoroughly impressed. It was actually able to improve Visual Studio already excellent intellisense feature. And it was able to help me write better code by making suggestion to my code while I was writing it. Possibly the most impressive thing of all this was that it didn't make my dev box feel sluggish. I had tried another IDE enhancer and it made my machine noticeably slower and I quickly uninstalled it. 

    Recently I have switched to using a MacBook as my dev box. If you develop programs for iOS you have to have one. Plus it has excellent support from the open source community. One of the open source projects I have taken a shine to is Node.js. As I mention in my post last month, I needed an IDE for Node, really for JavaScript in general, both client and server side. WebStorm seemed ideal on its web site. So I downloaded it and gave it a try. My initial impression was good. Now that my 30 trial has expired I can happily report that WebStorm rocks! So much so that I happily plunked down my 49 dollars for the full version. I highly recommend it to anyone doing JavaScript development.

    What's so great about? There are three main things I like about WebStorm: it helps you to write code quicker, it helps reduce your mistakes, and it helps increase the quality of your code.

    Write Code Quicker

    When I first used intellisense in Visual Studio I was impressed, it quickly earned the nickname, "intellicrack" since I became addicted to it, editors I had used for years suddenly sucked since they didn't have an code complete feature. The code completion feature in WebStorm easily outperforms it in JavaScript and HTML. It is almost clairvoyant in its ability to parse through all of your JavaScript and HTML files in your project. If you declare a var inside a script tag inside an HTML file, WebStorm sees it and allows you to code complete using it. 

    It allows you to automatically refactor JavaScript. This is something the Visual Studio 2010 can't do. You can rename any JavaScript function or var and WebStorm will walk through all of the code and markup  in your project and fix all the references. This magic also works when you move files. I decided to move my startup page, index.html, from the root to a sub directory. The references to the script tags inside the directory automatically adjusted themselves as shown below:

     before moving index.html

    after moving index.html, the script tags references automatically fix themselves

    Reduce Your Mistakes

    JavaScript is a harsh mistress. If you make a mistake, she will rarely say anything, she will just sit quietly and let you guess what you did wrong. WebStorm will break the silence. It parses your JavaScript as you type it. This parsing happens unbelievably quick. My machine never felt sluggish while I typed which can sometimes be a problem. When WebStorm sees possible errors it will indicate them. Squiggly lines will appear beneath undeclared vars. The last word of an unterminated statement will appear highlighted. In both cases hovering above the indicator will cause a tip to appear below. 

    Increase the Quality of Your Code

    WebStorm comes with Google's JsTestDriver built-in. For those of you not knowing, JsTestDriver is a unit tester for JavaScript which executes your code in one or more browsers both local and remote. Normally you would have to spin up JsTestDriver's server. Then open up each browser you wish to test to against and point them to the server. This isn't difficult to do, but it is time consuming. As all you unit testers out there know, tedious test will simply not be executed. 

    WebStorm removes all of the friction. Assuming that you have written some test cases in JsTestDriver's format, all you have to do is hover above a "TestCase" right click and choose, "Add JsTestDriver assertion framework support". The supporting structure for the framework will be added to your project. Then click the "JsTestDriver" tab at the bottom of the IDE to see its control panel. Clicking the green arrow, will spin up JsTestDriver's server. Clicking on any of the browser icons will launch the browser and point it to JsTestDriver's server. After starting all of your browsers you only need to click the green go arrow to execute your tests against each browser. You can even execute test with coverage so you have some idea of how much of your code has unit tests and how much is naked. 

    WebStorm also includes JsLint and JsHint. I have never used JsHint, but JsLint should be a mandatory tool for all JavaScript developers, especially those on a team. Just go to preferences and enable JsLint and it will point out all of the little mistakes which creep into JavaScript code. 

    As if all of this wasn't enough, you can also debug JavaScript. It allows you to set breakpoints and give the breakpoints conditions and dependencies. 

    This is an unbelievably good development tool, but it isn't perfect. Sometimes the tool tips won't go away automatically. Pressing the escape key once or twice will make it disappear. Also the documentation and tutorials are a bit disjointed. WebStorm and its sister PHPStorm are both based on JetBrains' IntelliJ platform, so especially in videos, they may be using one of those other products, and as a result what you see on the screen may not exactly match what you see on your machine.

    I've only listed the features which most impressed me, but there are numerous more things that WebStorm can do. If you develop in JavaScript, you will want to check it out for yourself. It is available for a 30 day trial. I used the Mac version but it is available for Windows and Linux too. 

    JetBrains' WebStorm 4.0
    Google's JsTestDriver

    Thursday, April 19, 2012

    South Bay Mobile User Group

    Just came back from a meeting of the South Bay Mobile User Group. Developer Chris Scripca gave a presentation on Android development. Plus he added the extra twist of what it is like creating titles as indie developer. It was an excellent presentation. Thanks Chris!

    I gave a quick talk on our upcoming jQuery Mobile Project Based Training. In a nutshell, for less than the price of most computer books, we will spend four weeks building four applications in the jQuery Mobile framework. Along the way we will learn about HTML5, Backbone.js, and Underscore.js. I will demonstrate all of the techniques used in building enterprise level solutions using jQuery Mobile. The one session per week format will allow you to work through the provided source code at your own pace and gives me plenty of time to answer questions and look over shoulders.

    What will you need once you sign up? A laptop and whichever web development IDE you are comfortable using. The course will not cover back-end development, we will be focused on the front. For the course I will be using Visual Studio 2010 Ultimate, but almost any front-end web development IDE will work. It only needs to be able to handle HTML, CSS, and JavaScript. Microsoft offers for free, Visual Web Developer Express. If you are using a Mac, I recommend using JetBrains' WebStorm, it isn't free but you can download a free 30 day trial version at the link.

    Can't attend all of the sessions in person? We will be webcasting each session live. Please join us, Tuesdays beginning May 1st. For more information: 

    Tuesday, April 10, 2012

    Typemock Isolator

    I love winning prizes. At my local developer group, SoCal .NET, I won
    Typemock Isolator in a raffle drawing. Like most developers, I know that unit testing is good thing to do, and like everyone else, I am normally too lazy to do it consistently. I am determined to change that. IMHO: The benefits of doing unit test out way the cost of doing them. 

    Typemock Isolater isn't cheap, so winning it certainly cut out my resistance. Even if I hadn't won it, I was still thinking of buying it. I have a different way of evaluating the value of things, please note I said "value" and not "price" intentionally. I value my own time at about $75 an hour. If something saves me an hour it has in effect earned me $75. This is the reason why I spend my own money on books and subscriptions to sites like TekPub and Pluralsight, because they always save me time.

    My life with Typemock Isolator will begin in about a week. I am adding some new functionality to my web service in order to support a mobile project I am working on. I am going to unit test the new stuff. I will keep you informed about the things I learn along the way.

    Monday, April 9, 2012

    Jack Tramiel, R.I.P.

    In the 10th grade I saw my first personal computer, the Commodore PET. By today's standards it wasn't much to look at. It was an all in one unit, with the keyboard, a tiny green screen, and a cassette tape for storage, all together. But in 1978, it was an amazing gift from the future. It came with a few sparse manuals and no software, but I was drawn to it. My math teacher, Mr. Moore, knew that I was smart but lazy kid, barely finishing my own homework, reluctant to help anyone else with theirs. With the PET's help he found a way to reach me. He made me a deal. For every hour I tutored others in the math lab, I would earn an hour on the PET. Helping others raise their grades helped me to raise my own.

    By the Christmas break, I had a large surplus of hours, so he allowed me, with my Dad's consent, to borrow it over the vacation. It was my first hack-a-thon. Over two blistering weeks I figured out how to write programs in BASIC and save them to the cassette. When school resumed I had finished four games. Mr. Moore was impressed. He had an idea for an educational game and contracted me to write it. At that point, while still a sophomore in high school, I became a professional computer programmer, long before most people even knew what it meant.

    I was saddened to learn of the death of Jack Tramiel, the founder of Commodore International today. He was a true pioneer. I can truly say that he deeply touched my life. My memories of those early Commodore computers will always be happy ones. I learned a lot from them: the VIC20, the C64, and most of all the PET.

    Jack, you will be missed.

    Saturday, April 7, 2012

    jQuery Mobile Professional Training

    In May, in association with my friends at the South Bay Mobile User Group, I will be teaching a four session training course on jQuery Mobile. Unlike other presentations I have done on this subject, these sessions will be in-depth and hands-on. I will have plenty of time to teach, answer questions, and look over your shoulders. If you want to get into the mobile web, this is the course for you. The meetings will be hosted at American Honda in Torrance the first four Tuesdays in May, the 1st through the 22nd. The fee for this course will be only $28. Not in southern California? We will be webcasting this course as well. To sign up or get more information: South Bay Mobile User Group - jQuery Mobile

    Tuesday, April 3, 2012

    LA C# jQuery Mobile Presentation

    Here is the link to jQuery Mobile presentation to LA C# on April 3, 2012. The slides are in both PDF and Power Point format in the root directory of the source code.

    LA C# Source Code and Slides

    If you attended the presentation, please take the time to rate it: