[LUNI] Linux Programming
Robert Jacobsen
rjacobsen at theocc.com
Tue Mar 12 08:09:01 CST 2002
Joel,
It's not, at least for non-scripting types of languages!
Ask any programmer who's been in the business for 15 or 20 years and
that programmer will tell you that, in many instances, this is the best way to
get your program, method or what have you, to get the job done.
I've coded in COBOL, C, C++ and Java and that construct is very useful
and, oftentimes, although another construct may be slightly more efficient, it's self
documenting. I know exactly what is to happen if a certain condition exists.
I'm not a Perl person, so I can't address that issue, but outside of scripting languages,
I don't see the big concern!
Frankly, when you get down to this level of code style nit-picking, you're focusing on
one little tree when a view of forest is all you really need!
--- RJ
"Joel F. Hacker" wrote:
> Rich...
>
> I am not a programmer, so that may help explain,
> but can you please explain why the following is bad
> structure?
>
> Thanks!
>
> Joel
>
> Hate to break it to you but...
>
> > if (true) { one-statement; }
>
> Is horrible programming style in any language.
>
> Cheers,
> Rich
>
> At 09:19 AM 3/8/2002 -0600, scott thomason wrote:
> >On Mar 08 07:58 AM, Martin Maney wrote:
> > > Pardon me for saying it, but you sure make it sound like you would be a
> > > poster child for The Problem Of Write-Only Code. :-/
> >
> >Don't get me wrong; I _almost_ always indent in a manner compatible with
> >Python. I just don't like the idea of being forced into it. Sometimes
> >I might just want to do something like:
> >
> > if (true) { one-statement; }
> >
> >...if the situation calls for it. Of course, Perl kinda shines here because
> >it supports that situation more directly by being capable of saying:
> >
> > one-statement if true;
> >
> >...without the need for the extra punctuation. But that's a topic for another
> >list, I guess.
> >---scott
> >______________________________________________________________________
> >Linux Users Of Northern Illinois - Technical Discussion
> >luni at luni.org
> >http://luni.org/mailman/listinfo/luni
>
> ______________________________________________________________________
> Linux Users Of Northern Illinois - Technical Discussion
> luni at luni.org
> http://luni.org/mailman/listinfo/luni
> ______________________________________________________________________
> Linux Users Of Northern Illinois - Technical Discussion
> luni at luni.org
> http://luni.org/mailman/listinfo/luni
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rjacobsen.vcf
Type: text/x-vcard
Size: 188 bytes
Desc: Card for Robert Jacobsen
Url : http://luni.org/pipermail/luni/attachments/20020312/538bedb6/attachment.vcf
More information about the luni
mailing list