Posted on April 29, 2008 by Alan Keefer
(Note: I had been working on this post before this thread showed up on Artima today, so I figured it was an appropriate time to finish it off and publish it.)
One of Carson’s favorite phrases is to say that “syntax matters,” so I’m [...]
Filed under: Development | 19 Comments »
Posted on April 22, 2008 by Alan Keefer
I’ve had numerous conversations over the past year or so with people who aren’t that familiar with writing automated tests (be they unit tests, functional tests, or what have you), and all the advice I give can really be summed up in one simple rule:
Your tests should break if and only if the product is [...]
Filed under: Development | Tagged: testing | 6 Comments »
Posted on April 20, 2008 by Carson Gross
A few weeks ago when I was writing some java code in the GScript runtime, I came across a situation where I needed to get all the ParseWarnings on a parsed element with a given resource tag, which is the unique identifier for the type of error. Turns out I had already written the [...]
Filed under: GScript | 1 Comment »
Posted on April 17, 2008 by Alan Keefer
It’s generally accepted wisdom by now that giving client objects direct access to data stored on a class is a bad idea; it violates encapsulation, prevents you from changing implementations in interface-neutral ways, and prevents you from doing other things like lazy-computation or evaluation that might eventually prove necessary for the sake of correctness or [...]
Filed under: Code Samples, GScript | Tagged: gscript, java, ruby, python, language comparison, properties | 5 Comments »
Posted on April 12, 2008 by Alan Keefer
Continuing with the language comparison theme, I’ll look at another common list processing operation: mapping a list to another list. Say I’ve got a list of user objects and I want to turn that into a list of user names instead. Here’s how it looks in each of the languages.
Java
Using the standard [...]
Filed under: Code Samples, GScript | Tagged: gscript, java, ruby, python, language comparison | 7 Comments »
Posted on April 6, 2008 by Alan Keefer
In my spare time I’ve started to learn Python (I’m working through the most excellent, and free, Dive Into Python book). Learning other languages, and how programmers work in other languages, is something that can improve your code regardless of the language you’re programming in. And of course, it can also be fun [...]
Filed under: Code Samples, GScript | Tagged: gscript, java, language comparison, python, ruby | 3 Comments »
Posted on April 4, 2008 by Alan Keefer
There was a post by Bruce Eckel on Artima this week that asked the question of whether or not closures would make Java less verbose, so it seemed like an apt time to put this up.
People tout closures as cure-alls for all sorts of things: because they like functional programming or because it’s better suited [...]
Filed under: GScript | 8 Comments »