Archive for December, 2006

Beautiful Web Design

If you are looking for some web design inspiration or just want to check out some beautiful web sites, then check out this link: “50 beautiful css based web design in 2006″:http://smashingmagazine.com/2006/12/19/50-beautiful-css-based-web-designs-in-2006

“I found another website showing 7 of the best designs of 2006″:http://wisdump.com/design/top-7-freshest-designs-of-2006/. These are definitely some nice designs.

Problems with Log4j

The testing team has discovered an odd problem related to Log4j. While system testing our application, they decided to delete the log file. The result was that Log4j did not create a new log file the next time there was a log request. They had to restart the application in order for Log4j to create a new file and start logging to it.

I have scoured the web to find a solution to this and have come up empty handed. I basically need a solution that configures Log4j to, when the current log file is deleted, create a new file. Anyone have any ideas?

So far my best advice has been: don’t delete the log file :-P.

Simple Spring trick - Splitting config files

The application that I am working on at work uses Spring fairly heavily for its configuration. One problem that we have is that we don’t want to expose the config file, but we need to expose the data source part of it. We are configuring Hibernate through Spring which requires us to put the data source information in the Spring config file; we needed a way to split the config file so that data source part could exist outside the jar file.

This actually proved really easy to do, trivial actually, but I will post the method for other newbies, like me, who may stumble upon this blog.

Basically, you split the file into two complete Spring configuration files and then import the one into the other. There are two keys to remember when doing this: 1) both files must be complete config xml files that validate against the Spring schema and 2) the path used when importing is relative to the parent file so the two files must be in the same directory or on the same classpath.

Here is the code to use (shortened for brevity):


  

  

There is one more rule that you must remember. You have to reference the beans in the imported file using <ref bean="bean id"/> instead of <ref local="my bean"/> because the @local@ attribute is scoped to the physical file in which it appears. Also, you need to import files before referencing any beans in the imported file (this is probably obvious though).

Simple, eh? I love Spring.

Eclipse and the hunt for soft tabs

If I want to change the default behaviour for using soft tabs–using spaces instead of tabs when I press the tab key–in NetBeans, I only need to make the change in one place. If I want to do the same in jEdit, I only need to set it once. If I want to set soft tabs in Eclipse, I need to change it all over the place.

I was working on an Ant build script today in Eclipse and wanted to change the default editor behaviour to use spaces instead of tabs. So I wandered into the Preferences section. I know the setting is not going to be under Java, so I try the General tab, no luck. Finally, I try the “Web and XML” tab. Sure enough, there is a tab for XML files under which I can set the “Indent using spaces” option and press apply.

I then go back to editing my build file and it is still using tabs. Apparently, to Eclipse, a build file is not an XML file. So back into the preferences I go. This time I see the Ant tab and am able to set it to use spaces there.

Something as fundamental to programming as the option of using Tabs or Spaces should be obvious and easy to set for every editor. This is one area that NetBeans has Eclipse beat hands down. It is very easy to set editor styles in NetBeans. Granted, Eclipse’s editor styles and setting are more powerful, but they are also incredibly complex and confusing.

Every time I go looking to set spaces instead of tabs for the Java editor, it takes me at least a half hour of searching and hunting. This is because it is not even an option. Instead, it needs to be configured via the Code Style Formatter by either creating a new style or modifying one of the default styles.

What is the saying, “Make the simple things simple and the complex things possible”? This is one area that Eclipse makes what should be an easy thing incredibly complex. i think this is Eclipse’s biggest downfall, it simply is not simple to use. Nothing is intuitive about the application. True, it is very powerful and configurable. I guess that it is why it is the number one IDE, but simple it is not.

I use Eclipse all the time, but for new programmers I always recommend NetBeans because it is simple to use and easy to start working with.

ThoughtWorks debates the term Agile

Apparently there is a bit of a “discussion going on between several ThoughtWorkers about the user of the term Agile.”:http://www.infoq.com/news/2006/12/debating-agility-at-thoughtworks It centres around the idea that Agile has become a religion and was started by Dr. Webber in a blog post in which he stated that he was an Agile Atheist. I am not going to rehash that entire discussion here as the preceding link does a much better job of this than I could; however, I would like to chime in with my two cents.

One point that is made at the end of the article is the following:

bq. If Agile religion exists, it seems to consist of a focus on strict adherence to practices without a need for understanding, combined with judgmental criticism of others - clearly ignoring the spirit of the Agile Manifesto’s “people over process,” values-driven approach. As another commenter noted: “When I refer to Agile - just the word - as you have in the title, I’m focused on the mindset, the spirit, not the practices.” There are in fact NO practices specified in the Agile Manifesto, or its accompanying list of principles.

I agree with this statement. I have seen and read far too many articles that centre solely on the practices of Agile and try to side step the principles. I read an entire marketing “article” by IBM that tried to sell Agile practices, completely ignoring the principles, in order to sell some high priced piece of software that followed those practices.

I personally don’t understand how one can implement Agile by simply borrowing its practices, that is like professing belief in a religion, but only following its observances. (Mind you, I think most religions are actually built on this principle so maybe the comparison between software development processes and religion is not that far off for.)

On one level, I have to agree that we need to remove religion, or better stated, zealotry, from computer science and software development. Discussions over why Linux is superior over Microsoft and why using open source software is the only ethical thing to do need to be put to rest. I am tired of hearing that I am less of a human for using proprietary software. Personally, I really like Microsoft Office 2007 and can’t wait till they implement it on the Mac.

On the other hand, I still consider myself a proponent of Agile and try to following its principles as much as possible. But even in my own limited experience, I have seen, that in order to follow the principles, you have to bend some of its practices. But I believe you can do this and still be doing Agile development.

Agile Question: Where is the satisfaction?

One thing that Agile promotes is the use of pair programming and, by extension, the idea that the code does not belong to anyone person, instead, it belongs to the group as a whole. I have a question regarding this; put simply, where does the satisfaction come from?

When I create software on my own, I get satisfaction from the code that i create. The more I put into the code, the more the code becomes mine and the more satisfaction I get from what I am creating. But if I am changing pair programming partners several times a week (or day) and am working on different bits of code throughout the day–none of which belongs to me–where does my satisfaction come from? Also, how do I know that I am doing a good job?

I have seen this come up in blog posts around the net (I just don’t have any links to prove it) and have seen solutions such as, “I go home and create code and get my satisfaction from it”. I am not sure that this is a very long lasting solution.

On the other hand, I have seen programmers, who get too attached to their code, take any suggestion of change to that code very personally. I have seen programmers get very upset when other people suggest there might be a bug in their code. “I programmed that component, what do you mean there’s a bug, it’s perfect, I programmed it myself!” I am sure that if everyone was honest, we have all responded this way at sometime when told of a bug in our code. I guess this is one thing that pair programming is trying to stop.