Tuesday, August 21, 2007

Ruby and Groovy

Nowadays you hear people talking about the languages Ruby (especially when it's 'On Rails') and Groovy as if it they are the next Java, .NET or PHP. My feeling says this is not the case, but still I have to investigate more before being sure and actually knowing all the differences. For starters, it might be good to summarize the terms.

Super clean object-oriented programming language, it combines the best of both Smalltalk and Python.

Ruby on Rails
This is a framework for Ruby. People are really crazy about this. They state that you can develop a database driven web application ten times faster than it would take with a typical Java framework - without making sacrifices. This is possible because full advantage is taken of the combination of Ruby with the "less software and convention over configuration" paradigm. Code is clean and simple and there's no or less configuration to be done, Rails uses reflection and discovery instead.

JRuby is a 100% pure-Java implementation of the Ruby programming language. Almost complete support for all Ruby constructs work, and the idea is that you should be able to just use your Ruby scripts with JRuby instead of MRI (Matz' Ruby Implementation, the original Ruby, written in C). By leveraging Java the platform with the power of the Ruby programming language, programmers get the best from both worlds. JRuby can't do everything that MRI can, some of these limitations are due to basic constraints in the Java platform.

JRuby on Rails
As it seems that there are still some concerns with Ruby on Rails (e.g. security), JRuby on rails might be a mixed solution. It takes the best from the Java domain and the Ruby on Rails domain.

Object Oriented scripting language that runs as bytecode on a Java virtual machine. Very simular to Java, but with some extras like closures and native syntax for lists and maps. Some say that Groovy is like Java combined with Ruby and Python.

Grails aims to bring the "coding by convention" paradigm to Groovy . It's an open-source web application framework that leverages the Groovy language and complements Java Web development. You can use Grails as a standalone development environment that hides all configuration details or integrate your Java business logic.

Ruby = Basic?

Haha, I just had a laugh when opening the Ruby homepage. It shows some code that prints out a text on the display:

# The famous Hello World
# program is trivial in
# Ruby. You don't need:
# * a "main" method
# * newline escapes
# * semicolons
# Here's the code:
puts "Hello World!"

This reminded me of my first programming experience on a homemade computer (early 80's), which was a line of code in a programming language called BASIC. It must have been something like:
print "hello"
Which also had no "main" method and also did not need semicolons and newline escapes.. Later, I had a look at the 20 minutes introduction to Ruby. There I read that you could simply move up the cursor and change a line of code in the 'IRB' (the Ruby shell) - just like in BASIC.

So, after over 20 years, we're back to BASIC! :-)

Monday, August 20, 2007

Code auditing tools

This is a list of popular code testing tools. Most of them are free and can be plugged-in to your development and/or build tool.
PMD (free)
The abbreviation PMD does not mean anything but the tool helps scan for problems in your sources, like bugs, dead code, suboptimal code, overcomplicated expressions and duplicate code.
Checkstyle (free)
Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. It automates the process of checking Java code to spare humans of this boring (but important) task. This makes it ideal for projects that want to enforce a coding standard.
Dependometer (free)
Java-based analysis tool for Java projects. Calculates metrics described by authors like Robert C. Martin, Craig Larman and John Lakos. Analyzes dependencies and detects cycles. Verifies the logical architecture against the physical implementation.
Findbugs (free)
A program which uses static analysis to look for bugs in Java code.
Simian (commercial)
Duplicate code checker.

Sunday, August 19, 2007

List of (continuous) build related tools

The following list contains build tools that come in handy for Java developers. There are so many tools that I should make a comparison matrix. Most of them are open source or free, some do a lot and some a little, some are easy to work with and some make you crazy..
Team City (commercial product) seems to be the rising star in the build world, so give that one a good look.
Dependency management tool (Apache).
When you are using 3d party components (be it open source or commercial) chances are that these components themselves need other components and things can get complicated. Ivy helps managing these dependencies and keeping things simple.
Deployment framework (HP).
SmartFrog is a software framework for helping to build distributed, component-based software systems in a way that makes them easy to configure, automatically install and start, and automatically shut down.
Project management and comprehension tool (Apache).
With Maven you can manage projects by creating automated builds, documentation and code test/metrics. The latest has improved dependency management.
Java-based build tool (Apache).
Although some say that Ant has been replaced by Maven, some argue that for some stuff Ant is still the way to go.
Cruise control
Framework for a continuous build process (Sourceforge).
It includes, but is not limited to, plugins for email notification, Ant, and various source control tools. A web interface is provided to view the details of the current and previous builds. The authors stress the need for continuous and automated builds, running many times a day so that integration problems are reduced.
Maven Continuum
Continuum is a continuous integration server for building Java based projects (Apache).
Continuum is a continous integration server that will ensure the health of your code base.
Build automation and management tool (Javaforge).
Continuous Integration or nightly builds can be easily set using a clean web interface. Executed builds are well managed using functions such as search, categorization, promotion, patching, deletion, etc. It also acts as a central build artifacts repository and download area for your whole team.
Build Management Server (Urbancode).
Open Source build management product that uses Ant, now also has a commercial brother.
Team City
Server-based continuous build tool (Jetbrains).
Some sort of super continuous build tool, compared to the above. It includes more management and communication features. Remarkable other features:
- remote build (developers gain time)
- delayed check in (broken code cannot be checked in)
- project dashboard
- code quality checking

Saturday, August 18, 2007

JSR Overview

On this site you'll find an overview of all Java Specification Requests. This might come in handy when you meet someone who is talking about JSR 163 and you don't dare asking what it is about.

Friday, August 17, 2007

Interface 21 Java meet-up in Amsterdam, 21 sept

Interface 21 is hosting another Java meet-up in Amsterdam, see, at (how nice) the 21st of Sept. See Alef Arendsen his blog for more details.