Doing it with Ant

I had to write a simple Java class to suck information out of a local database and publish it to a remote database using HTTP POST. I vacillated for awhile between using Perl and Java, but ultimately decided on Java because the Oracle JDBC stuff is more portable than DBI for Perl. (I didn’t want to have to figure out how to put DBD::Oracle on every machine where I might want to run this application.) So, I wrote the Java class, and wrote a build script to compile it and run it. I was then going to write a wrapper (in either Perl or the Bourne shell) that I could call using cron, but my coworker kept needling me to do the whole thing in my Ant build file rather than writing the wrapper. After waffling, I finally looked at the list of basic Ant tasks and figured out that I could, in fact, put the whole thing in a build script and be done with it. So now I have a build script that compiles my code, makes the JAR file, and then runs it. It also has a “runservice” task that checks for a lock file, and if it’s not there, creates a lock file, posts all the records, sends its output to me via email, and then deletes the lock file. If the lock file is present when it runs, it sends me an email letting me know and then it stops. Given that the developers of Ant are dead set on not turning it into another scripting language, it’s amazing how much you actually can do with it. Update: the emails that my script sends attach a text file with Unix line feeds, which is useless when opened them Notepad, so I whipped out the fixcrlf task and handled that problem as well. Ant is unstoppable. ...

February 11, 2003

ESPN.com to redesign | Holovaty.com

Adrian Holovaty reports that ESPN.com is redesigning. Their site looks like crap in Mozilla (especially in the baseball section). I hope that they fix it. Their design was very dated anyway. One thing I don’t find encouraging is that they’ll feature video prominently on the home page. Their affiliation with MSN doesn’t bode well for standards compliance either.

February 11, 2003

How to keep your job

If you’re a professional software developer, it would behoove you to page through the How to Keep Your Job presentation from The Pragmatic Programmers. I’ve talked about the risks to software developers from increasing overseas development, and as you advance in your career, you are always in danger of being replaced by somebody younger, cheaper, and if you’re not on your game, perhaps better. The presentation discusses these risks and some steps you can take to make sure that you’ll be employable for your entire career. One strategy I’m going to be looking at very soon is diversification of my skills. A few years ago, I decided that I needed to move more into hardcore software development, and so I abandoned my Perl/PHP/ColdFusion ways and dove headlong into Java programming. That was a decision that paid real dividends, as it helped me learn about object oriented programming, debugging, real build environments, and lots of other things on top of just learning the Java language. I think the next step for me is to learn C#. I don’t know that I want to be in the Microsoft world full time, but I’d like to work at jobs with broad responsibilities, and familiarity with the Microsoft world can only help in that regard. I’d also like to deepen my Java skills, but I don’t want to be tied to Java for my future career prospects. ...

February 11, 2003

Noah Grey reality check

Noah Grey makes two claims in his WriteTheWeb interview that are untrue: That little statement on my photolog is just my way of saying, "I did it first" - I've read so many articles and comments by now speaking as if there was nothing between Blogger and Movable Type (much less as if Greymatter didn't still have a loyal following, and wasn't continuing to be used by thousands of people). I don't begrudge MT one bit of its success, I have to appreciate better than most the effort that must have gone into it and what a tremendous accomplishment it is - it's a race that I very willingly gave up running, and I'm quite content to stay in my little corner of the web and quietly but happily say, I broke that ground, I did it first. and I think I understand and appreciate the value of openness as well as anyone - Greymatter is one of the most well-known opensource programs in the world, after all (and in fact I've now put it under a Creative Commons license). Was Greymatter the first standalone weblogging software? I think not. Certainly UserLand would have something to say about that, and there were probably other weblogging packages out there before Greymatter as well. And Greymatter as the one of the most well-known open source programs in the world? Which world might that be?

February 10, 2003

Not a crisis

I find it mildly amazing that Colin Powell can say that nuclear proliferation on the Korean peninsula (aided and abetted by Pakistan) is not a crisis. That’s particularly surprising given that Iraq, which is much further from nuclear capability, is a crisis. Am I wrong, or is it North Korea that is threatening to invade its neighbor if the US sends more forces into its vicinity? Everyone is atwitter about Iraq’s chemical and biological weapons, but we stood idly by in the eighties as Iraq used every opportunity to kill Iranians in a war that Iraq started. I really don’t know whether we should go to war with Iraq or not, but the fact that the Bush administration constantly dismisses the Korean situation as they go on and on about the gravity of our “standoff” with Iraq prevents me from believing pretty much anything they say. ...

February 9, 2003

Solaris and Java

I saw a link earlier today to an interesting internal memo from Sun complaining about the implementation of Java on Solaris. Basically, the memo seems to indicate that it’s a big memory hog and that performance sucks, and that the Java team isn’t doing anything about it. Needless to say, if Java doesn’t run well on Solaris, Solaris has big problems. I kind of wonder whether anyone who wanted a desktop Unix box today would go for Solaris over Linux. You’d think that at least Java apps would run better on Solaris than on Linux, but that doesn’t seem to be the case. ...

February 9, 2003

More on Guernica

David Cohen had more details on Guernica at Slate yesterday.

February 8, 2003

Test Driven Development

So, today I’m going to post my first Test Driven Development update. This week it just so happens that I decided to add a feature to one of the apps at work that I maintain that also lends itself well to standalone testing. Basically, there’s some information that’s currently split up between several property files and being hard coded in JSPs or classes themselves. Yuck. So I decided to move it all into one XML file to consolidate it. This should make the application easier to maintain and provide more scalability for the future when we have bunches of records instead of just the two that were there until this week. I had to jump through some hoops to get the infrastructure set up to use the XML file, but that’s another entry. Anyway, the task of reading the XML file and turning it into beans is the perfect job for unit testing. Before I write any code that uses my beans, I can populate them and make sure they work using unit tests. So far, so good. By writing an ultra-simple test harness, I’ve been able to work out all the bugs and difficulties involved with getting the libraries I’m using set up properly, putting the XML file where it needs to be, getting my build working right, and populating the beans using the data in the XML file very rapidly thanks to being able to run the unit tests as I develop. I think it has saved time so far. ...

February 7, 2003

Jeremy Allaire resigns by blog

I find it interesting that Jeremey Allaire posted his resignation notice on his blog before Macromedia could announce it officially. I have to give props to ColdFusion, while I don’t use it any more, I still appreciate the fact that it demonstrated just how simple it could be to write powerful Web applications. It breaks all of the rules about separating presentation and code, but it was created before those rules were written, and it’s absolutely great in the niche where it exists (much better than PHP as far as I’m concerned). ...

February 7, 2003

Writing your tests first

Danny O’Brien wrote an interesting and thoughtful item in response to my musing about writing code tests first.

February 7, 2003