• Mr. Big (unregistered)

    He is just abstracting out this process. Who knows, in the future he may want to change 'false' to 'fileNotFound'

  • (cs)

    omg, what vile creature posted my proprietary code to this site???

    HOW AM I SUPPOSED TO CHARGE $200/HR WHEN YOU AMATEURS KEEP STEALING MY ELITE WORKS OF ART???111!!!

    Be advised you should expect a call from my lawyer soon.  His name is Leonard "J." Crabs, and his legal acumen is feared far and wide.

    vc

  • (cs)

    I'm sure this was an update to a program that had much more complicated methods for setting a variable to true or false and to update all references to the call would have been more difficult than leaving the code as is.

  • (cs)

    Isn't the Standard Definition of "true" still in committee?

    In his defense:  Could these be "setters" from a class?  I once had a university-level instructor that taught this as the proper way to practice "data-hiding," "abstraction," etc.

    brillant!

  • (cs)

    I could use methods like this in my work.  I hate typing out that damn equals sign all the time.  Mind if I borrow? 

  • (cs)
    Alex Papadimoulis:

    Subroutines are one of those programming constructs that predate computers themselves; the Wikipedia dates their usage back to Ptolemy's time. They live by many different names -- functions, procedures, named-squiggly-brace-blocks, etc -- and exist for two primary reasons: to allow for code reusability (not the copy-n-paste type) and to break down and simplify long and complex code. Bas ter Brugge came across a series of functions that not only fail to accomplish those goals, but actually manage to be longer to type out than the code they contain ...

    public void setOptBlnToFalse() 
    {
      iOptBln = false;
    }
    

    public void setOptBlnToTrue() { iOptBln = true; }

    /* ED: ... */

    You don't know anything Alex, it's clear that THIS is OO programming at it's finest: the data is completely abstracted, be it the one inside the object itself or the one transfered between the object and the outer world, and only messages are passed around.

    Here, you see a true separation between the object's interface and it's implementation, without all this cluncky parameter passing or *shiver* public variables.

  • (cs) in reply to osp70

    osp70:
    I'm sure this was an update to a program that had much more complicated methods for setting a variable to true or false and to update all references to the call would have been more difficult than leaving the code as is.

    Look at the function names. Set boolean to true. Set boolean to false. Theres only so much that they can do...

  • (cs)

    I could understand using setOptBln() if you want to have setters for everything, and add security checks to just the setters that need them.  ToFalse() and ToTrue(), however, is indefensible.

    I agree with a comment that was made at JavaWorld:

    http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox-p3.html?post=16482#talkback

    "<font face="verdana, arial, helvetica" size="3"><font class="post">Frankly I prefer the approach taken by some other languages: you define a public field, where getter and setter methods can be transparently added latter. In other words, dealing with the field will call the methods if they exist, or hit the field directly if they don't. This seems preferable to wearing your hands out (or buying a fancy IDE) to generate a lot of makework text in your source code."

    </font></font>

  • (cs)

    this is a pretty weak WTF without knowing the context of how it's used

  • (cs) in reply to JohnSmallberries
    JohnSmallberries:
    Isn't the Standard Definition of "true" still in committee?

    In his defense:  Could these be "setters" from a class?  I once had a university-level instructor that taught this as the proper way to practice "data-hiding," "abstraction," etc.

    brillant!


    Getters and setters are usually a good idea but having a separate setter for each value is stupid.  A better setter would be:
    public void SetOptBln(bool Value)
    {
        iOptBln = Value;
    }

    The real WTF I think is the tragic effect two setters would have on any sort of programmatic code.  Instead of something relatively nice and logical like SetOptBln(SomeFunctionThatReturnsABool()); you'd get something like:
    if(SomeFunctionThatReturnsABool())
    {
        SetOptBlnToTrue();
    }
    else
    {
        SetOptBlnToFalse();
    }

    ... lame.  And if you're going to use the bastardized version of Hungarian notation, why would you use i for a boolean?
  • (cs) in reply to Matt B
    Matt B:
    this is a pretty weak WTF without knowing the context of how it's used


    I'm not sure I can agree with that.  It may not be eye wateringly bad (but some other forum members will disagree with even that), but it does violate the fundamental idea of procedural (forget OO, procedural) programming that most everyone here is familiar with.  You would't even pull this in COBOL, where passing parameters to subroutines isn't the way the language is designed to operate.  [Disclaimer: I haven't worked with COBOL since using compilers for the '85 and '90 standards, so I don't know what the 2000 spec has done].
  • (cs) in reply to Taevin
    Taevin:
    Getters and setters are usually a good idea but having a separate setter for each value is stupid.  A better setter would be:
    public void SetOptBln(bool Value)
    {
        iOptBln = Value;
    }

    Agreed.  New to posting here, can't figure out the emoticons, and I forgot my <sarcasm> tags.  FTR, although that instructor felt that this level of abstraction was a Good Thing™, I do not, and we had many ... animated ... discussions on the topic.

    Taevin:
    The real WTF I think is the tragic effect two setters would have on any sort of programmatic code.  Instead of something relatively nice and logical like SetOptBln(SomeFunctionThatReturnsABool()); you'd get something like:
    if(SomeFunctionThatReturnsABool())
    {
        SetOptBlnToTrue();
    }
    else
    {
        SetOptBlnToFalse();
    }

    See above.
    Taevin:
    ... lame.  And if you're going to use the bastardized version of Hungarian notation, why would you use i for a boolean?

    No clue ...
  • (cs) in reply to Matt B

    Matt B:
    this is a pretty weak WTF without knowing the context of how it's used

    Can you think of ANY way to use it?

  • (cs) in reply to ItsAllGeekToMe
    ItsAllGeekToMe:

    Matt B:
    this is a pretty weak WTF without knowing the context of how it's used

    Can you think of ANY way to use it?

    Ask and ye shall receive. Imagine you're taking your first OO programming class and the teacher tells you to never make any of the member variables public, instead make public functions that, when called, will modify the object's private variables. Maybe he wanted to set up some kind of event processing so that when the boolean value was changed, other code will be called to change something on a form, or update a database value.

    It could have been a test project by this newbie programmer, or maybe development code that was just a placeholder and hadn't been fully worked on yet. Until someone can give some more details, I'd say it's hardly a WTF, more like a "Hrm I suppose that's one way you could do it".

  • (cs) in reply to Mr. Big

    Anonymous:
    He is just abstracting out this process. Who knows, in the future he may want to change 'false' to 'fileNotFound'

    Isn't it obvious? the initial value of iOptBoolean is fileNotFound. With these handy-dandy encapsulators, he can tell if one of them was called because iOptBoolean would have a value of true or false. This paves the way for:

    public bool isOptBooleanSet() {
      if ((iOptBoolean == true) || (iOptBoolean==false)) return true;
      else return false;
    } [:P] or better yet a switch statement...

  • (cs)

    I'd like to see a version that sets a property to some arbitrary character, rather than 1 or 2 possible values

  • (cs)

    Actually, add comments to the equation and this actually does save time.

    setOptBlnToFalse()

    is shorter than

    iOptBln = false //Set OptBln to False


    By combining the in-depth comment with the statment itself, you make sure your code is always well documented, self describing, and you save on typing! Cool, eh?

  • (cs) in reply to Manni
    Manni:

    Until someone can give some more details, I'd say it's hardly a WTF, more like a "Hrm I suppose that's one way you could do it".



    ITYM "I suppose that's the worst possible way to do it."


    ok

    dpm

  • (cs) in reply to Taevin
    Taevin:
    ... lame.  And if you're going to use the bastardized version of Hungarian notation, why would you use i for a boolean?


    'i' for information.
    And information in it's purest, simplest form is a single bit - true or false. This is descriptive programming at its best.

    Similarly: loiialName = 'Fred'
    loiial = lots of information in a line. More descriptive, and less ambiguous (is that a word, or an instance of a Twine object?) than the word String.
  • (cs) in reply to RayS
    RayS:
    Actually, add comments to the equation and this actually does save time.

    setOptBlnToFalse()

    is shorter than

    iOptBln = false //Set OptBln to False


    By combining the in-depth comment with the statment itself, you make sure your code is always well documented, self describing, and you save on typing! Cool, eh?


    I just hope this guy will never ever create a class with an integer field. Just imagine it...

    setIntToZero()
    setIntToOne()
    setIntToTwo()
    ...


  • (cs) in reply to dpm
    dpm:
    Manni:

    Until someone can give some more details, I'd say it's hardly a WTF, more like a "Hrm I suppose that's one way you could do it".



    ITYM "I suppose that's the worst possible way to do it."

    ok
    dpm

    No, I'm pretty sure I had it right the first time, but I appreciate your editorial skills.

    Is it a horribly overblown obfuscated implementation of a fairly simple action? I've seen some hellish functions to do something as simple as return the integer portion of a float (which I hear they make built-in functions for nowadays), so something like this seems like a silly way for a newbie to interact with private members of a class.

    Is it wrong? Not really. Is there a better way? You bet. Will this guy eventually learn when he moves on to his second C++ class? Let's hope so.

  • (cs) in reply to java.lang.NullReferenceException
    java.lang.NullReferenceException:
    RayS:
    Actually, add comments to the equation and this actually does save time.

    setOptBlnToFalse()

    is shorter than

    iOptBln = false //Set OptBln to False


    By combining the in-depth comment with the statment itself, you make sure your code is always well documented, self describing, and you save on typing! Cool, eh?


    I just hope this guy will never ever create a class with an integer field. Just imagine it...

    setIntToZero()
    setIntToOne()
    setIntToTwo()
    ...


    Have you deeply thought about this?

    Good, now try to apprehend what a class with multiple string fields would involve.

  • (cs) in reply to Manni
    Manni:

    Is it wrong? Not really. Is there a better way? You bet. Will this guy eventually learn when he moves on to his second C++ class? Let's hope so.



    But the point is, code that's posted here supposedly is all from production code. This isn't some kiddie taking his first steps in Java (yes, Java, not C++), this code is actually out there!

  • (cs) in reply to CornedBee
    CornedBee:
    Manni:

    Is it wrong? Not really. Is there a better way? You bet. Will this guy eventually learn when he moves on to his second C++ class? Let's hope so.



    But the point is, code that's posted here supposedly is all from production code. This isn't some kiddie taking his first steps in Java (yes, Java, not C++), this code is actually out there!

    This code is in use somewhere?!?! OMG teh system is br0kun!!!one

    So the argument is that this code results in an increased number of keystrokes to set a boolean variable? Seriously? Aside from creating two functions that each perform a single action, I hardly see what's so awe-inspiring about this bit o' code. A better WTF would be if it took some obscure parameter like a string or integer, and did some kind of crazy "new" math to turn it into a boolean.

    At its worst, this should be reduced to one function that takes a boolean parameter, but I never advocate allowing other parts of code to directly interact with my variables. If someone else's code changes a "true" to a "false" when I don't expect it, there could be some interesting results.

  • (cs)

    This functions has a horrible bug...

    It doesn't check for isTrue(iOptBln) before assignment!

  • (cs) in reply to Manni
    Manni:
    CornedBee:
    Manni:

    Is it wrong? Not really. Is there a better way? You bet. Will this guy eventually learn when he moves on to his second C++ class? Let's hope so.



    But the point is, code that's posted here supposedly is all from production code. This isn't some kiddie taking his first steps in Java (yes, Java, not C++), this code is actually out there!

    This code is in use somewhere?!?! OMG teh system is br0kun!!!one

    So the argument is that this code results in an increased number of keystrokes to set a boolean variable? Seriously? Aside from creating two functions that each perform a single action, I hardly see what's so awe-inspiring about this bit o' code. A better WTF would be if it took some obscure parameter like a string or integer, and did some kind of crazy "new" math to turn it into a boolean.

    At its worst, this should be reduced to one function that takes a boolean parameter, but I never advocate allowing other parts of code to directly interact with my variables. If someone else's code changes a "true" to a "false" when I don't expect it, there could be some interesting results.

    sure you mean like the one found in

    AppDomainSetup.ShadowCopyFiles

    http://blogs.msdn.com/brada/archive/2005/11/17/494282.aspx

  • moobar (unregistered)
    Alex Papadimoulis:
    public void setOptBlnToFalse() 
    {
    iOptBln = false;
    }

    public void setOptBlnToTrue()
    {
    iOptBln = true;
    }

    /* ED: ... */


    I don't regard this as a WTF at all.  Having methods with one line to set a value is normal in Java.  I'd be surprised if a large Java project didn't have methods like this. Other than reflection there is no other easy way for classes to set/get private values within other classes.

    The guy submitted this clearly has very little experience with Java.  I'd be interested to know what his "better" alternative would be to allow other classes to set iOptBln.

    Having said that, there is one minor WTF and that's why they didn't use:

    public void setOptBln(boolean value) {
      iOptBln = value;
    }

    Having a set method for each value that can be set on a variable is inefficient, hard to maintain and, for anything that's not a boolean, incredibly time consuming. 

  • (cs) in reply to BlackTigerX
    BlackTigerX:
    Manni:
    CornedBee:
    Manni:

    Is it wrong? Not really. Is there a better way? You bet. Will this guy eventually learn when he moves on to his second C++ class? Let's hope so.



    But the point is, code that's posted here supposedly is all from production code. This isn't some kiddie taking his first steps in Java (yes, Java, not C++), this code is actually out there!

    A better WTF would be if it took some obscure parameter like a string or integer, and did some kind of crazy "new" math to turn it into a boolean.

    sure you mean like the one found in

    AppDomainSetup.ShadowCopyFiles

    http://blogs.msdn.com/brada/archive/2005/11/17/494282.aspx

    You consider converting the string "true" to the boolean "true" to be obscure? They're spelled almost exactly the same, if you'll notice...

    But yeah, that's the right idea. M$ is a WTF factory, and they're always working overtime.

  • Bill Brasky (unregistered)

    This isn't too bad.  A coworker of mine told a story of old co-worker who perferred:

    public class Foo {
        private boolean something;
        private boolean notSomething;

        public void setSomethingTrue() {
            something = true;
            notSomething = false;
    }
    public void setSomethingFalse() {
    something = false;
    notSomething = true;
    }

    public void doSomething() {
    // ...
    if( something ) {
    }

    /....

    if( notSomething ) {
    }

    }
    }


    Invaribly, he'd eventually mess up one of his setters, or update the values without the setter inside the class and break his code.  Nobody could ever figure out why he did it the way he did....



  • (cs) in reply to Manni
    Manni:

    But yeah, that's the right idea. M$ is a WTF factory, and they're always working overtime.

    That's some damn fine quote here, would you allow me to re-use it?

  • (cs) in reply to masklinn
    masklinn:
    Manni:

    But yeah, that's the right idea. M$ is a WTF factory, and they're always working overtime.

    That's some damn fine quote here, would you allow me to re-use it?

    I (your name) __Manni__ do hereby entrust unto (recipient name) __masklinn__ exclusive rights forthwith to reuse, modify, or alter the aforementioned phrase until such time that the phrase is no longer deemed valid upon the utter destruction of the corporation mentioned, or until (your name) __Manni__ goes flat broke and will require royalties for the use of said phrase.

  • (cs) in reply to Bill Brasky
    Anonymous:
    Invaribly, he'd eventually mess up one of his setters, or update the values without the setter inside the class and break his code.  Nobody could ever figure out why he did it the way he did....


    Two reasons.

    1) Because there should be no bias.
    2) So that he could always use a positive test without having to think to hard...

    A nice, easy
        if (notSomething) // aaah, so nice
    rather than the complicated, difficult-to-understand
        if (!something) // shudder
  • (cs) in reply to moobar
    Anonymous:
    I don't regard this as a WTF at all.  Having methods with one line to set a value is normal in Java.  I'd be surprised if a large Java project didn't have methods like this. Other than reflection there is no other easy way for classes to set/get private values within other classes.


    Apart from the "getter/setter" idiom being basically a way to subvert the OO paradigm by making C-style structs look  vaguely OO, it is IMO WTF-worthy for managing to write a method whose name is neither shorter nor more descriptive than the code it contains.

    I can imagine cases where I'd write parameterless methods that set a field to a specific value, but only in order to use a more descriptive name for and operation that shouldn't really be considered a "setter".


  • (cs) in reply to Bill Brasky
    Anonymous:
    public class Foo {
        private boolean something;
        private boolean notSomething;

        public void setSomethingTrue() {
            something = true;
            notSomething = false;
    }
    public void setSomethingFalse() {
    something = false;
    notSomething = true;
    }
    }

    Ahh, obviously the epitome of Zen Programing. Keep an lookout for other classes like:

    public class OneHandClapping{
    }
    public class AskTheBuddha{
    }

    They all inherit from:

    public class Koan{
    ]

  • (cs) in reply to marvin_rabbit

    If this were C/C++ the reason would be clear:
    imagine you have some framework that takes a callback of type void (*some_type)() and you want the callback to set your (ahem) global or file level static variable iOptB1n to true or false. Problem solved!

    Hmm... I guess you could do it in C# too.

    Great variable name, by the way. Naturally, you have to remove other letters to make room for the hungarian notation. Let's not mention the fact that the standard hungarian notation dictates that iOptB1n should be an integer...

  • (cs) in reply to Manni
    Manni:

    Ask and ye shall receive. Imagine you're taking your first OO programming class and the teacher tells you to never make any of the member variables public, instead make public functions that, when called, will modify the object's private variables. Maybe he wanted to set up some kind of event processing so that when the boolean value was changed, other code will be called to change something on a form, or update a database value.


    Neither of these is an excuse for not doing

    public void setOptBln(boolean value) {
      iOptBln = value;
    }

    In the latter case, you might have

    public void setOptBln(boolean value) {
      iOptBln = value;
      if(value) /* do stuff for true */ else /* do stuff for false */
    }

  • (cs) in reply to dpm
    dpm:
    Manni:

    Until someone can give some more details, I'd say it's hardly a WTF, more like a "Hrm I suppose that's one way you could do it".



    ITYM "I suppose that's the worst possible way to do it."



    Oh, there are much worse ways to do this.  At least this one doesn't contain any logic errors; I could easily see a copy+paste programmer doing

    public void setOptBlnToFalse() 
    {
    iOptBln = false;
    }

    public void setOptBlnToTrue()
    {
    iOptBln = false;
    }

  • (cs) in reply to brazzy
    brazzy:

    Apart from the "getter/setter" idiom being basically a way to subvert the OO paradigm by making C-style structs look  vaguely OO,


    Not really.  You can make that mistake, but you can also do it correctly - make the variables private, and put wrapper logic in the getter/setter functions when needed.

    As for eliminating getter/setter in favor of DrawYourself(), RenderYourselfAsHTML(), etc., that's a separate and more complex topic and I don't have the practical experience to have a useful opinion on it.

  • (cs)

    Where are the comments here? I mean, how can one possibly look at this heavy, thick snippet of code and figure out what it does? How can the programmer possibly assume that anyone can understand his sophisticated, elegant program without adding comments? That's the real WTF here. I would have added the following comments for the average programmer to better understand this procedure:

    public void setOptBlnToFalse() //public is used to make a method less private
    {                                               //the curly brace pointing to the right opens up this bag of fun
      iOptBln = false;                       //the = sign assigns the second thingy to the first thingy
    }                                               //the curly brace pointing to the left closes up this box of amusement
                                                     //the space makes it easier for us to know the second part of the stuff is not the same as the first
    public void setOptBlnToTrue()  //public does not mean government-owned
    {                                               //could I have used # instead of { ? I'm not too good with programming
      iOptBln = true;                        //what am I doing again?
    }                                               //OK, this means I'm finished. Time to catch the short bus back home.

    /* ED: ... */

  • (cs)

    To give the benefit of the doubt:

    It's possible that initially there was only a setToTrue method and no setToFalse method. i.e. The public interface of the class only allowed users to set the flag, but not to clear it. Later on, the contract/spec changed and the setToFalse method was added. I could think of a few other examples that would at least partially explain it.

    Even if that's not the case (and I assume it's not), IMHO it's not a WTF. To qualify as a WTF, seeing the code has to make you laugh hysterically or break down in tears. This code is amateurish, but is not a great WTF example.

  • (cs) in reply to ItsAllGeekToMe
    ItsAllGeekToMe:

    Matt B:
    this is a pretty weak WTF without knowing the context of how it's used

    Can you think of ANY way to use it?

    So far, I can only think of two.

    One, (weak), if performance was ultra-critical on this particular code.  setOpt(val) has to load a register with a particular value before the subroutine jump (and possibly save the previous register contents first), then copy that register to the address within the subroutine; setOptVal() just has to do the subroutine jump, then set the address with an absolute value within the subroutine.


    Two, if the general context of the code showed plenty of examples where set(true) and set(false) performed radically different things (well, in addition to setting the actual value), and if/else was impractical (let's say for the sake of argument they're each a couple pages long, and you don't want an else clause that far separated from the if).  Then, consistency might push for separating the set(true) and set(false) functions into setTrue() and setFalse() in this instance as well.


    The sample code is definitely a "Huh?" but it certainly doesn't make me sit here and go "WTF".

    Update: Since I composed the above comment, a couple others have suggested other viable reasons for doing something like this (e.g. initially, foreign code could set but not reset the value (or vice versa).  I, on the other hand, was restrained from posting my invaluable insights because, after all this time of being "caught by the captcha", tonight the captcha image disappeared!  Yup, instead of being told you're wrong the first time, you had to simply guess at what the captcha might be from seeing the "broken image" icon.  And thus is formed the history of my login id, as I finally had to register to post anonymously.  Now that makes me go "WTF" :)

  • (cs)

    What's in a name?

    iOptionalBoolean?
    iOperationalBoolean?
    InputOutputPhysicalTortureBoolean?
    iOptionBoolean?

    What does it all mean??

    Drak

  • (cs)

    Perhaps once upon a time the iOptBln field was an int (it starts with an i! an i!), and then setting it to false meant setting it to -1 or something, and setting it to true meant the value was computed by some unholy means.

    We JUST DON'T KNOW!

  • (cs)

    Good OOP. Nothing bad about it. However, the names are not well choosen. Should have been:

    public void enableOptBln() { ... }
    public void disableOptBln() { ... }

  • (cs) in reply to emurphy
    emurphy:
    brazzy:

    Apart from the "getter/setter" idiom being basically a way to subvert the OO paradigm by making C-style structs look  vaguely OO,


    Not really.  You can make that mistake, but you can also do it correctly - make the variables private, and put wrapper logic in the getter/setter functions when needed.


    The first is just a way of fooling yourself into thinking you're being OO, while the second is rarely done at all. I'd estimate that upwards of 90% of all getters and setters that get written contain no logic whatsoever.

    emurphy:

    As for eliminating getter/setter in favor of DrawYourself(), RenderYourselfAsHTML(), etc., that's a separate and more complex topic and I don't have the practical experience to have a useful opinion on it.


    A shame, because that's what OO is all about. If you're creating "value objects" and pass them to methods that get those values with getters to do the actual work, you're NOT doing object oriented programming! Sure, sometimes there are good reasons not to be religious about it, but most of the time the reason is simply a lack of proficiency in "OO thinking".
  • (cs) in reply to brazzy

    I had a women working on my team who graduated from a CS course as a mature student (15 years from retirement age) and she insisted on writing code like this. During code reviews I would regularly come across code like:

    private bool CheckIsNull(object o)
    {
       if (o == null)
          return true;
       else
          return false;
    }

    She couldn't understand how less readable this made her code.

  • (cs) in reply to Maurits
    Maurits:
    Anonymous:
    Invaribly, he'd eventually mess up one of his setters, or update the values without the setter inside the class and break his code.  Nobody could ever figure out why he did it the way he did....


    Two reasons.

    1) Because there should be no bias.
    2) So that he could always use a positive test without having to think to hard...

    A nice, easy
        if (notSomething) // aaah, so nice
    rather than the complicated, difficult-to-understand
        if (!something) // shudder

    There are languages that don't have "!" (or provide alternatives to it, cf Ruby where !a and not a have the same meaning), so the aforementioned code would look like

    if notSomething # aaah, so nice

    Rather than the complicated, difficult to understand

    if not something # *shudder*
  • (cs) in reply to ItsAllGeekToMe
    ItsAllGeekToMe:

    Matt B:
    this is a pretty weak WTF without knowing the context of how it's used

    Can you think of ANY way to use it?



    Maybe the code has to be used with some kind of framework that wants callback function pointers for various events. When you have pointers to a function(void), you have to embedd the "parameters" into the body of the function.

    That's my guess anyways, that those functions were hooked up to a GUI that only lets you call methods without parameters.

    *shrug*
  • (cs) in reply to Phill
    Phill:

    I had a women working on my team who graduated from a CS course as a mature student (15 years from retirement age) and she insisted on writing code like this. During code reviews I would regularly come across code like:

    private bool CheckIsNull(object o)
    {
       if (o == null)
          return true;
       else
          return false;
    }

    She couldn't understand how less readable this made her code.



    Well, it doesn't make it less readable -- especially after you're used to seeing "CheckIsNull(someObj)" everywhere.

    It doesn't increase readability either. It really has no effect on readability any way you put it at all. However, I think that there is a slightly higher chance of bracket nest confusion, compared to "someObj == null".
  • (cs)

    On the plus side, it certainly increases code readability, assuming you prefer your code to read more like english than C-ish.

    Kinda makes you hope for inline compiling tho huh?  Does anyone else think this guy could write hello world and get a stack overflow??

Leave a comment on “Functionally Illogical”

Log In or post as a guest

Replying to comment #:

« Return to Article