• Peter (unregistered) in reply to David Wolever

    The thing is that it's a noun, not a verb.

  • (cs) in reply to foxyshadis
    foxyshadis:
    Gene Wirchenko:

    Sincerely,

    Gene Wirchenko


    I'm beginning to think you do that just to piss Dick Nixon off.

    Something I can always get behind.


    I have been signing posts like that since I first got on the Net ten years ago.

    Sincerely,

    Gene Wirchenko

  • (cs) in reply to Gene Wirchenko
    Gene Wirchenko:
    foxyshadis:
    Gene Wirchenko:

    Sincerely,

    Gene Wirchenko


    I'm beginning to think you do that just to piss Dick Nixon off.

    Something I can always get behind.


    I have been signing posts like that since I first got on the Net ten years ago.

    Sincerely,

    Gene Wirchenko



    I came up with all the ideas for Sesame Street.

    Sincerely,

    Richard Nixon
  • (cs) in reply to Gene Wirchenko
    Gene Wirchenko:
    foxyshadis:
    Gene Wirchenko:

    Sincerely,

    Gene Wirchenko


    I'm beginning to think you do that just to piss Dick Nixon off.

    Something I can always get behind.


    I have been signing posts like that since I first got on the Net ten years ago.

    Sincerely,

    Gene Wirchenko



    Pissing off Dick Nixon is just gravy.
  • (cs) in reply to Mung Kee
    Mung Kee:
    To add to this, easily read code is much more about proper indentation than it is curly braces and keywords.

    Which is why my code looks like this

    class MyClass(object):
        def __init__(self):
            self.foo = "bar"
        def getBaz(self):
            """ MyClass.baz getter
            """
            return "Baz"+self.foo
        baz = property(getBaz)
    

    thingie = MyClass() for i in xrange(20): print thingie.baz

    No useless braces, no useless keywords...

    rogthefrog:
    I find it hilarious that folks who advocate putting the opening brace on the same line because it saves vertical space almost always use 4-space or 8-space tabs, thereby wasting horizontal space. They also tend to put braces around single-statement blocks, like so
    • I don't advocate whatever you want with braces, since I advocate no braces at all
    • A standard console screen has 80 columns and 20 lines, my favorite text editor (SciTE) on my current screen (19" 1280*1024 LCD) can display 54 lines and 174 columns, I code with the least possible levels of indentations (8 as a hard cap but for very specific issues)... Using 2spaces indents hinders the readability of my code without any gain, few other things to it

    2spaces can go fuck itself.

  • (cs) in reply to masklinn
    masklinn:
    2spaces can go fuck itself.


    this is f-in hilarious
  • (cs) in reply to rogthefrog
    rogthefrog:

    if (wtf) {
      ++lol;
    }

    instead of

    if (wtf)
      ++lol;


    if (wtf) { ++lol; }

    is my personal preference.  It's legal in Java (and other languages which require braces) and it saves vertical space.
  • (cs) in reply to Ytram
    Ytram:

    Mung Kee:
    Amen.  4!  No more, no less.

    I agree.  Although, if I had to choose between more or less, I would definitely pick more.  I used to work with a guy that used 2-space tabs and his code was completely  unreadable.

    [image]



    Whenever I deal with XML, my fingers automatically type out ":set shiftwidth=2", but code is definitely done with 4.
  • (cs) in reply to rogthefrog
    rogthefrog:

    I find it hilarious that folks who advocate putting the opening brace on the same line because it saves vertical space almost always use 4-space or 8-space tabs, thereby wasting horizontal space.


    Generally I don't need to preserve horizontal space.  Why would I sacrifice readability to preserve a resource that isn't scarce?  However, when I see more of the method on one screen, I can more quickly comprehend the code.

    Now, If I was using a 40 column display your argument might have merit...
  • (cs) in reply to Maurits
    Maurits:
    rogthefrog:

    if (wtf) {
      ++lol;
    }

    instead of

    if (wtf)
      ++lol;


    if (wtf) { ++lol; }

    is my personal preference.  It's legal in Java (and other languages which require braces) and it saves vertical space.

    Just for your personal culture, it's also valid in languages that don't use braces.

    Python example:

    if wtf: lol+=1

    Ruby example:

    lol+=1 if wtf

    And you get rid of the parenthesis on top of the braces and semicolon, AND the code looks like plain english.

  • (cs) in reply to Maurits
    Maurits:
    rogthefrog:

    if (wtf) {
      ++lol;
    }

    instead of

    if (wtf)
      ++lol;


    if (wtf) { ++lol; }

    is my personal preference.  It's legal in Java (and other languages which require braces) and it saves vertical space.


    I wholeheartedly agree, provide the body of the block is fairl trivial or corresponds to a well known idiom.  I won't do this with important logic.
  • (cs) in reply to Mung Kee
    Mung Kee:
    Gene Wirchenko:
    foxyshadis:
    Gene Wirchenko:

    Sincerely,

    Gene Wirchenko


    I'm beginning to think you do that just to piss Dick Nixon off.

    Something I can always get behind.


    I have been signing posts like that since I first got on the Net ten years ago.

    Sincerely,

    Gene Wirchenko



    Pissing off Dick Nixon is just gravy.


    Et tu, Brute?

    Sincerely,

    Richard Nixon

    <img src="/emoticons/emotion-33.gif">

  • (cs) in reply to ColdPie

    Anonymous:

    Why does the CAPTCHA always fail on the first try?

    If that was the only problem this forum had... <sigh>

    HEY! My "delete key" now functions! WOOOHAAAA!

    <damned, promised myself not to post again to boycott this forum until it is fixed>

  • (cs) in reply to masklinn
    masklinn:
    • A standard console screen has 80 columns and 20 lines, my favorite text editor (SciTE) on my current screen (19" 1280*1024 LCD) can display 54 lines and 174 columns, I code with the least possible levels of indentations (8 as a hard cap but for very specific issues)... Using 2spaces indents hinders the readability of my code without any gain, few other things to it

    2spaces can go fuck itself.



    If you still go by what standard console screens require, you should be using an amber CRT screen at 640x480 with no GUIs. That's a non-argument if I ever saw one.

    Since you use SciTE (which I use as well), you can turn on the whitespace and indent lines. The editor uses very unobtrusive glyphs for the whitespace, and the indentation is very easy to follow, even set at 2 spaces.
  • (cs) in reply to Maurits
    Maurits:
    rogthefrog:

    if (wtf) {
      ++lol;
    }

    instead of

    if (wtf)
      ++lol;


    if (wtf) { ++lol; }

    is my personal preference.  It's legal in Java (and other languages which require braces) and it saves vertical space.


    Actually, the optimal space saver would be

    lol+=wtf?1:0;

  • (cs) in reply to RevMike
    RevMike:
    rogthefrog:

    I find it hilarious that folks who advocate putting the opening brace on the same line because it saves vertical space almost always use 4-space or 8-space tabs, thereby wasting horizontal space.


    Generally I don't need to preserve horizontal space.  Why would I sacrifice readability to preserve a resource that isn't scarce?  However, when I see more of the method on one screen, I can more quickly comprehend the code.

    Now, If I was using a 40 column display your argument might have merit...


    Except I'm not advocating saving horizontal space either. I was just pointing out that people who claim putting an opening brace on its own line is bad because it wastes (vertical) space still often waste (horizontal) space by using large indents. I.e. the wasting space argument is not particularly consistent.

    Another inconsistency in the opening-brace-on-same-line argument is that I haven't seen anybody advocate putting the closing brace on the same line as the last statement, like so:

    if (myIndent.sucks()) {
      System.out.println("My indent sucks");
      System.exit(1); }

    instead of the standard

    if (myIndent.sucks()) {

      System.out.println("My indent sucks");

      System.exit(1);
    }

    Mung Kee claims the braces are essentially pointless for readability, and that it's all about indentation and not wasting vertical space for braces. If that's true, then you should close your braces on the same line as the last statement. Otherwise, the argument makes so sense whatsoever.

  • (cs) in reply to rogthefrog
    rogthefrog:
    Another inconsistency in the opening-brace-on-same-line argument is that I haven't seen anybody advocate putting the closing brace on the same line as the last statement, like so:

    if (myIndent.sucks()) {

      System.out.println("My indent sucks");

      System.exit(1); }


    instead of the standard


    if (myIndent.sucks()) {

      System.out.println("My indent sucks");

      System.exit(1);

    }


    Mung Kee claims the braces are essentially pointless for readability, and that it's all about indentation and not wasting vertical space for braces. If that's true, then you should close your braces on the same line as the last statement. Otherwise, the argument makes so sense whatsoever.



    I hate arguing religious issues, but that's spurious nonsense -- the closing brace provides the indent-level match, which is a definite aid to readability. The opening brace adds nothing but an extra line, since the indent level is already provided by the statement preceding it. I write K&R generally because I'm an old fart who's set in his ways, but I can work with any of them. Just not on a 640x480 or 24 line, 80 column monitor (remember when VGA was a huge leap in display technology?).


    Kids today. They don't know how good they've got it.

  • (cs) in reply to rogthefrog
    rogthefrog:
    RevMike:
    rogthefrog:

    I find it hilarious that folks who advocate putting the opening brace on the same line because it saves vertical space almost always use 4-space or 8-space tabs, thereby wasting horizontal space.


    Generally I don't need to preserve horizontal space.  Why would I sacrifice readability to preserve a resource that isn't scarce?  However, when I see more of the method on one screen, I can more quickly comprehend the code.

    Now, If I was using a 40 column display your argument might have merit...


    Except I'm not advocating saving horizontal space either. I was just pointing out that people who claim putting an opening brace on its own line is bad because it wastes (vertical) space still often waste (horizontal) space by using large indents. I.e. the wasting space argument is not particularly consistent.

    The point RevMike tried to make (but you kinda whooshed past it) was that you only save a scarce resource, there is no point in saving something you have plenty of... aka you'll try to save (and optimize usage of) sunlight in the Grönland, but you won't even try to save on ice usage. Similarly, you'll try to save on water consumption in the Sahara but probably won't give a damn about the sunlight usage.

    Horizontal space is a resource that most screens are plentiful in, the regular 4/3 has room for twice the characters horizontally as it has vertically (with most fonts) and i'm not even talking about widescreen types here.

    Vertical space is a scarce resource, as I said 1280*1024 I merely get 50 lines with a very stripped down editor while i get more than 150 characters horizontally.

    There is no point in saving horizontal space since you have more than enough, there is a point in saving vertical space (to an extend).

  • (cs) in reply to rogthefrog

    Curly brace on same line
    I can see more of the code in one screenful without losing readability
    I can scan up from the closing brace to see what it corresponds too
    Exception -- if a method has more parameters than are easily viewable in one line

    Always use braces, even if there's only one line in the body
    Consistency -- no matter how many lines are in the body my constructs always looks the same
    If I need to add or remove lines later, it's easy and all I have to do is add or remove lines

    Tab size = 2
    I can see more of the code in one screenful without losing readability
    If you are using real tabs instead of spaces, everyone can have it their way

     

  • (cs) in reply to rogthefrog
    rogthefrog:

    Except I'm not advocating saving horizontal space either. I was just pointing out that people who claim putting an opening brace on its own line is bad because it wastes (vertical) space still often waste (horizontal) space by using large indents. I.e. the wasting space argument is not particularly consistent.


    That is irrelevant. You're arguing that it's silly to be conservative with your apples if you're going to eat your oranges without any thought of conservation.

    I remain unconvinced of your point.

    Sincerely,

    Richard Nixon

  • (cs) in reply to rogthefrog
    rogthefrog:
    Mung Kee claims the braces are essentially pointless for readability, and that it's all about indentation and not wasting vertical space for braces.


    Totally misquoted.  I meant what I said, not what you perceived.  If you're going to refer to my comments, get them straight.  See my quote from a previous post below.

    Mung Kee:

    readability is more about indentation than vertical spacing or curly braces.


    Notice I didn't say it's "solely" about indentation. 

    Mung Kee:

    My argument is that all I have to do is find the character that's in the same vertical line.  If the indentation is consistent, I don't care if it's curly brace or a letter.


    The implication here is that the closing curly brace is as important as ever, since it is used to line up the first character of the scope block.  It's the open curly brace that doesn't matter.  Take your example for instance.  In the "standard" you mention in the second if statement, the closing curly brace is lined up with the "i" in "if".  That is precisely the point I was making.  The "open scope marker", the "i" in "if" in this case, doesn't need to be an open curly brace, so why give it it's own line?  You line the close curly brace up with the "i" and you have your scope.  As I also said in a previous post, mentally processing this would actually be <marginally> faster since your brain doesn't care what character it is that opens the scope, so long as it falls in the same vertical line.


  • (cs) in reply to Stan Rogers
    Stan Rogers:
    Just not on a 640x480 or 24 line, 80 column monitor (remember when VGA was a huge leap in display technology?).

    Kids today. They don't know how good they've got it.



    Actually I remember those days. Two colors, 24 lines, 80 columns, no mice, very limited usability. Linux today is almost as good!

  • (cs) in reply to rogthefrog
    rogthefrog:

    I was going to comment on that return statement but then I ran into the famed WTF that you can't edit your posts. It didn't seem to deserve a new message.

    Now - no torture is strong ENOUGH punishment for that horrid brace style. It's so bad I wrote a script to reformat a coworker's code I had to maintain so I could spend my time reading the code instead of hunting for that FRICKIN' opening brace.

    Then you must be blind. It's very clearly at the end of the statement that beings the block, which is the first statement at a lesser indentation level.

    Frankly, I don't care where the brace is as long as the code is indented properly and all if, else, while, for and do expressions use braces instead of single statements.

    I also like Python, in which the block open character must occur at the end of the previous line, and code doesn't work if it's not indented properly.

  • php programmer (unregistered) in reply to Omnifarious

    Personally I prefer keeping my opening brackets on the line that is responsible for the code block

    while (someCondition) {
    __doThis();
    __doThat();
    }
    continueOn();

    just works for my eyes better.  I am sure its 99% percent personal preference.  As for all the people who got so upset over someone using 8 character indents, why would your first assumption be they are hard coding 8 spaces?  Its notepad, its 1 tab...even if they liked large indents, I'd rather they use 8 via a single tab, than drop 4 spaces in with the spacebar.

    Anyway, all this bracket fighting is killing the love - can't we call come together and ridicule Jed's code as one?  I mean, thats a guy who managed to take exception handling's lovely "no cost when not used" methodology and actually track every single possble exception throwing condition long after it was obvious the function would never execute, even though he would never report any specifics about all the errors - then of course screw up on actually reporting the errors. 

    And here we are bickering over brackets, its things like this that made Baby Jesus cry.   :(

  • Bud (unregistered)
    ~ all 250+ opening curly braces being moved to the same line as the method/if/while statement ~.

    Honestly, who gives a flip about formatting? Any developer worth his/her salt will use a tool to do all the formatting automatically (this also allows a department to standardize on the formatting conventions very easily, too). Anyone who still aligns code by hand is about at the level of a 5cr!pt k!ddi3 in terms of skillz and wasted time.

    Your boy “Jim” is definitely a WTFer for wasting time reformatting the code—and getting paid cash to waste time like that, too!

    As for the other part, definitely a WTF.

  • (cs) in reply to rogthefrog

    rogthefrog:
    Stan Rogers:
    Just not on a 640x480 or 24 line, 80 column monitor (remember when VGA was a huge leap in display technology?).

    Kids today. They don't know how good they've got it.


    Actually I remember those days. Two colors, 24 lines, 80 columns, no mice, very limited usability. Linux today is almost as good!

    I recall even smaller screens... writing BASIC on a C64.. 25x40 screensize. But then again - I had 16 colors.

    [pi]

  • (cs) in reply to php programmer
    Anonymous:
    Anyway, all this bracket fighting is killing the love - can't we call come together and ridicule Jed's code as one?  I mean, thats a guy who managed to take exception handling's lovely "no cost when not used" methodology and actually track every single possble exception throwing condition long after it was obvious the function would never execute, even though he would never report any specifics about all the errors - then of course screw up on actually reporting the errors. 

    The One True Brace Style War has been going on ever since braces were used for the first time in a programming language. It probably won't stop before C, C++, Java and C# are all dead.

    The sooner the better, if you want my take on it

    Oh BTW the so called "windows indent style" is actually Whitesmiths, from a PDP-11 C compiler, and the most fucked up style is probably the GNU one (Lisp syntax is already tough in Lisp, but writing Lisp in C/C++ is quite fucked up)

  • (cs) in reply to masklinn
    masklinn:
    Anonymous:
    Anyway, all this bracket fighting is killing the love - can't we call come together and ridicule Jed's code as one?  I mean, thats a guy who managed to take exception handling's lovely "no cost when not used" methodology and actually track every single possble exception throwing condition long after it was obvious the function would never execute, even though he would never report any specifics about all the errors - then of course screw up on actually reporting the errors. 

    The One True Brace Style War has been going on ever since braces were used for the first time in a programming language. It probably won't stop before C, C++, Java and C# are all dead.

    The sooner the better, if you want my take on it

    Oh BTW the so called "windows indent style" is actually Whitesmiths, from a PDP-11 C compiler, and the most fucked up style is probably the GNU one (Lisp syntax is already tough in Lisp, but writing Lisp in C/C++ is quite fucked up)



    I beg to differ.  Pico is pretty f-ed up.
  • (cs) in reply to php programmer

    I should have known I'd generate such passion for asking this question. I don't know whether to laugh or apologize. :-)

    masklinn:
    The <FONT color=#246398>One True Brace Style War</FONT> has been going on ever since braces were used for the first time in a programming language. It probably won't stop before C, C++, Java and C# are all dead.

    And I should have known Wikipedia would have an article on this. Thanks! ("Whitesmiths style"? That's interesting. I discovered it in Durant, Carlson & Yao(1988).)

    Let me try to explain why I like this format so much:

    poNode = DOMNodePathToHandle (pszNodePath);
     
    if (!poNode)
        {return DOMNodeUnk;
        }
    else
        {
        eOldType = poNode->GetType();
        eRet = poNode->SetType(eNewType);
        return eOldType;
        }

    First, I see a compound statement as consisting of the keyword, conditional, and block. The block is a package of statements that are subordinate to the keyword & conditional - their child, almost. So it makes sense to me that it should be set off visually with the curly braces, and that the curlies should line up with each other. In BSD style they are aligned, but then the text in the block is sitting out there in whitespace all alone. When I scan code like that, it's harder to make the connection between the block & the statement that controls it. In Whitesmith style at least the curlies line up & tie the block visually to the conditional. Also, if you run your eye down the left side of a block, you see at a glance what kind of statements make up the block. In this case, an assignment, if, and else. Without the curly braces sitting next to the if, else, while, etc., they stick out prominently.

    BTW, as for taking up less space, sometimes if the block is 1 stmt long I'll put it immediately after the opening curly.

    anonymous:
    And here we are bickering over brackets, its things like this that made Baby Jesus cry.   :(

    Well gee, I'm just happy to see that I'm not the only one who uses this style anymore. Group hug! [:D]

    (I guess I won't ask if anyone else prefixes their function parameters with "p_"... [8-)])

  • Htomathas (unregistered) in reply to pjsson

    Amen :-)

  • (cs) in reply to Jenny Simonds
    Jenny Simonds:

    (I guess I won't ask if anyone else prefixes their function parameters with "p_"... [8-)])



    Useless hungarian at its best [:)]
  • Sean (unregistered)

    hahahha.. I work with a similar person, if only I could describe the hundreds of "WONDERFUL" ideas he has... some people can be such asses. [Y]

  • (cs) in reply to Jenny Simonds
    Jenny Simonds:

    (I guess I won't ask if anyone else prefixes their function parameters with "p_"... [8-)])



    Nope, I prefix my function parameters with a_, because that is what our @$#%%$*^%#^@% coding standard requires.    At least for c++ the standard works and and is consistent, even if sometimes annoying. 

    Don't get me started on our python coding standards.    Suffice to say that there is a section on how to format switch/case  (python does not support switch/case), and many other area where it is clear the cheif programmer has never worked with the python community, nor did he care.  

    Thankfully the author of the above WTFs is no longer here.
  • (cs) in reply to Jenny Simonds
    Jenny Simonds:

    poNode = DOMNodePathToHandle (pszNodePath);
     
    if (!poNode)
        {return DOMNodeUnk;
        }
    else
        {
        eOldType = poNode->GetType();
        eRet = poNode->SetType(eNewType);
        return eOldType;
        }

    Yuck.  I've never seen that until and hope I never do again.  That is making baby Jesus cry because his eyes are hurting so bad trying to read it.[;)]

    if  ( !poNode ) {
       return DOMNodeUnk;
    } else {
       eOldType = poNode->GetType();
       eRet = poNode->SetType(eNewType);
       return eOldType;
    }

    Ahh.  Much better

    I forgot to mention I consider a space before and after the paranethesis on if/while/for mandatory.

    I also detest not having the two braces on the else and else on the same line.

  • smithy953 (unregistered)

    its te start up for atitd.com u fools

  • (cs) in reply to Mung Kee

    Mung Kee:
    My argument is that all I have to do is find the character that's in the same vertical line.  If the indentation is consistent, I don't care if it's curly brace or a letter.

    The implication here is that the closing curly brace is as important as ever, since it is used to line up the first character of the scope block. 

    There's a big contradiction here. If the indentation is enough to see the scope block going down, what do you need the closing brace for? The end of the block is clearly delimited by the return to the previous indentation level.

    if (you.suck()) {

      whine();

      magicNumbers.use();

      hex.setKnown(false);

      code.bungle(); }

    System.out.println("This is the next scope");

    etc.

    As I also said in a previous post, mentally processing this would actually be <MARGINALLY>faster since your brain doesn't care what character it is that opens the scope, so long as it falls in the same vertical line.

    You could make the exact same argument about my position: mentally processing the scope block delimited with a brace on its own line on each side of it is faster since all your brain has to do is look for a brace (which is always the same) and not abstract away from what character is the first to be indented, and because the layout is symmetrical, which has processing advantages.

    At any rate it's really about personal preferences, not about "logic" or whatnot, and all I was trying to do is to rile you and others up. Seems like I succeeded. :)

     * rogthefrog goes off to submit his own code for consideration as WTF of the year

  • A Nonny Mouse (unregistered) in reply to rogthefrog

    indentation... check this out for sucky indentation ( saw this when editing a mates code at uni<FONT face="Courier New">)</FONT>

    <FONT face="Courier New">function phpFunctionOfSomeSort</FONT>

    <FONT face="Courier New">{  </FONT>

    <FONT face="Courier New">  somecode here</FONT>

     

    <FONT face="Courier New">  some more code here</FONT>

     

    <FONT face="Courier New">  if (condition) </FONT>

    <FONT face="Courier New">  {</FONT>

    <FONT face="Courier New">    lets have even more line breaks</FONT>

    <FONT face="Courier New">  }</FONT>

     

     }

     

    so not only is it a gammy style (K+R is the best ever, obivously) but there was a linebreak between _every_line_of_code!

  • (cs) in reply to Mung Kee
    Mung Kee:
    masklinn:
    Anonymous:
    Anyway, all this bracket fighting is killing the love - can't we call come together and ridicule Jed's code as one?  I mean, thats a guy who managed to take exception handling's lovely "no cost when not used" methodology and actually track every single possble exception throwing condition long after it was obvious the function would never execute, even though he would never report any specifics about all the errors - then of course screw up on actually reporting the errors. 

    The One True Brace Style War has been going on ever since braces were used for the first time in a programming language. It probably won't stop before C, C++, Java and C# are all dead.

    The sooner the better, if you want my take on it

    Oh BTW the so called "windows indent style" is actually Whitesmiths, from a PDP-11 C compiler, and the most fucked up style is probably the GNU one (Lisp syntax is already tough in Lisp, but writing Lisp in C/C++ is quite fucked up)



    I beg to differ.  Pico is pretty f-ed up.

    GNU is baaaaaaad. Pico is nasty. But Whitesmiths is just terrible.

  • (cs) in reply to Djinn

    Djinn:

    Careful with that axe, Eugene.

    int a = 0;

    a = a++ + 1;
    System.out.println(a);

    a = ++a + 1;
    System.out.println(a);

    Run that in Java. Now, switch to C/C++ (changing variable printing accordingly), and run it against many different compilers/platforms.

    In C#:

    1

    3

    as I expected.

    I take your word for it that not all compilers/platforms act the same, but it suprises me highly.

  • dave (unregistered) in reply to Cybenny

    Let's be honest. The BSD/Allman style is the only true style; with 3 spaces and none of that mucking about with tabs (a pain in the arse when transferring stuff between systems with bad codepage convertors). After all, all the best programmers use vi on an 80x24 terminal screen.

    The BSD style gives you vital contextual information - rather than disassociated blocks like the GNU style. The Whitesmiths style just looks ugly.

    Also the BSD style leaves you a convieniant place for a comment:
    if (foo == bar)
    { // flange the grobble
       ...insert code here
    }

    Hungarian notation is never acceptible.

  • (cs) in reply to dave
    Anonymous:
    Hungarian notation is *never* acceptible.


    I disagree.  Hungarian notation is acceptable if it provides actually useful information beyond  the datatype.  I don't care if it is an integer.  I might care that it is an integer that holds a handle to something else in the application.  Or I might care if it is an integer that is used to store a set of bit flags. 
  • (cs) in reply to dave

    Anonymous:
    Let's be honest. The BSD/Allman style is the only true style; with 3 spaces and none of that mucking about with tabs (a pain in the arse when transferring stuff between systems with bad codepage convertors). After all, all the best programmers use vi on an 80x24 terminal screen.

    The BSD style gives you vital contextual information - rather than disassociated blocks like the GNU style. The Whitesmiths style just looks *ugly*.

    Also the BSD style leaves you a convieniant place for a comment:
    if (foo == bar)
    { // flange the grobble
       ...insert code here
    }

    Hungarian notation is *never* acceptible.

    I think there is not only one true style. Any style is good as long as you're consequent. I like to keep my code as compact as possible without loosing it's readability, so I use the K&R style:

    if(foo==bar) {

       DoSomething();

    }

    or in this case, I'd prefer:

    if(foo==bar) DoSomething();

    1 line instead of 4 and still very readable...

    Hungarian notation is off course acceptable. Why would anyone have invented it? It's just from another time period when there was a limited amount of types (primitives of objects). I think you should not use it anymore in modern OO languages!

  • zamies (unregistered) in reply to Joe

    12 is a satanic number in jeds world?

  • zamies (unregistered) in reply to Jenny Simonds

    Apparently they are unaware of the IF ELSIF Structure?

  • zamies (unregistered) in reply to travisowens
    travisowens:

    Sounds like the guy just read that very morning that in .Net, to throw an exception is very expensive, so he cut 12 exceptions down to just 1.

    But oh yea, he's a moron and didn't know wtf he was doing.

    (This post is [image] approved)


    ehhhh no!
    But in the old code you never throw 12 exceptions at the same time.....
  • Stevey (unregistered) in reply to Cybenny

    The problem with K&R is in dealing with multiple line conditionals:

    if (test1() && test2() && test3()) { action1(); action2(); action3(); }

    ... in that the conditions are not obviously separated from the body of the statement, without hunting for the '{', which may be a long way off if the test has a long name.

Leave a comment on “Argument About Argument Validation”

Log In or post as a guest

Replying to comment #:

« Return to Article