Email address obfuscation in effect -- please
click here to turn it off.
[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
- To: MLUG Members <EMAIL:PROTECTED>
- Subject: Re: [MLUG] Quick programming question on style
- From: Jonathan King <EMAIL:PROTECTED>
- Date: Fri, 3 Jun 2005 14:17:12 -0500
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=t1WUu5tm6dJVQA6jHV1GUy+dNgzhVFzY+KZRBtC0/O4wDS3W6iF5foxwGyAxrvKCrTil7//Q7cu1pK9aLvCZnzVs0u+GRXqT3/zH5Rsp9kkSF/QlmvCR41g58qqbjE10D9PNG7/o0moPe9D4x73DLhVh14mjVZLqK59a2l0/zWw=
- In-reply-to: <EMAIL:PROTECTED>
- References: <EMAIL:PROTECTED>
- Reply-to: Jonathan King <EMAIL:PROTECTED>, MLUG Members <EMAIL:PROTECTED>
- Sender: EMAIL:PROTECTED
On 6/3/05, McIntosh Jason <EMAIL:PROTECTED> wrote:
> Had to drop an email and ask about this.
>
> If you, as a programmer, see something like the following - is it bad, good,
> "spaghetti", ignore it, or what?
[snip goofiness; others have given it the Bronx Cheer already]
> And, here's another style question: the { on a newline after a statement or
> the end of the previous line. For example:
>
> if (testcase == 1) {
>
> or
>
> if (testcase == 1)
> {
OK, so I learned C back in...gah, 1983 I guess. And in those days of
C on a VAX 11-750 under VMS, I think I remember people preferring the
second way. But by the 90s, opinion seems to have swung resoundingly
to the first form. The reasons other people give make sense (one less
line...) but I think the initial cause could have been something
really lame, like somebody's auto-indent mode for emacs worked better,
or maybe somebody's vi wasn't smart enough to scroll back to show the
"if" part if you bounced around on the "%" key (don't hurt me if my vi
lore is wrong here).
> which is better. I learned on the second example, and I find it clearer to
> understand. However, Java for example uses the first example HEAVILY.
> Thoughts/opinions? Mostly I guess, is the first example an entirely Java
> thing, or did C ever use style like that?
Not just Java; I think Larry Wall (among others) used to insist on the
end on curly style.
jking
_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members