OG was right all along
-
Their 8-space (tab) indentation is worse. Despicable, in fact.
Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing.Greg Utas wrote:
Despicable, in fact
The word 'despicable' is a moral judgment. Given that they invented the brace style at the same time they invented the C programming language, and tabs were 8 spaces wide because of teletypes and other such hardware, a little bit of understanding might be in order.
Software Zen:
delete this;
-
Ah, it's been so long since we had a braces war ;) Allman style is awesome, K&R is fugly X| But I like Python even better, where indentation determines scope.
Cheers, Vikram.
Vikram A Punathambekar wrote:
I like Python even better, where indentation determines scope
You just like to sit back and watch the world burn, don't you? :-D
Software Zen:
delete this;
-
At least I think I'm referring to OG. I vaguely recall defending the K&R indentation style with OG pointing me why he thought Allman to be better. A handful of years later and several projects where Allman style was mandated by coding rules it actually became my new indentation style, mostly for the reasons OG pointed to me (easier to see the nesting level of constructs, better block separation, easier manipulation of the condition statement regardless of the operation done in the block).
GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
Allman braces are morally, ethically, and spiritually superior to any other brace style, including K&R.
Software Zen:
delete this;
-
Greg Utas wrote:
Despicable, in fact
The word 'despicable' is a moral judgment. Given that they invented the brace style at the same time they invented the C programming language, and tabs were 8 spaces wide because of teletypes and other such hardware, a little bit of understanding might be in order.
Software Zen:
delete this;
I've been known to indulge in hyperbole.
Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing. -
I've been known to indulge in hyperbole.
Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing.I prefer parabole myself, but toe-may-toe, toe-mah-toe... :laugh:
Software Zen:
delete this;
-
I don't remember the last time I printed code off! My guess would be 1999. :laugh:
Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing.I don't print my code, but I've printed inherited code on 11x17 paper with narrow margins, as I had to physically diagram it to figure out what it was doing ... 9 sheets in portrait mode using Courier 9 point. In some cultures, a test of worthiness is going into battle. In IT? It's figuring out inherited code.
-
It WAS Griff, and me! But methinks he was advocating Whitesmith's Indentation style - Wikipedia[^]
if(this->aintUgly())
{
thenWhatIs(); // ??
}"If we don't change direction, we'll end up where we're going"
-
At least I think I'm referring to OG. I vaguely recall defending the K&R indentation style with OG pointing me why he thought Allman to be better. A handful of years later and several projects where Allman style was mandated by coding rules it actually became my new indentation style, mostly for the reasons OG pointed to me (easier to see the nesting level of constructs, better block separation, easier manipulation of the condition statement regardless of the operation done in the block).
GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
-
I don't print my code, but I've printed inherited code on 11x17 paper with narrow margins, as I had to physically diagram it to figure out what it was doing ... 9 sheets in portrait mode using Courier 9 point. In some cultures, a test of worthiness is going into battle. In IT? It's figuring out inherited code.
Quote:
I had to physically diagram it to figure out what it was doing
What happened to the original author?! That should have been job security! If I inherited that code, I'd have him renditioned and put under bright lights until that code got explained. :-D
Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing. -
Notes where, on your fanfold printout?! :laugh:
Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing. -
You'd miss tp as well if it were gone.
Wrong is evil and must be defeated. - Jeff Ello
-
At least I think I'm referring to OG. I vaguely recall defending the K&R indentation style with OG pointing me why he thought Allman to be better. A handful of years later and several projects where Allman style was mandated by coding rules it actually became my new indentation style, mostly for the reasons OG pointed to me (easier to see the nesting level of constructs, better block separation, easier manipulation of the condition statement regardless of the operation done in the block).
GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
OMG, I had to lookup Allman style to confirm... My argument was ALWAYS that we line these things up so they can be matched properly. And I believe the blank space adds context. void main / if / while -> all have the same simple formatting { // Yes this is good } and doubly hated the dual indentation: if () { // then this } REALLY hated: if () { // Same level, Uggh } So, welcome aboard. it just seems more consistent, and since I do a TON of Pascal/Delphi and PL/SQL, etc, etc. Where I would strangle someone for: if () BEGIN // OMG END
-
Vikram A Punathambekar wrote:
I like Python even better, where indentation determines scope
You just like to sit back and watch the world burn, don't you? :-D
Software Zen:
delete this;
Haha, I do, but in this case I am serious, I like this Python feature.
Cheers, Vikram.
-
Haha, I do, but in this case I am serious, I like this Python feature.
Cheers, Vikram.
The notion of significant white-space gives me PTSD-flashbacks to my FORTRAN days :rolleyes:
Software Zen:
delete this;
-
At least I think I'm referring to OG. I vaguely recall defending the K&R indentation style with OG pointing me why he thought Allman to be better. A handful of years later and several projects where Allman style was mandated by coding rules it actually became my new indentation style, mostly for the reasons OG pointed to me (easier to see the nesting level of constructs, better block separation, easier manipulation of the condition statement regardless of the operation done in the block).
GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
Might have been me under an old account. I remember vehemently defending Allman a couple of years back, after deep diving a few enormous legacy codebases for a consultancy gig. The speed at which I can parse large volumes of code when it's Allman is much higher, all because of the visual clues that are tied in with the control logic. I'm mostly scanning the control logic by identation, only sparsly reading evaluations along the way.
-
Quote:
I had to physically diagram it to figure out what it was doing
What happened to the original author?! That should have been job security! If I inherited that code, I'd have him renditioned and put under bright lights until that code got explained. :-D
Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing.Greg Utas wrote:
What happened to the original author?! That should have been job security! If I inherited that code, I'd have him renditioned and put under bright lights until that code got explained.
Dead men don't tell tales ... He retired then died a week later.
-
Greg Utas wrote:
What happened to the original author?! That should have been job security! If I inherited that code, I'd have him renditioned and put under bright lights until that code got explained.
Dead men don't tell tales ... He retired then died a week later.
I actually wondered if that might be the explanation. :rose: My guess is that code evolved many times, with no one having the inclination to restructure it.
Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing. -
At least I think I'm referring to OG. I vaguely recall defending the K&R indentation style with OG pointing me why he thought Allman to be better. A handful of years later and several projects where Allman style was mandated by coding rules it actually became my new indentation style, mostly for the reasons OG pointed to me (easier to see the nesting level of constructs, better block separation, easier manipulation of the condition statement regardless of the operation done in the block).
GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
For me the only style is the "one true brace style" Allman makes sense for non-braced languages, though (like python).