I was wading in the Single Page Application (SPA) waters and ready to tackle Backbone.js. I knew I had a lot to learn before I could start swimming with any efficiency, but after reading a few Backbone.js blogs and perusing the Backbone.js site, I felt like I had enough to put my first foot in. I was excited and eager to get my feet wet.
Sorry for my poor attempt at novel writing.
Since then, here are the things that I have found to help make the journey to the SPA waters from Java EE a little easier:
Along with learning which are the good parts, there are some language caveats that will give you cold SPA water shock and will prevent the application from being reliable or readable. Here are a few items that you must completely understand to prevent shock:
- context of ‘this’
- prototype and inheritance
Here is a nice tutorial series to get you going from Keyhole’s Zach Gardner:
Tip #3 – Browse the Docs on Your Favorite Browser/Developer Tool
To build upon Tip #2, browse the documentation on your favorite browser and development tool combination. I had been using Firefox and Firebug for a while and didn’t know I was only scratching the surface of the capabilities of Firebug. How handy is it to log when a specific function is called without having to break each time or manually add logging statements? Do you want to be notified when a DOM element gets a child appended? This is just a fraction of what a good developer tool can offer.
The water is starting to become more calm and manageable!
Debugging tools have become really powerful and will continue to add features to help you debug.
Tip #4 – Test on Multiple Browsers
This seems like an obvious tip. Of course Firefox, Internet Explorer, and Chrome can potentially give you different visual results. Everyone knows that, but did you know that they may also give you different exception messages?
Yes, you should also test on other browsers for the obvious reasons. Everyone knows that!
We all know what Eclipse and Netbeans has done to boost productivity for Java. My first several Java programs were written with Notepad. I felt like I got something accomplished when I got a task like organizing my imports finished. Can you imagine if you had to spend time on such a trivial item today? When first trying to develop with Backbone.js, I felt like I was back to using Notepad.
Having an IDE that is a huge productivity booster makes you feel like you have fins to cut through the SPA water.
Tip #6 – Use a Code Quality Tool
Does JSLint’s message of “Warning: JSLint will hurt your feelings.” make you actually feel better? I don’t like inflicting pain on myself, but I guess I can make an exception.
JSLint’s effect is like having a snorkel and goggles to help you see and breath easier no matter the depths of the SPA waters.
Since a large group of developers interested in SPAs have Java EE backgrounds similar to mine, I bring my journey to light as my mistakes are not unique. Hopefully, my journey and bruised ego may prevent others from following the same path.
I now feel comfortable swimming in the SPA waters, but I’m not deep diving to find old shipwrecks yet. My bruises have healed and I’ve learned a lot in the process. I’m excited to keep exploring SPA and see where the journey takes me.
- John Hoestje, email@example.com