Last minute geek

last minute tech news from around the net

Monday, Sep 25th

Last update01:00:00 AM

You are here: English WTF Representative Line: Groovy Typing, Man

Representative Line: Groovy Typing, Man

User Rating: / 0
PoorBest 

Groovy was one of those programming languages that spent about six months as the trendy language du jour, and I haven’t heard much about it since. If I were to learn it, I’d want to learn by example- going through real-world Groovy code and seeing how it works.

An anonymous submitter has provided one sample for me to learn from:

List<String> items = new ArrayList<String>(Arrays.asList(data.split(",")))
String itemOne = items[2].toString()

It reminds me of those Family Circus comics where little Billy would wander the entire city to get from the front yard to the back yard.

It does indeed. And certainly, the type conversions are definitely the long way around: String -> String[] -> List<String> -> String -> String. But more than anything else, it’s the second statement that really gets me.

String itemOne = items[2].toString()


[Advertisement] BuildMaster integrates with an ever-growing list of tools to automate and facilitate everything from continuous integration to database change scripts to production deployments. Interested? Learn more about BuildMaster!

Read all
Comment Policy:
We pre-moderate any comments and welcome all kinds of thoughts, supportive, dissenting, critical or otherwise. We delete or censor comments that are:

* abusive
* off-topic
* contain personal attacks, or against any company or organization
* promote hate of any kind
* use excessively foul language
* is blatantly spam or advertising

We do not discriminate based on the person who is posting, and we never censor comments for political or ideological reasons. We never delete an appropriate comment because we disagree with its viewpoint or ideology, and we never publish an inappropriate comment because we agree with or support its viewpoint or ideology.


Attention spammers: we manually approve all comments. Spamming and blatant advertising will NOT be published on this site and is deleted immediately, you've been warned, do not waste your time here.

Add comment

Security code
Refresh