Category

JavaScript/AngularJS adventures of a Java guy Part 0

Background

I’ve been a developer since 1982. I’ve learned and used dozens of technologies in that time. I followed the general path of C (1982) to C++ (1987) to Objective-C (1988) to Java (1995) with many side languages (DSP asm, scripting languages etc). I pretty much abandoned C++ when I saw a demo of Java in 1995 at AT&T and have been doing it ever since. Most of Java, from Applets in the beginning, to the back end with various application servers (WAS, Weblogic, etc), to front end Swing and later JavaFX.

In the 90s I looked at LiveScript – which was renamed JavaScript when Java became the It Language du jour. I thought it was horrible. Times have changed. A very large number of developers have taken the “good parts” of JavaScript and built libraries (e.g. jQuery), frameworks (e.g. AngularJS), and tools (e.g. Grunt) that are driving the current web. You still need to watch out for stepping in the cat poop, because the litter box is still there. Luckily, there are well documented ways to write clean JavaScript. For example, the language still lets you pollute the global name space, there are things you can do yourself (e.g. IIFEs), or use frameworks such as AngularJS which provide modules.

There are many JavaScript frameworks out there. Backbone.js was one that I used last year in a Hadoop front end. It’s fairly low level, which is what I needed with searching big data rather than the standard model classes. There are others that I looked at. Right now, I’ve started an AngularJS project for a client. I like to live in “the other guy’s shoes” once in a while. As a primarily back end Java developer, it pays to learn the other technologies so you can become better at your primary technologies.

Why

I usually create entries into a locally installed mediawiki to remind myself what I found out about a technology. My guess is that there might be other Java developers out there who are interesting in AngularJS or other new JavaScript framework and are overwhelmed by the number of new things that have popped up in this space. So, this series will be breadcrumbs for me to remember what I did, but perhaps you will find something in here that is of use to you.

IDE

So, where to start? Well, there is the Emacs of course, which does everything. But I wanted a bit of help along the way.  Besides, I like writing LISP, so the end result would be me writing that instead of getting to work on the JavaScript.

XKCD knows

I looked at the Eclipse options for New Project. Then I searched the plugins. That made me go to IntelliJ to do the same. Yeah, you can cut down a tree with a butter knife, but it’s a lot of work. So, I’ve settled on another JetBrains product, WebStorm. If you’ve used IntelliJ, you’ll feel at home. The Grunt (more on that later) integration is what sold me. It seems that JavaScript developers like Sublime Text, but I wanted something more familiar to a Java developer.

Cool. Let’s go to New Project in WebStorm! The options are various HTML projects or Node projects. No AngularJS love there. Yes there is an AngularJS plugin, but it doesn’t have an opinion on project structure. It does have nice live templates, so I installed it. I could do an empty project. Well, it looks like I need to create the project layout on my own and then import it. I have a CPA do my taxes because he knows a lot more about the IRS then I do. So, let’s see what the experts say about project structure.

Let’s talk about that issue in Part 1.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.