Developer Coffee Mug

I need a coffee mug with all the nifty regular expression constructs on it. Especially the java character classes would be nice to have.

My Favourite Programming Font

When it comes to editing source code, Bitstream Vera Sans Mono is the one true ghod. Consolas is too fat, Courier has disturbingly many serifs. Monaco is for brainwashed Apple disciples who think using a Comic-Sans-like monospaced font is sort of hip.

More detailed reviews of programming fonts over at Coding Horror.

Scripting Happiness With Ruby’s ActiveRecord

I am currently enjoying the discovery of Ruby as a language for blazingly fast scripting database tasks. Like e.g. converting database records on the fly. The ActiveRecord module is a great help in that.

Pandora’s Box

Even a simple HTML parser library today comes with hundreds of dependent archives, adding up to a nice 4 MB download. Which should be no problem, but at home I am blessed with an ISDN connection. Is there anything as a library package management system like in Python, Perl or Ruby for Java? If anyone has seen this, let me know. If there is none, this would be the time to stand up and implement!

Eclipse And The Dreaded PermGen Space

Just a quick note for Eclipse developers: The dreaded PermGen space error might be avoided by starting the IDE with the option -vmargs -XX:PermSize=64M -XX:MaxPermSize=128M - under Linux. For Windows, the eclipse.ini settings apply. See the Eclipse Wiki for more information.

Quite Groovy

In the recent weeks, both of my co-bloggers told me independently of each other about Groovy, the new hipster language which brings the scripting goodness of dynamic languages like Ruby and Smalltalk to the JVM Sweet JVM, so I finally couldn’t resist but take a look at it. To be honest, I didn’t like its Java-like syntax from the beginning, with all the parentheses, lowerCamelCaseIdentifiers and such, but that was just because I prefer Ruby’s very lean syntax. Its concepts are very close to Ruby (modification of objects and classes at runtime, blocks/closures, etc.) and of course it integrates well with the Java platform and its rich libraries, since this is the purpose for which it was created, to add a scripting facility to the Java platform. Groovy scripts are compiled into bytecode before execution and thus run on a normal JVM.

A crucial part for dynamic languages today (at least in my eyes) is the creation of domain-specific language, which Groovy also supports. Gant, for example, is a Groovy DSL for Ant scripts. Another example (take from the Tutorial Domain-Specific Languages in Groovy, PDF) I find very practical is a DSL for creating query criteria for Hibernate in the Grails framework (formerly known as Groovy on Rails, so its purpose should be clear):

def c = Account.createCriteria()
def results = c {
  like("holderFirstName", "Fred%")
  and {
    between("balance", 500, 1000)
    eq("branch", "London")
  }
  maxResults(10)
  order("holderLastName", "desc")
}

A good thing, but looks too java-y for my taste, I miss the feeling I get when using a Ruby DSL, such as SQL-DSL, for example:

statement = Select[:column1, 'book', 10].from[:table1, :table2].where do
  equal :column1, 99
  not_equal :column1, 100
  less_than :column2, 'foo'
  less_than_or_equal :column3, :column4
  greater_than :column1, 0
  greater_than_or_equal :column2, 'bar'
  like :column1, 'any'
  is_not_null :column1
  is_in :column1, [1,2]
  is_not_in :column2, [3, 4]
  exists 0
  not_exists 0
end

But maybe that’s just personal preference.

From a few first glance I get the impression, that Groovy is quite successful as a scripting sidekick to Java and I’m curious to learn more about it.

Survey on Web Development Platforms

The software engineering folks at our institute, who hosted the Plat_Forms contest, are conducting a survey on platforms for web development. So if you are familiar with developing web applications in at least two programming languages and would like to contribute to research in this area please take the survey, it will take about 10-15 minutes.

Comparing Web Development Platforms

I would like to point you to a study a professor of my university (i.e. my workplace) did with his team. One goal, nine teams, thirty hours, three platforms - J2EE, Perl and PHP. Why they did not evaluate Ruby or Python is far out of my knowledge (and why anyone would do actually web devopment in Perl), but the setting is interesting enough. A rather lengthy report can be found here.

Update: I did not read the document thoroughly enough. The answers to my questions:

“We had some contact with potential teams from the Python arena, but there were not sufficiently many who were qualified enough. In the end, only one formal request for participation was submitted, so we did not admit Python into the contest.”
“It was impossible to find Ruby-on-Rails teams (“we are too busyâ€?). “

Learning by Testing

A while ago, Mike Clark wrote two blog postings on how to learn Ruby by writing tests (#1, #2). He explains that he wrote a test for each bit he learned about the language, over the years collecting a set of more than 200 tests which act as his personal knowledge base on the Ruby language:

Through trial and error they taught me how Ruby and its rich set of libraries really work. Not surprisingly, typing in code and running it makes you remember. Indeed, writing learning tests is a fun way to poke and prod any new language or API. And with every test you write you’re investing in an executable knowledge base.

Unfortunately I never tried this myself, but I like the idea. According to him, the benefit is twofold: The tests assist in acquiring and checking knowledge (by what he calls “asking Ruby”) and act as a knowledge base that manifests itself in code (and some documentation, where needed, I’d like to add).

Yet I am a little bit skeptical about “asking Ruby”. In his second posting, he suggests to “make a guess” in a particular case where he doesn’t know the result of a method invocation (“Rick”.index(’t')). Maybe I’m a bit hypersensitive here, but I have some reservations when it gets to using tests to find out how things (could or should) work. I’d think it would it be better to just look it up in a reference and write the test afterwards. The main reason is that using one test case (or a few) will give you one (or few) results, from which you will have to draw conclusions and generalize—the semantics of the index method in this case. What if your conclusions are wrong for some exceptional cases? Is it possible/feasible/desirable to write tests for each and every combination of parameters for a method? Why not trying a “read first” approach?

Nevertheless, the basic idea of using test cases for playing around with a language and collecting them as a reference is a nice idea. I’ll almost certainly try this the next time want to learn something about Ruby or a different language.

Between Heaven and Earth

Today I stumbled upon another source of developer wisdom, Des Traynor’s Programming Theorems. One of the theorems rings especially true for me after the recent insights into developing a Sudoku solver the TDD way:

For every Architecture Astronaut out there, there is at least one coder who thinks that being “Agile” is a perfect substitute for foresight.

If you wonder what Architecture Astronauts are, its a term coined by Joel Spolsky with regard to people climbing up the abstraction ladder a little too far:

When you go too far up, abstraction-wise, you run out of oxygen. Sometimes smart thinkers just don’t know when to stop, and they create these absurd, all-encompassing, high-level pictures of the universe that are all good and fine, but don’t actually mean anything at all. These are the people I call Architecture Astronauts.

I know that I tend to be an Architecture Astronaut sometimes, probably it’s because thinking meta keeps me from the exhausting work of bothering with all the real-world problems. I wouldn’t be surprised if this was the main reason for developers to become Architecture Astronauts at all.

But Architectural Outer Space isn’t a place where I stay very long usually, because its my experience that the lack of oxygen disrupts any attempts of getting actually something done. And that’s where agility fits in: If I get the whole idea of agility right, it’s all about getting things done (unless you use it as an excuse to shutdown your brain).

« Previous PageNext Page »