Hi Thorbjoern,
Note: I'm not interested in a code style war and won't respond to same.
I was asked a question and here's my answer. It applies to me. Do your own
thing.
how come you comment your closing brackets?
For the same reason I comment anything, and the same reason I do a
number of code things automatically: readability, understandability (and the
efficiency that brings,) and correctness. Clearly it doesn't much matter
here, but when a classs contains lots of large methods it becomes helpful.
I also comment large if/else statements. Once you've been in braces
hell a few times, you try to prevent it. I've worked with lots of code by
lots of programmers, as we've done many projects for many clients, and
believe me, everything helps. So, you'll never see me write:
if( x )
doThis();
instead it will always be:
if( x )
{
doThis();
}
If it's not obvious why, it's because it is too easy for someone else to to
this:
if( x )
doThis();
doThat();
and wonder why doThat(); always happens. I'm sure you wouldn't, but I
guarantee someone else will. So this stuff is cheap insurance.
And yes, I line up braces for the same reason.
What I will happily discuss at length, if anyone wants to, is my theory
that all programmers should do maintenance work at least 25% (pick your
percentage) of the time. There are lots of shops that have developers and
maintenance programmers; the developers never do maintenance and
vice-versa.. Once you're forced to maintain code, it gives you a different
perspective on development.
One of the great things about an AS/400 background is that typically
shops have been so small that one was forced to work in all areas. That's a
reason why we tell clients that we can, and often do, take a project from an
idea through installation and training, or do any part. I remember being
amazed the first time I came across an RPG programmer who didn't know CL.
Joe Sam
Joe Sam Shirah -
http://www.conceptgo.com
conceptGO - Consulting/Development/Outsourcing
Java Filter Forum:
http://www.ibm.com/developerworks/java/
Just the JDBC FAQs:
http://www.jguru.com/faq/JDBC
Going International?
http://www.jguru.com/faq/I18N
Que Java400?
http://www.jguru.com/faq/Java400
----- Original Message -----
From: "Thorbjoern Ravn Andersen" <ravn@xxxxxxxxxx>
To: "Java Programming on and around the IBM i" <java400-l@xxxxxxxxxxxx>
Sent: Sunday, February 27, 2011 5:05 PM
Subject: Re: Is String.split() broken?
Den 27/02/11 18.46, Joe Sam Shirah skrev:
} // end main
} // end class xxxSplit
Regexp'es are always fun.
Out of curiosity, how come you comment your closing brackets? An
AS/400 programmer habit?
As an Amazon Associate we earn from qualifying purchases.