Wednesday, March 25, 2009

Confessions of a Lazy Programmer: Maven the Easy Way


I have been brushing up on a few different technologies lately, and all of the tutorials & books I have gone through rely on Maven for building a project skeleton. Since my focus hasn't been on Maven itself (instead it is Spring and Tapestry), I have been blindly following instructions from the command line. For very basic projects, this has worked fine.


Anything more complex, and I see things like this:
Since I wasn't trying to set up any database connectivity, this is thoroughly annoying. I was only trying to validate that I can build a skeleton project so I can move on to installing and configuring the Tapestry plug-ins for Eclipse.

Since I'm not interested in learning the guts of Maven yet, I did what any good (read: "lazy") programmer would do: I installed the Eclipse plugin for Maven and used Eclipse to create my project. Thanks to Borut BolĨina's great walkthrough, this only took a few minutes. (He has a complete series on creating apps with Tapestry on his blog - encountering this problem gave me another resource to speed my learning.)

This was a much simpler task, since I was able to choose the archetype (i.e., type of skeleton I want to create) from a list. That list is populated by other lazy programmers who built and maintain the Nexus Indexer. This component is used by Eclipse (and via a command-line tool I didn't try) to link the repositories together for me. The upshot is that I can create a skeleton in minutes instead of spending hours or days learning Maven well enough to do it "the right way."

I have used the word "lazy" a lot in this post. To me it simply means that I don't spend time working on things that aren't relevant to the task at hand. The helpful and generous people who built the tools and documentation mentioned above fit this definition of "lazy" as well. For the most part, they built tools and wrote walkthroughs because they needed to in order to advance their own projects. They refined their work and made it available to others to improve it further. They stay engaged with people who use it for the same reason most skilled people do - because helping others by being an authority on the subject is one of the biggest rewards for building expertise in the first place.

I still need to learn Maven reasonably well to use it as part of a continuous integration environment. I may find that there is a subtle beauty and creativity-enhancing magic to using it from the command-line. I just don't need to spend hours screwing around with it right now, while I'm working through the basics of Tapestry.

Really. It's on my to-do list. I'm sure I'll get to it...someday...

(Lazy Dog image by Hector Garcia)

Wednesday, March 18, 2009

User Groups: When Nerds of a Feather Flock Together

I left tonight's Detroit Java User Group meeting thinking again how amazingly useful the group is for programmers. No individual can be an expert in all new technologies. Listening to someone else summarize what they find good, bad or ugly about a particular framework or language really helps me decide:
  • What I want to dive into next, just because it's interesting.
  • If there is an easier way to handle a common implementation, testing or deployment problem.
  • What I might need to learn in order to stay current.

Today's talks were on a these open source tools (explanations are based on my understanding from the 15-minute talks - corrections & clarifications welcome):
  • FitNesse - a software testing tool framework. Unlike JUnit which focuses on very specific tests with hard-coded data, FitNesse is intended to handle soup-to-nuts acceptance testing. It uses a Wiki to both describe the tests and hold the test data.
  • DarkStar - A Java-based multiplayer game server. It handles the communication between clients in a multiplayer environment, rather than physics, rendering or authentication.
  • Grails - A web-application framework built using Spring (among other tools). It is intended as a development environment which uses the Groovy language as the "glue" to hold together Java business logic. You can write part of your application in Groovy, part in Java, and then deploy the whole thing as compiled Java bytecode, using a .war file. This last makes is particularly interesting, since deploying a .war gives you a wide selection of servers with no additional server-side configuration needed.
  • Selenium - A testing tool that runs tests through a browser. Instead of using a mock HTTP object to send tests to a server, Selenium is actually a "robot" that controls the browser of your choice, sends information through it, and checks the resulting page. It can use HTML tables or Java code (or C#, Python, and others) to control the 'bot. It does not solve the problem of cross-browser testing directly, but by running the same tests on different virtual machines, you can get around this.
So what did I take away from this? I really need to learn Groovy, review Spring, and install Grails to have the best of both worlds. Big fun!

Thanks to "LuChOeDu" for the "Geek 2.0" graphic.

Wednesday, March 11, 2009

Pandora: Music While You Code


If you're not already using Pandora, you really should check it out. It is a great way to listen to new music that still falls within your normal range of tastes. Just give it some songs or artists that you like as "seeds", and then give a thumbs up or down to songs as they play. You'll end up with a radio station that plays music you like all of the time. The most amazing part about it is that it's free. They have a few audio ads (I haven't heard one in a week or two) and the usual banner ads, which aren't at all intrusive if you keep the browser minimized.

My friend Dave recently posted about an Adobe Air client for Pandora radio, which I just downloaded today & is working fine. The only real advantage to it is that it minimizes to the system tray instead of to the taskbar in Windows. This is helpful if you use multiple virtual desktops (I use VirtualWin) and want to access it from any desktop.

My Pandora station is mostly Indie music. Check it out if you like that sort of thing...