• VB Coder (unregistered) in reply to Blah

    Never mind "the real WTF is..." I can't believe I read through over 100 posts and not one of you uber-CurlyBraceLanguage developers has commented the BUG is this routine:

    boolean hasPermissionsRequiredToComplete<FONT style="BACKGROUND-COLOR: #ffff00">Signing</FONT>Step =
          currentInteractiveUser.HasSpecificPermission
    (
          SpecificApplicationPermissions.Complete<FONT style="BACKGROUND-COLOR: #ffff00">Closing</FONT>Step
    );

    The user's Signing permissions don't matter. If he can Close, He can Sign. Oops. (Sure this is probably a transcription error during anonimization, but maybe not.)

    Assuming that's not the case, in Java Wizard's attempts to over-comment the routine, which resulted in overly-long identifiers and suppression of boolean short-circuiting, he probably resorted to Cut/Paste/Modify (because the variable names are so long), and THEN forgot that ever-important Modify step.

    Not that I've ever done that. After all, I code in VB. I must suck.  <FONT color=#ff0000>;-)</FONT>

  • King of COBOL (unregistered) in reply to JR
    Anonymous:

    RayS:
    OK, ignoring the apparently overrated talents of this guy, I have to admire the way that he's built up something almost like a cult around himself.

    Am I alone in now planning to set myself up in a similar manner? I think that it might help to start wearing a robe and crown or something. Perhaps bribe a few cheap people to act as disciples for a short while until it catches on.

    From now on I'll be known as "The Sultan of SQL" to my underlings.

    More like Viceroy of VB.



    This is the SUPERSLAM OF THE YEAR.
  • woohoo (unregistered)

    Well, descriptive (and therefor possibly long) names are not a bad thing per se (perhaps the "Java Wizard" used to be an "Ada Wizard" before ;o), but this holds mainly for identifiers that are publicly visible (like HasSpecificPermission() might be in the above sample - however, we do not see if that is so, I'm merely assuming it).

    There is a minor WTF here, because naming conventions demand the first letter of methods to be lower case, and putting the parentheses on single lines is inane. "SpecificApplicationPermissions.CompleteClosingStep" might also be questionable depending on it's declaration: if it is a publicly modifiable attribute, it violates the concept of encapsulation, if it is a constant, it violates the naming convention for constants (all uppercase) - a "Wizard" should know all this.

    There is OTOH not a lot of sense for local (!) variables like the 3 booleans to have names of around 40-50 characters. If one needs such long names because the method bodies have a LOC count of 200+ lines (or perhaps 1000+...I've seen that), then the problem is most probably lurking elsewhere, the developer is obviously writing procedural code with an OO language...

    I'd not consider this a real bad case of a WTF, "self documentation" of code is not bad, replacing the overly long local variable names with code comments would be better still.

    CAPTCHA: poprocks :o)

  • (cs) in reply to themagni
    themagni:
    I wrote this before lunch, but the forum didn't let me post it.

    Oh, bad forum. Bad, bad forum! Anyway, I admire your punctuality.

    themagni:
    There's no dress code where I work. I wear slacks, a nice shirt - with an undershirt - and nice, comfortable shoes. (And yes, for the literalists, I also wear underwear, socks, a belt, two rings, and an ID badge.) That's because I want to portray a presentable, knowledgeable, and professional image.

    The image of a professional impostor?

    themagni:
    Dress like a homeless guy and you'll be respected like a homeless guy.

    Now, while I see no point in following the clothing standard of the establishment as you do for sheer ego masturbation, I don't dress like a homeless either. But I'm absolutely certain that I wouldn't want to work for people who disrespect those in need.

    themagni:
    Frankly, if someone can't figure out how to use deodorant or how to get their belt to match their shoes I have no faith in their ability use a debugger or work out the finer points of an interface.

    Sad to hear you're such a superficial little fuckhead. Maybe I'm just too blind to see what wearing a phalilc symbol round my neck will do to improve my coding or other mental abilities. Intuitively, I would say that the only possible effect is to impede blood circulation to an organ much involved in these activities.

    I myself have found that while many capable developers do groom, the only IDE most of the suits are really experts at is Powerpoint.

    themagni:
    Some of the crap I've written in VBA was awful.

    What went wrong? Weren't you properly dressed?

    themagni:
    I'm better at it now.

    Gucci and Versace will be glad to hear that they could help!

    Maybe I am mistaken and your pride and vanity will actually get you somewhere. But then, who can say whether this will be a desirable place or condition?

  • (cs) in reply to Alexis de Torquemada

    The real wtf is that post.

  • (cs) in reply to ammoQ
    ammoQ:
    Who needs digits? Just mix lowercase L with uppercase i to get names like IIllIlII and llIIllII. Best used in boolean "or" expressions (in C-like languages):
    lIIllIIlI = IIllIlII || llIIllII;

    Reminds me of (earlier versions of?) Borland JBuilder. The Java compiler allowed you to use, err, unusual characters in symbols. Now the funny thing is that the character FF hexadecimal (easy to enter using Alt 2-5-5 on a Windows PC) was one of the characters permitted in symbols, although it just looks like a space in most fonts, and the syntax highlighting algorithm of JBuilder actually treated it as though it were whitespace!

    This means you could type things like (I'm using underscores instead of FF characters for comprehensibility :-) ):

    // Source File 1
    class abstract_default_int {
      public abstract_default_int(int i) {}
    }
    
    // Source File 2
    class private_synchronized_protected_woot_return_woot
    {
      private abstract_default_int void_signed_goto_else;
    
      public private_synchronized_protected_woot_return_woot() {
        void_signed_goto_else = new abstract_default_int(42);
      }
    }
    

    etc. In the IDE, it would look like a monkey just pulled random keywords out of a bag because all the bogus keywords seemed properly spaced and were highlighted as keywords, but the code would actually compile and run. Great for playing pranks on coworkers ("You don't know what abstract default member variables are good for? You got to be kidding!"). Not that I ever used that in production code, though...

  • (cs) in reply to m0ffx
    m0ffx:
    All C programs are ONE line. As are all HTML pages.

    The compiler just doesn't care about newlines (the preprocessor does), that's not the same as saying they are "one line", only they could be written entirely on one possibly gargantuan line (if you don't use any preprocessing directives, that is).

  • (cs) in reply to ammoQ
    ammoQ:
    EvanED:
    I mean, people can make identifier names like l1l11ll1 and ll111l11 or O0OO0 O000OO that are just as hard, but I haven't heard any complaints that identifiers allow numbers in them.
    Who needs digits? Just mix lowercase L with uppercase i to get names like IIllIlII and llIIllII. Best used in boolean "or" expressions (in C-like languages):
    lIIllIIlI = IIllIlII||llIIllII;
    Good point. We'll ban lowercase letters as well.

     -- The PHB

    (<code>s mine)
  • (cs)
    class InteractiveUser{
    ...
      // Determine if Current Interactive User is authorized
      bool isAuthorized{
        get{
         return currentInteractiveUser.HasSpecificPermission(
           SpecificApplicationPermissions.CompleteClosingStep|
           SpecificApplicationPermissions.InitailizeClosingStep|
           SpecificApplicationPermissions.CompleteApprovalStep
         );
       }
      }
    }
    
  • Another Nonymous (unregistered) in reply to VB Coder
    Anonymous:

    Never mind "the real WTF is..." I can't believe I read through over 100 posts and not one of you uber-CurlyBraceLanguage developers has commented the BUG is this routine:

    boolean hasPermissionsRequiredToComplete<font style="background-color: rgb(255, 255, 0);">Signing</font>Step =
          currentInteractiveUser.HasSpecificPermission
    (
          SpecificApplicationPermissions.Complete<font style="background-color: rgb(255, 255, 0);">Closing</font>Step
    );



    Wow, you must be a real Debugging Wizard. ;-)

    Or the resolution of your monitor is set waaay to low.... ;-)

  • me (unregistered) in reply to DZ-Jay
    Anonymous:
    Anonymous:
    Er, no. It's considered a Good Thing to write code that is easy to read.

    Excessive verbosity and superfluous sesquipedalianism are not, even in exceptional circumstances, admirable contributions to the legibility of ones programmatic endeavours, and one should be abstemious in the employment of such.



    Roget's Thesaurus? (nice touch, wink! wink!)

    Why is it so hard to believe that someone can write that off the top of his head?

  • Cynix (unregistered) in reply to Blah

    <font size="2"><font face="Arial">And I would like to see some of the VariableNamesShouldBeOverlyDescriptive crowd getting any productivity without the pampering of an auto-completing IDE. Remember that short naming conventions have been around since before there was such a thing as an IDE.

    What this universe needs is a version control system that has an option on check-out: 'Novel mode' and 'Program mode', where 'Novel mode' automagically replaces variable names by the comment in the declaration.
    </font></font>

  • Theo (unregistered)
    Ever since I was a young boy,
    I've played the silver ball.
    From Soho down to Brighton
    I must have played them all.
    But I ain't seen nothing like him
    In any amusement hall...
    That deaf dumb and blind kid
    Sure plays a mean pinball !



    He stands like a statue,
    Becomes part of the machine.
    Feeling all the bumpers
    Always playing clean.
    He plays by intuition,
    The digit counters fall.
    That deaf dumb and blind kid
    Sure plays a mean pinball !


    He's a pinball wizard
    There has got to be a twist.
    A pin ball wizard,
    S'got such a supple wrist.
  • Reinder (unregistered) in reply to themagni

    "What he's got is three booleans created expressly for the purpose of setting another boolean"

    1. I do not see anything wrong with that
    2. I am not sure that that is the or the only reason he is doing it. I often do that to make debugging easier (it makes it easier to check the values of the three individual booleans)

    I see not much wrong with the Java code.

    Stylistically, I would not mix "RequiredFor" and "RequiredTo", probably replacing both with the simpler "To", and I would leave out the comments (comments to explain what a statement does are evil :-)) but that is it.

    If I saw all the code, there might be other changes I would make. For instance, 'currentInteractiveUser' might become 'currentUser' or even 'user', depending on the context, and the fragment shown might be refactored into a function (with Javadoc comment)

  • Hotta (unregistered) in reply to Kenton
    Anonymous:
    I assume when Alex says "functional code", what he really means is "procedural code".  There's a huge difference...

    That's probably the WTF! Who would have thought that VBA has functional capabilities?

  • dasgsdgsd (unregistered) in reply to EvanED
    EvanED:
    Anonymous:
    I'll take out of control camel casing rather than out of control underscoring:
     
    _z
    __z
    ___z
    _z_z__z
    _z__z
     
    Unfortunately, I've had to deal with code like this.  "__z" and "___z" are especially hard to tell apart.


    That's not a problem with underscoring so much as it is just really freaking stupid. (Not to mention undefined in C and C++; names starting with a double underscore or underscore followed by a capital letter are reserved for implementation use.*) I mean, people can make identifier names like l1l11ll1 and ll111l11 or O0OO0 O000OO that are just as hard, but I haven't heard any complaints that identifiers allow numbers in them.

    I think if you went through and replaced all camelCasing with underscoring code would improve in readability. I don't think it would help tremendously, because shorter identifier names are pretty readable in camel casing.
    I'm just picking the lesser of two evils.  Out of control camel casing JustResultsInSomethingLikeThisThatIsReallyAnnoyingButAtLeastICanTellItApartFromSomethingElse.
     
     
  • (cs) in reply to Digitalbath
    Digitalbath:
    Is "Advanced Technologies department" a euphemism for playing with stuff and never actually producing code that someone can use to do something useful?  Someone probably caught on to that after a while. 


    That would hold true every place I've ever worked. Oh, apart from people catching on.
  • (cs) in reply to RayS
    RayS:
    I think that it might help to start wearing a robe and crown or something.
    ...
    From now on I'll be known as "The Sultan of SQL" to my underlings.

    LOL. We must have pictures!
  • Ghost wizard (unregistered)

    I believe that is called failure to communicate and blowing smoke up your @$$ at the same time.

  • (cs)
    Alex Papadimoulis:

    // Get Current Interactive User's Permissions for
    //  CompleteClosingStep, HasSpecificPermission,
    //  and CompleteApprovalStep
    boolean hasPermissionsRequiredToCompleteSigningStep =
    currentInteractiveUser.HasSpecificPermission
    (
    SpecificApplicationPermissions.CompleteClosingStep
    );
    boolean hasPermissionsRequiredToInitailizeClosingStep =
    currentInteractiveUser.HasSpecificPermission
    (
    SpecificApplicationPermissions.InitailizeClosingStep
    );
    boolean hasPermissionsRequiredToCompleteApprovalStep =
    currentInteractiveUser.HasSpecificPermission
    (
    SpecificApplicationPermissions.CompleteApprovalStep
    );

    <FONT face=Tahoma>So what happens when a user has a permission to InitializeClosingStep but has no permission to CompleteClosingStep?

    And about the "<insert a buzzword here> <insert 133t noun here>", at school I was once called the person who eats compilers for lunch... I don't know who came up with that description, I didn't even knew anything about a compiler that time except it checks for syntax errors and make executables... :)

    I really didn't like the thought and I know for myself that I still have much to learn...
    Also I wouldn't like to be called that way because I only knew basic java, some COBOL and a lot of VB that time...

    Besides, "Viceroy of VB" was already taken... :)



    </FONT>
  • (cs) in reply to KattMan

    Anonymous:
    "Their"
    i before e except after....oh wait...

    I have to agree though, I dislike American spellings a lot of the time. I do have a strange ability to switch between "color" when programming and "colour" when not though. I do a lot of UI work, and thus use a lot of Americanised graphical API's, so I just use "color" to be consistent.

    I used to do heaps of UI work, including a lot of lower level graphics programming. I always used colour for instance variables. You can easily see that Color represents something incomplete and not entirely usable, whereas a colour is generally ready to go..... I don't care if someone else may have to maintain it.

    Anonymous:

    sesquipedalianism: The at of using words more complicated then necessary.  Essentially it word is an sesquipedalianism.

    Now for the length of the variable names, I do think they are far to long.  We have OOP for a reason.  Instead of his CheckPermissionsForAl....etc he should have made a class so he could instead say this:

    Allowed = Permissions.Action(UserID)

    Yeah, That just speaks to me. I read that and know what it means straight away. I don't even have to read a crap load of code to figure out the context. Um. Action is a noun, right? Oh, I get it. You mean action as a verb. Thanks for sharing your learnings. Way to leverage the synergy! WTF?

    Call me the Lord of Lego Logo.

  • (cs) in reply to themagni
    bool yes = foo && bar && tar;

    I'm reeling from the sheer WTFness of a boolean named 'yes'.

  • (cs) in reply to me

    Anonymous:
    Anonymous:
    Anonymous:
    Er, no. It's considered a Good Thing to write code that is easy to read. Excessive verbosity and superfluous <FONT color=#008000>sesquipedalianism are</FONT> not, even in exceptional circumstances, admirable contributions to the legibility of ones programmatic endeavours, <FONT color=#000000>and</FONT> one should be abstemious in the employment of such.


    Roget's Thesaurus? (nice touch, wink! wink!)
    Why is it so hard to believe that someone can write that off the top of his head?

    Well, it is grammatically incorrect. Perhaps the words wasn't checked properly before posting.

  • LKM (unregistered) in reply to rmg66
    rmg66:

    PS_1: InsteadOfCamelCasing, lets_all_try_to_use_the_underscore. Much_easier_to_read!



    Please use Java Coding Conventions when writing Java Code. I agree that the Java Wizard example is a bit extreme, but if I have a choice between short, unreadable method names and long, unreadable method names which at least convey what the hell they're doing, I'm all for the latter.
  • Duckie (unregistered) in reply to themagni

    Fregas:

    There's no dress code where I work. I wear slacks, a nice shirt - with an undershirt - and nice, comfortable shoes. (And yes, for the literalists, I also wear underwear, socks, a belt, two rings, and an ID badge.) That's because I want to portray a presentable, knowledgeable, and professional image. Dress like a homeless guy and you'll be respected like a homeless guy.

    Same where i work. I usually equip 2 of these http://en.wikipedia.org/wiki/Brass_knuckles when having to speak to my boss.

    /Duckie

    CAPTCHA: bedtime

  • (cs) in reply to Some Idiot
    Some Idiot:

    Anonymous:
    Anonymous:
    Anonymous:
    Er, no. It's considered a Good Thing to write code that is easy to read. Excessive verbosity and superfluous <font color="#008000">sesquipedalianism are</font> not, even in exceptional circumstances, admirable contributions to the legibility of ones programmatic endeavours, <font color="#000000">and</font> one should be abstemious in the employment of such.


    Roget's Thesaurus? (nice touch, wink! wink!)
    Why is it so hard to believe that someone can write that off the top of his head?

    Well, it is grammatically incorrect. Perhaps the words wasn't checked properly before posting.



    No, it isn't. It's just that the grammar checker is confused by all the long words.
    OTOH, "the words wasn't checked" is grammatically incorrect.

  • (cs)
    Billy:
    I wrote this class the other day.  Is the class name too long for you?  Should I have just used ACTSCT?

    <font size="2">public abstract class AbstractCorpTransactionalSpringContextTests extends
            AbstractTransactionalSpringContextTests {

        /* (non-Javadoc)
         * @see org.springframework.test.AbstractDependencyInjectionSpringContextTests#getConfigLocations()
         */
        protected String[] getConfigLocations() {
        }

    }

    </font>


    Wow!  Well, actually I see code like this once a week or so.  Take a deep breath, step back from the keyboard.  Are SIX words really required to describe your class?  Don't you think something is fundamentally wrong here?

     If I saw this code where I work, you'd be invited over for chat, then out for beers if you could explain your thinking well.  At the end of the day, code like this would vanish from our codebase!




  • Billy (unregistered) in reply to gorobei

    Ohhh snap, I was waiting for that.  The class I extend comes from the Spring Framework.  Yeah, those guys don't know what they are doing in the Java world rolls eyes.  At the end of the day, if code like that vanished from your codebase, you probably end up with the same WTF crap I see everywhere else.

  • (cs) in reply to Billy

    Billy,

    Those guys obviously do know what they're doing in the Java world.  They've take a weak OO language and built a good OO framework in it (i.e. all the meta stuff and dynamism you expect in CLOS, etc.)  But at the end of the day, you wind up having to write a lot of code to fight Java's lack of expressive power, and you tend to wind up with verbose names just to keep everything straight in your own mind (a solution that, sadly, occurs often - witness the nightmare of Hungarian notation.)

    I think most of the WTF crap we see, at least on dwtf, is produced by incompetents:  no framework or language will every help the authors produce anything worthwhile.

    What irks me about the endless enterprise layers on top of Java is that managers repeated the same mistakes they made with Cobol, etc:  seeing that only the top 10% of the programmers seemed to produce anything useful, they bought into B&D disciplines with the hope of making, say, the top 50% productive.  All this succeeded in doing was lowering overall productivity by reducing the effectiveness of the few good programmers.

  • Wang-Lo (unregistered) in reply to lomaxx
    lomaxx:
    ...like in highschool when I accidentally set a girls hair on fire..l. 
    Not to wander too far off topic, but I just have to ask: what were you actually trying to do to her?

    -Wang-Lo.

  • Matej (unregistered) in reply to actionscripted

    Of course, it has that -- Ctrl-P :-)

  • Jon (unregistered) in reply to Alexis de Torquemada
    Alexis de Torquemada:
    themagni:
    Frankly, if someone can't figure out how to use deodorant or how to get their belt to match their shoes I have no faith in their ability use a debugger or work out the finer points of an interface.

    Sad to hear you're such a superficial little fuckhead. Maybe I'm just too blind to see what wearing a phalilc symbol round my neck will do to improve my coding or other mental abilities. Intuitively, I would say that the only possible effect is to impede blood circulation to an organ much involved in these activities.

    I myself have found that while many capable developers do groom, the only IDE most of the suits are really experts at is Powerpoint.


    Wow - talk about lashing out!  You've gone from one extreme to the other, don't you think?  Regardless of capability, a person who chooses not to groom (at least a little bit) is going to be viewed differently than one who does; that's just human nature.  While I disagree that a tie is somehow necessary, I think that there has to be some level of effort.

    My point is that I agree with both of you in certain respects
    1.  A person who pays little attention to their own hygiene, regardless of ability, is hard to take seriously
    2.  A person does not automatically get respect based on their outward appearance.

    My code doesn't get better if I'm wearing a tie - but it's far easier to work with my team if I (they) don't smell bad.  And it's a LOT easier to get along with management if our clothing is presentable (they don't understand what we do anyway)

  • (cs) in reply to Jon



    <font color="#ff0000" size="+3">END OF HYGIENE FLAMEWAR</font>


    Any further attempt to post another off-topic post about hygiene, smell, deodorant etc. will end here.

  • (cs) in reply to ammoQ
    ammoQ:
    _________________________________________________________________________

    <FONT color=#ff0000 size=+3>END OF HYGIENE FLAMEWARE</FONT>
    _________________________________________________________________________

    Any further attempt to post another off-topic post about hygiene, smell, deodorant etc. will end here.

    <FONT face=Tahoma>I'm starting to like this moderation method... :)

    Uh, "Flameware"? Is this some kind of flame generating software?



    </FONT>
  • (cs) in reply to xrT
    xrT:

    <font face="Tahoma">I'm starting to like this moderation method... :)

    Uh, "Flameware"? Is this some kind of flame generating software?
    </font>


    Thanks, fixed that. Worked anyway (it always does, one way or another)
  • (cs) in reply to woohoo
    Anonymous:
    Well, descriptive (and therefor possibly long) names are not a bad thing per se (perhaps the "Java Wizard" used to be an "Ada Wizard" before ;o), but this holds mainly for identifiers that are publicly visible (like HasSpecificPermission() might be in the above sample - however, we do not see if that is so, I'm merely assuming it).

    There is a minor WTF here, because naming conventions demand the first letter of methods to be lower case, and putting the parentheses on single lines is inane. "SpecificApplicationPermissions.CompleteClosingStep" might also be questionable depending on it's declaration: if it is a publicly modifiable attribute, it violates the concept of encapsulation, if it is a constant, it violates the naming convention for constants (all uppercase) - a "Wizard" should know all this.

    There is OTOH not a lot of sense for local (!) variables like the 3 booleans to have names of around 40-50 characters. If one needs such long names because the method bodies have a LOC count of 200+ lines (or perhaps 1000+...I've seen that), then the problem is most probably lurking elsewhere, the developer is obviously writing procedural code with an OO language...

    I'd not consider this a real bad case of a WTF, "self documentation" of code is not bad, replacing the overly long local variable names with code comments would be better still.

    CAPTCHA: poprocks :o)



    It's probably in C#, and the permissions are probably an enum. And what's wrong with "AppPermissions"?

    The WTF is that this guy was a 'wizard'

  • (cs) in reply to Cynix
    Anonymous:
    <font size="2"><font face="Arial">And I would like to see some of the VariableNamesShouldBeOverlyDescriptive crowd getting any productivity without the pampering of an auto-completing IDE. Remember that short naming conventions have been around since before there *was* such a thing as an IDE.

    What this universe needs is a version control system that has an option on check-out: 'Novel mode' and 'Program mode', where 'Novel mode' automagically replaces variable names by the comment in the declaration.
    </font></font>


    I've yet to see anyone come up with aDecentReasonToUseReallyLongNames. "they sort the same alphabetically" is a bad reason  - I hate the way Visual Studio sorts method names alphabetically. Everything should appear in the order it was defined! (or there could be a button beside the dropdown to toggle) VS is obviously designed for people who don't know the code, and designed to reduce productivity of people who do know the code, resulting in higher turnover at companies using VS, thus resulting in more people who don't know th ecode.

    And besides, there's no reason you can't make the names sort together alphabetically and also use shorter names.

    I also hate IntelliSense. Half the time it picks the wrong thing, and it's used as an excuse to make names overly verbose. I also have to use it, because error codes are Constants.blah.blah.blah.blah.errors.BlahBlahFailedBecauseBlah (the reason for all the .s is because intellisense sucks - decent autocomplete would merge similar prefixes, and for AaBbCcDd and AaBbEeDd show "AaBb...").

    Anonymous:
    Maybe it's just me, but I'll take long (even overly long) variable names over short ones any day. I'd have IsUserValidatedAgainstSomeSystem over the half-assed, AOLICQJABBERAIM generation text-speak of IsUsrValSys.


    Code readbility is the inverse of time it takes for you to figure out what the hell a particular function does. The people advocating short names are proposing stuff like canSign, canApprove, canClose. These are GOOD names - anyone reading the code, knowing the relevant context, will know what the variables mean. Anyone who doesn't know the context won't be helped much by longer variable names.

    Variable names should be concise but meaningful. In particular, I should only need to read about the first three words to figure out what the hell it means. Differentiating variables by how they end is
    one of the more horrible things about IntelliSense - who can read that far?

    And underscores are better for reallyreallylongnames - they make it a lot easier to find the start of words when skimming. CamelCase or camelCase is good for making names short, but useless when your names are already gigantic.
  • woohoo (unregistered) in reply to TeeSee
    TeeSee:
    Anonymous:
    Well, descriptive (and therefor possibly long) names are not a bad thing per se (perhaps the "Java Wizard" used to be an "Ada Wizard" before ;o), but this holds mainly for identifiers that are publicly visible (like HasSpecificPermission() might be in the above sample - however, we do not see if that is so, I'm merely assuming it).

    There is a minor WTF here, because naming conventions demand the first letter of methods to be lower case, and putting the parentheses on single lines is inane. "SpecificApplicationPermissions.CompleteClosingStep" might also be questionable depending on it's declaration: if it is a publicly modifiable attribute, it violates the concept of encapsulation, if it is a constant, it violates the naming convention for constants (all uppercase) - a "Wizard" should know all this.

    There is OTOH not a lot of sense for local (!) variables like the 3 booleans to have names of around 40-50 characters. If one needs such long names because the method bodies have a LOC count of 200+ lines (or perhaps 1000+...I've seen that), then the problem is most probably lurking elsewhere, the developer is obviously writing procedural code with an OO language...

    I'd not consider this a real bad case of a WTF, "self documentation" of code is not bad, replacing the overly long local variable names with code comments would be better still.

    CAPTCHA: poprocks :o)



    It's probably in C#, and the permissions are probably an enum. And what's wrong with "AppPermissions"?

    The WTF is that this guy was a 'wizard'

    Probably in C#? In a posting about a "JAVA wizard"? Duh...

  • (cs) in reply to Michael Nixon

    >> Captcha: awesomeness
    Which is exactly what PHP and MS Access working together are... Yes, they *can* interact. Yes, there are library methods for doing so. (It might be easier than writing a script to pull everything from an Access db and put the data into a mySql db; I don't know, I did the latter, as it was a 1-time thing. The former is certainly more useful for ongoing access.)

    >>

     

     

    What you dind't use the nice MyODBC ?  Install it, go to Access, select table, and done.

     

     

  • (cs) in reply to themagni



    // Get Current Interactive User's Permissions for
    //  CompleteClosingStep, HasSpecificPermission,
    //  and CompleteApprovalStep
    bool foo = user.okay( permit.CompleteClosingStep );
    bool bar = user.okay( permit.InitailizeClosingStep );
    bool tar = user.okay( permit.CompleteApprovalStep );

    // Determine if Current Interactive User is authorized
    // for the Renegotiation Action, which requires that
    // the user has CompleteClosingStep, HasSpecificPermission,
    // and CompleteApprovalStep
    bool yes = foo && bar && tar;

    Let the class madness be acceptable. What he's got is three booleans created expressly for the purpose of setting another boolean - that is not in the "user" object. What this says to me is that he's not even totally clear on the class concept, and he's using the huge names to obfuscate his code while disguising it as "self-documenting".

    It also says that it's lunchtime.

     I agree, could just be

    boolean allOkay = user.allOkay(permit);

    or possbly boolean allOkay = this.checkPermissions(user, permit); sice the user object shouldn't know how to check its own permissions and a permit shouldn't know what a user is (maybe)..

      

  • Twey (unregistered)

    Hm... functional code in VBA? I think not.

  • hoodaticus (unregistered) in reply to tthomas48
    tthomas48:
    The wtf here is that there are projects that have kick off meetings that are standing room only. I'd start looking for another job.

    Heh heh heh heh! Amen!

Leave a comment on “The Java Wizard”

Log In or post as a guest

Replying to comment #:

« Return to Article