Date: 4 October, 2006 - 02:00
This is the second part of brief summary and description raised by Bruce Tate's book Beyond Java. The first part is available here and seemed to ruffle a few feathers. Since that time, I've finished the book and plan to pass it along to a few other people from whom I'd like to hear some thoughts.
First, let me lay out my Java background. I have about five years of Java experience now. I think I timed it well as I joined the movement about the time Ant and Tomcat were catching the hearts and minds of many Java developers. I have since picked up Maven, Struts, and wading through the fun that is Hibernate and Spring.
In terms of length, I thought the book was very solid. Bruce spent a huge amount of time describing how and why Java became so popular. The summary of which is simple: Java solved many of the pains of the C++ community in a way which was familiar and powerful without being scary. He also posits that the biggest single strength of Java may not be in the language itself, but the JVM. I think I agree with this one. Sun - and the smart people around them - did something fantastic in pushing forward the idea of WORA. Sure, it's not perfect, but it set the standard incredibly high for future competition. I'm not doing justice to Bruce's explanations here, but you get the idea.
Date: 20 September, 2006 - 02:55
I have to say that I've been following the Java vs Ruby war for quite a while. Initially it started as a passing interest due to Nola Stowe's evangelism and heckling. I had a completely wrong idea of what it was and demonstrated that ignorance in this space but once I went to a presentation by Dave Thomas last year, I was convinced:
Ruby - especially because of Rails - is amazing and here to stay.
Therefore, in the past 10 months or so, I've watched technology with great interest. While the hype has been huge, there's been an even bigger warning sign for me. The sheer number of incredibly smart Java people who are picking up Rails. I don't mean that they've said "Hey, this is nifty". I mean people who have essentially dropped Java like a bad habit. There are
people like Jason Hunter (author of Java Servlet Programming), James Duncan Davidson (credited with inventing both Ant and Tomcat), Erik Hatcher (creator of Lucene and a coworker of a longtime friend), and probably more than I care to consider or admit. I've lived and breathed most of these projects since 2002 and can't help but notice that these gentlemen have been guiding lights in the community. When they make such an abrupt turn, you *must* take notice.
Date: 31 May, 2006 - 10:49
I am a log watcher. I regularly "tail -f" numerous files such as catalina.out (Tomcat), log4j.log, and apache's error and access logs. By watching these, I can monitor conditions from test or production users and see what the system is really doing. Sometimes this opens interesting windows into the system and its day to day functioning and sometimes its simply a feel good. Since I have simple notification when something really bad happens, this is mostly to monitor systems for little oddities that pop up through rigorous repeated use. No, unfortunately, I'm not a perfect developer. Occassionally bugs creep in and cause problems... smart people realize this and act accordingly.
Anyway, in the past 6 months, I've been involved in numerous aspects of projects where I've recovered and heavily modified old codebases, tweaked existing systems, or deployed completely new ones. Over the weekend, I was installing some new functionality on CodeSnipers and performed the same process. I plugged into the access and error logs and monitored Drupal's logs to see what was going on.
CodeSnipers has been online since August of 2005 with little downtime, a few upgrades, and numerous additional modules, tweaks, and creative little mods. Luckily, Drupal has exceptional error handling and rarely dumps these back to the UI, so although users have rarely been affected, I decided to delve into a few of the errors. With tweaking just a few files, cleaning up one of the customizations, and refining the spam filters*, we're down to a handful of errors each day. To resolve those last ones, I'd have to get deeper into the code and functionality than time and responsibilities allow.
The point of all of this is that logging can be your friend.... your best friend. Yes, sometimes writing this information to disk or database can slow your application down, but if you want to know exactly how it's being used, there's really no alternative. Make the time to get familiar with a few key tools like grep on the command-line and "group by", sum, and joins in sql. If you know how to parse your logs and watch for the occurance of particular errors - bugs or otherwise! - you can prioritize your efforts to resolve the most critical or annoying issues before considering any of the others. More importantly, you can often determine the exact conditions which caused the error and recreate them yourself at a later time. Better yet, if you have a collection of automated Unit or Integration Tests available, you can use the collected data to replay the process as necessary to fully exercise and evaluate the conditions to make sure it never comes back.
* If you've noticed improvement with the response time of CodeSnipers in the last few months, this is predominantly due to my spam filter tweaking. Previously we were getting upwards of 300 comments/minute at times. The new filter completely blocks an IP address for 24 hours after too much spam is received in a small window. It's still not perfect, but now I'm only seeing about 300/day. Regardless, it's nice to know we're so popular. ;)
Date: 17 March, 2006 - 11:12
Quite a while back, I was heavily involved in a Java project with a stunningly large codebase. Portions of the code were fantastic and dealt with complicated errors in impressive ways. The level of design and thought that went into the process was evident by the flow and the handling. Other portions of the code were just bad. There are numerous magic numbers, implicit understandings, and fields being misused to represent multiple things. Although my official involvement with development has ended - they brought development in house, I am still answering various questions and offering clarifications for the new development team, so I still have my hands and mind in the code. Since I'm already familiar with the codebase, I thought I would improve my refactoring skills and see what happens.
There is no intention or legal ability to release the results of this work. This is simply an exercise to sharpen and review various skills.
First, I started writing some more Unit Tests. I believe firmly that you don't have true understanding of the code until you know where it works and where it breaks. Besides, it's hard to know exactly what to expect from the code if you don't know precisely how it's supposed to work. Previously I had developed Unit Tests throughout much of the Utils sorts of classes, but now I'm moving up the stack. I don't know how far up the stack I'll end up climbing, but it's educational regardless.
Next, I've started hammering on it with PMD to get some additional metrics. I've written all about PMD before and have already used it to analyze this codebase with a specific set of rules. This time I've expanded the ruleset and added a few to experiment with the results. While Tom Copeland is often focused on reducing the size of the compiled classes, that's a secondary goal here, so if it happens, great. If not, no worries. One more note about PMD... don't ever turn on all the rulesets at once. Some of them are directly contradictory and focus on coding style as opposed to function. You'll end up following the suggestion of a warning in one place only to get a new warning recommending the opposite.
Finally, I've pulled my Refactoring books off the shelf to review. I fly through nearly anything I read and have a high retention rate but that fades over time. So every so often, I have to review this sort of stuff. Besides, as my experience and knowledge has grown in areas of different business domains, different toolsets, and different developers, I've found that I think and analyze things in new ways. Therefore every time I review, I discover something new and a new way of looking at things.
What do you do sharpen your skills? How often do you do it?
Date: 16 January, 2006 - 08:26
Or flavour if you prefer...
I was recently speaking with another developer on a customer site about merging two projects. There is a new project which overlaps quite nicely with what his project does and many of the new requirements are "nice-to-have's" on his project. It seems to make quite a bit of sense, so now all the stakeholders are evaluating this path, but something he said struck me. Paraphrasing, he said "having a second person involved will prevent me from re-architecting it so often. I jump at the flavor of the month." Don't get me wrong, I like the guy, but... Arg.
I think this goes back to Joel Spolsky's Things You Should Never Do, Part I (April, 2000) where he serves up Netscape grilled with a side of fries:
Netscape 6.0 is finally going into its first public beta. There never was a version 5.0. The last major release, version 4.0, was released almost three years ago. Three years is an awfully long time in the Internet world. During this time, Netscape sat by, helplessly, as their market share plummeted.
It's a bit smarmy of me to criticize them for waiting so long between releases. They didn't do it on purpose, now, did they?
Well, yes. They did. They did it by making the single worst strategic mistake that any software company can make: They decided to rewrite the code from scratch.
Almost every developer has been inspired to do this. The first time they start working with Design Patterns. The first time they played with Ajax. Their second project. Whenever they join an existing project and/or have to support an old project.
Before you try to grill me up, let me say that there definitely are times when code, architectures, widgets, operating systems, etc should go back to the drawing board and have some of the fundamental concepts reviewed. No matter how great a system is, without regular review, cruft, junk, and bad ideas slip in and infect the code but this must be done deliberately and with specific reasons. I'm not proud of it, but occassionally I still write temp code "because it works" with the hope of improving it later. Sometimes later actually comes...
Anyway, having a second person involved is going to disrupt how he currently does things. There will be some implicit code reviews, more questions asked, and - more importantly - someone else to coordinate with when architecture changes are desired. I believe this is one of the additional strengths of Pair Programming. Not only do the individuals push the pair along, but they also serve as a brake to slow the decision process and deflect the FOTM Syndrome..
Date: 12 January, 2006 - 10:15
With one of our biggest customers right now, I'm working on a series of SMS applications. Neither is particularly complicated, but there's been an interesting disparity between developing each of them. The first one provides special alert information to your phone. The entire system is built in Java on top of a Maven/Tomcat/Struts/Hibernate stack. The other one provides information from a major news organization directly to your phone. This is a one-file php file which parses some XML and sends the message.
I began on the Java application first just a bit before Christmas. While I don't consider myself a Java Guru, I pioneered this customer's Ant build development and testing, so I generally have a clue. Right off the bat, I jumped into Maven, Struts, and Hibernate. I understood the concept of the problem each of these systems was built to solve, so I appreciated their value and dug in. Immediately, I was hit by the sheer amount of misdirection... er... reflection involved, the obfuscated class hierarchies (not the fault of the above applicaitons), and various other oddities and structures required to track down what the underlying code was doing. This was frustrating, but I dug in and started learning about all of it.
The beginnings of it weren't too bad. Reverse engineering the class hierarchies wasn't fun (no source available), but was able to do it with some judicious use of Jad. Following the reflection and references was a whole other story. Getting an overview of how the previous developer arranged things helped quite a bit, but there has still been a relatively difficult learning curve.
Then I was asked to do a similar process in PHP. The concept was almost the same but there was a much smaller data set to use. Eight hours later, I was done. That wasn't all coding. That was tweaking the simple API, ripping apart the XML, adding logging (more than initially requested, but exactly what was finally requested), refactoring the logging into something more useful, tweaking the messages as per customer requests, adding a few other things, and deploying to production (dev was 4.3.x, prod was 5.x). All in all, quite simple... and less code than I have in my struts config file.
The comparison is hard to ignore... and then Caleb on CodeSnipers did this post showing how brain-dead simple it is to implement a Singleton in Ruby.
Is this the death knell for new Java development?



Recent comments
3 days 12 hours ago
5 days 22 hours ago
5 days 23 hours ago
1 week 1 day ago
1 week 1 day ago
1 week 1 day ago
1 week 2 days ago
1 week 3 days ago
1 week 5 days ago
2 weeks 1 day ago