Post #231,733
10/31/05 3:59:22 PM
|
I'm seeing comments that "Code Complete" addresses that
and argues that your approach (open brace stays with the statement) is best.
Cheers, Scott. (Who hasn't read CC but probably should one of these days...)
|
Post #231,737
10/31/05 4:06:37 PM
|
Where?
By my recollection Code Complete is pretty neutral on the topic. Perl Best Practices, however, takes a stand, prefering my style.
Cheers, Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
|
Post #231,740
10/31/05 4:13:13 PM
|
CC2, pp 740-743
-YendorMike
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." - Benjamin Franklin, 1759 Historical Review of Pennsylvania
|
Post #231,757
10/31/05 5:28:44 PM
|
I should finish reading it then
I got bogged down in comments...
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
|
Post #231,770
10/31/05 6:45:18 PM
|
Ar
I read it like a book -- not a reference manual -- some number of months ago. As the novel progressed, I became more and more disappointed and disillusioned by what my company (at the time) was not doing correctly.
A change of company in the interim has not changed the outlook for what's being done correctly, either.
-YendorMike
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." - Benjamin Franklin, 1759 Historical Review of Pennsylvania
|
Post #231,821
11/1/05 12:03:59 AM
|
I read the first one that way, the first time
I've read the first one multiple times. I was going through the second one with a fine-toothed comb, and lost energy to continue around 11 months ago.
It wasn't the book that was at fault. :-)
Cheers, Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
|
Post #231,743
10/31/05 4:16:39 PM
|
E.g.
[link|http://www.sitepoint.com/blogs/2005/08/08/coding-style/|Here], by Noam A., ~ 2/3 of the way down. Unfortunately, the example is broken at that web site so it's not terribly clear what Noam prefers.
The CC discussion is apparently on page 734 of the 2nd edition, according to the index shown at Amazon.
A discussion on various indentation and brace styles is at [link|http://en.wikipedia.org/wiki/Indent_style#K.26R_style|WikiPedia].
My preference, with no substance behind it, is something approaching GNU Style at the moment.
FWIW. HTH.
Cheers, Scott.
|
Post #231,745
10/31/05 4:33:47 PM
|
What I see on that page:
By way of example:
K&R [image|http://www.mr-anderson.net/images/knr-csr.png||||]
BSD [image|http://www.mr-anderson.net/images/bsd-csr.png||||]
Whitesmith [image|http://www.mr-anderson.net/images/whitesmith-csr.png||||]
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #231,746
10/31/05 4:58:18 PM
10/31/05 7:25:29 PM
|
I see.
[edit:] (I didn't initially see the images at home either, but was able to on loading the URLs directly, and then on refreshing the page the images all came up. Weird...)
I remember when you first talked about your condition. It certainly is interesting! It must make your love of reading quite a challenge these days. :-(
I see why you'd prefer the BSD-style. Do you use a "code folding" mode in emacs also? I like the idea of bending stuff out of the way when I don't need it, but I wonder if it's worth the trouble.
Cheers, Scott. (Who uses the IDE editor in Borland C++ Builder 5 and UltraEdit and the built-in editor in FileCommander but hasn't done any code folding...)
|
Post #231,747
10/31/05 4:59:37 PM
|
Dunno what to tell you...
Direct links if that helps:
http://www.mr-anderson.net/images/knr-csr.png http://www.mr-anderson.net/images/bsd-csr.png http://www.mr-anderson.net/images/whitesmith-csr.png
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #231,750
10/31/05 5:10:10 PM
|
www.mr-anderson.net could not be found...
Dunno. Adblock isn't blocking anything on Z. I'll try at home after the monsters are gone.
Cheers, Scott.
|
Post #231,751
10/31/05 5:11:10 PM
|
Can you dig it?
As in: ophelia:~/Temporary peter$ dig www.mr-anderson.net\n\n; <<>> DiG 9.2.2 <<>> www.mr-anderson.net\n;; global options: printcmd\n;; Got answer:\n;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29858\n;; flags: qr; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0\n\n;; QUESTION SECTION:\n;www.mr-anderson.net. IN A\n\n;; ANSWER SECTION:\nwww.mr-anderson.net. 38400 IN A 66.80.246.91\n\n;; Query time: 12 msec\n;; SERVER: 10.200.1.50#53(10.200.1.50)\n;; WHEN: Mon Oct 31 22:10:47 2005\n;; MSG SIZE rcvd: 53
Peter [link|http://www.no2id.net/|Don't Let The Terrorists Win] [link|http://www.kuro5hin.org|There is no K5 Cabal] [link|http://guildenstern.dyndns.org|Home] Use P2P for legitimate purposes!
|
Post #231,749
10/31/05 5:06:27 PM
|
They work here. Check your browser/adblock.
Peter [link|http://www.no2id.net/|Don't Let The Terrorists Win] [link|http://www.kuro5hin.org|There is no K5 Cabal] [link|http://guildenstern.dyndns.org|Home] Use P2P for legitimate purposes!
|
Post #231,785
10/31/05 9:36:57 PM
|
For some reason reading text isn't so bad.
Most of the time the left eye just gives up and I see only ghosts. For whatever reason, code brings it to the fore.
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #231,793
10/31/05 10:15:49 PM
|
Would you be better off wearing a patch?
|
Post #231,808
10/31/05 10:56:45 PM
|
Tried that for a bit.
And while it appeals to my inner pirate, after a while I get a raging headache.
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|