• ArcLight (unregistered) in reply to MartinD
    MartinD:
    He corrected the config so that the key used in the config matches the key used in the code. There is no WTF here.
    ^This
  • XXXXX (unregistered) in reply to dkf
    dkf:
    Shark8:
    Wait, what? C is not a strongly-typed language; implement a medium-sized project in Ada and you'll never think it is again.
    I'll have you know that I hit the keys with much force when writing in C! If that's not strongly typed, what is?

    I agree that C is not strongly typed. I always declare everything as byte arrays and cast on the fly when I absolutely have to.

  • Peter (unregistered) in reply to emaN ruoY
    emaN ruoY:
    I don't believe it! There was nothing in the computer world before 1970 Jan 01.
    Yes there was. There was punch cards. And before that we used ones and zeros. And when we ran out of zeros, we carved them out of gravel. And we liked it!
  • Vic (unregistered)

    The real WTF is one of Ryan's beloved developers, who always uses design patterns and loves hungarian notation because someone might think an email address is an instance of a stringButNotJustAnyGeneralSortOfStringButASpecialString had earlier checked in a 500 line update to the application where every use of ContactEmailAddress was changed to sContactEmailAddress because thats our standard and we can't let ContactEmailAddress appear at all because it might be confusing but the cherished developer who follows all of Ryan's picky little rules forgot that there was a config file.

  • Mr.Bob (unregistered) in reply to Nagesh
    Nagesh:
    Why is Alex robing readers by not post article? Last two have not even been WTF :(

    Indeed. I demand a refund.

  • Jay (unregistered) in reply to Chrisb
    Chrisb:
    If he was changing the key in the config file then someone else must have set the key to be that value in code.

    Or not. In which case we may have a problem.

  • Jay (unregistered) in reply to null
    null:
    <app key="sComment" value="Brillant!"/>

    For the earlier posters who don't "get it", this is a .Net config file value -- you don't set a schema anywhere, it's all just strings whether you like it or not.

    In any event, I don't think I've ever seen someone use hungarian in the NAME of a config value. That would be as dumb as creating a data entry form where the actual on-screen labels are "sName", "sAddress", "sPhone", etc.

    SCaptcha="sDamnum"

    Oh. I think I'd better quit messing around on this forum and get to taking the prefixes off all my data entry screen labels.

  • Jay (unregistered) in reply to Nagesh
    Nagesh:
    Why is Alex robing readers by not post article? Last two have not even been WTF :(

    It could be worse. He could be disrobing readers.

  • EmosaurusRex (unregistered)

    TRWTF is "I was exploring our SVN logs". Time for some motherfucking programming kiddo.

  • (cs) in reply to ThatGuy
    ThatGuy:
    Big deal, he added an s to the key with a dumb commit message. Sounds like the developer(s) had a gripe with this person. No WTF at all.

    Disagree. There is NO reason to use Hungarian Notation in modern code. The WTF here is clearly:

    A) The dev who checked this in added an obsolete naming convention to something that was the proper way before it

    B) The dev checked in ONLY this change as though it was some major feature.

  • Anon (unregistered) in reply to ObiWayneKenobi
    ObiWayneKenobi:

    Disagree. There is NO reason to use Hungarian Notation in modern code. The WTF here is clearly:

    A) (snip)

    B) The dev checked in ONLY this change as though it was some major feature.

    So, he fixed a showstopper bug in an application and he was supposed to wait to check it in until he had some major feature to bundle it with?

  • (cs)

    Making modification to Config file is thing of past. Now convention over configuration will rule till something new is going to come.

  • (cs) in reply to XXXXX
    XXXXX:
    dkf:
    Shark8:
    Wait, what? C is not a strongly-typed language; implement a medium-sized project in Ada and you'll never think it is again.
    I'll have you know that I hit the keys with much force when writing in C! If that's not strongly typed, what is?

    I agree that C is not strongly typed. I always declare everything as byte arrays and cast on the fly when I absolutely have to.

    Apart from that, C is of pratical use 0, since invention of java.

  • (cs) in reply to PedanticCurmudgeon
    PedanticCurmudgeon:
    Quicksilver:
    So the WTF is that people agreed on hungarian notation and one Dev fixed the notation of another?

    Or that one developer fixd other's code to his preferred notation?

    thats at most a W not a WTF

    Hungarian notation is always TRWTF.

    Real programmer use Reverse Polish Notation.

  • (cs)

    If it wasn't a bug, there's no reason to use Hungarian in modern code. The connotation I got from the article was that this dev arbitrarily decided to use Hungarian in a config file where it wasn't needed.

  • Joe (unregistered) in reply to Jay
    Jay:
    Nagesh:
    Why is Alex robing readers by not post article? Last two have not even been WTF :(

    It could be worse. He could be disrobing readers.

    Or he could be disCmdrTacoing readers.

    ObCaptcha: did somebody load a new dictionary? My browser didn't autocomplete this one.

  • APL_Troll (unregistered) in reply to Nagesh

    Real programmers use APL. Java, C, C# etc are for sissies.

  • Roman (unregistered)

    ALL HUNGARIAN NOTATION USERS SHALL BURN IN HELL!!!

  • Frank (unregistered) in reply to Severity One

    Few can be bothered with proper exception handling. Java and Python programs that just quit or at least abort when you are trying to do with a huge barf in a window saying "Exception"

    How about not quitting and trying to continue instead of aborting if there is an error?

    BitPim is an example if something goes wrong in a transfer it aborts the whole transfer. One phone book entry it doesn't like and it barfs and aborts the transfer. Better than the Java programs which just exit I guess.

  • (cs) in reply to Shinobu
    Shinobu:
    vt_mruhlin:
    He made a minor change to fix a stupid typo. ... on a commit like that, it's at least obvious why he made the change.

    It's the guy who checks in 300 lines worth of complicated changes with the message "fix a bug" that you have to worry about...

    I wholeheartedly agree. It's obvious that some other code needs the value of key to be sContactEmailAddress and if it's called differently, it either won't be used or it will give an error message. A silly typo, not a WTF.

    That's my thought also. Is has nothing to do with any preference for Hungarian notation -- it has everything to do with a variable name matching a key name.

  • Meep (unregistered) in reply to Anon
    Anon:
    ObiWayneKenobi:

    Disagree. There is NO reason to use Hungarian Notation in modern code. The WTF here is clearly:

    A) (snip)

    B) The dev checked in ONLY this change as though it was some major feature.

    So, he fixed a showstopper bug in an application and he was supposed to wait to check it in until he had some major feature to bundle it with?

    If you're anything like the clowns here, you sit on it for weeks and then commit with a message like, "bunch of changes."

    Is it really so fucking hard to run hg diff in one terminal, hg commit in another, and just summarize what's changed? God almighty. /rant

  • (cs)

    There's good Hungarian notation and bad Hungarian notation.

    Bad Hungarian notation tells you the language type that you're storing the data in, e.g. DWORD dwWindowWidth, String sContactEmailAddress.

    Good Hungarian notation tells the you semantic type of the data, e.g. DWORD dx, String emailContact. Note this is usually more specific than the language type.

    Often the prefix is enough (as in dx above.)

    http://www.joelonsoftware.com/articles/Wrong.html

  • Code monkey (unregistered)

    The real WTF is still using XML when all the cool kids have moved onto JSON.

  • barf4eva (unregistered)

    woopdie doo... what a lame WTF today...

  • fregas (unregistered)

    The real WTF is that they are all using subversion. Everyone knows Microsoft VSS is king of source control.

  • geoffrey, MCP, PMP (unregistered) in reply to fregas
    fregas:
    The real WTF is that they are all using subversion. Everyone knows Microsoft VSS is king of source control.

    Nice try, troll. VSS gave up the throne to Team Foundation Server, and Subversion only runs on MACs anyway.

  • pants (unregistered) in reply to geoffrey, MCP, PMP
    geoffrey:
    fregas:
    The real WTF is that they are all using subversion. Everyone knows Microsoft VSS is king of source control.

    Nice try, troll. VSS gave up the throne to Team Foundation Server, and Subversion only runs on MACs anyway.

    Quite right. I use Team Foundation Server, because there's no room for people who can't act in a team on my team. I once had my security team escort my entire programming team from the building for not acting like a team.

    Team. Team. Team. Team. Team. I even love saying the word team.

  • Christiqn (unregistered)

    I used to hate Hungarian Notation but when it is done right it is actulaly realy good.

    What is bad is when you have a vaiable like

    int nIndex;

    and some bone head comes and changes the vaiable type

    DWORD nIndex;p without renaming it to dwIndex; because that turns it from a help to sabotage.

  • Arno (unregistered)

    Not so bad, try working with a developer, that ignores your suggestions and where there's no documentation at all, not even quality assurance for code.

    They don't have release schedule, just code (oh it runs) then release. Btw, he also doesn't use version control.

    To learn the database structure i use poor mans sql query logging (tcpdump and percona utils).

  • Gibbon1 (unregistered) in reply to shadowman
    shadowman:
    That's my thought also. Is has nothing to do with any preference for Hungarian notation -- it has everything to do with a variable name matching a key name.

    And that's what freaks me out, Mr MyBad doesn't sound like the kind of person to use hungarian notation on his own. Which means it's being forced on him by the other developers. Which brings to mind something a child psychologist once mentioned to me about often finding that his putative patients are the only sane person in the family.

  • Anti-Nagesh (unregistered) in reply to Nagesh
    Nagesh:
    Making modification to Config file is thing of past. Now convention over configuration will rule till something new is going to come.
    Not a single spelling error! I almost thought this wasnt Nagesh until I read "....is going to come"
  • Stig (unregistered)

    He is bad and he know it

  • (cs) in reply to Christiqn
    Christiqn:
    I used to hate Hungarian Notation but when it is done right it is actulaly realy good.

    What is bad is when you have a vaiable like

    int nIndex;

    and some bone head comes and changes the vaiable type

    DWORD nIndex;p without renaming it to dwIndex; because that turns it from a help to sabotage.

    Which is why I dislike Hungarian notation for variable type, just name the variable as to what it does or the domain it is in and be done with it.

    I have seen type change far to often, usually by people that shoudl know better. People ask for a phone number field and the guy makes a var iPhoneNumber completly forgetting that a phone number is NOT a number, it IS a string that happens to use a subset of characters, namely digits, you need to maintain any leading 0's, same with zip codes and SSN's. You have no idea how many times I have seen these defined as ints or longs first.

    As for renaming them, if it is exposed from a library you need to parse through every possible assembly that might access it to see if it does and change it there. Refactoring things like this is just bad so should not use hungarian notation for type. No compromise on my end there.

  • Mike (unregistered)

    Yeah, I don't like using it for data type either.

    I've found it can be helpful to stick a prefix on member variables to identify them as such.

  • (cs) in reply to Matt Westwood
    Matt Westwood:
    So let me get this right: the real WTF is that his commit message ought to have been "myBad"? Or "sMyBad"? Come on, do tell ...
    No, the actual commit message is "yBad", but he correctly wrote it in nHungarianNotation.
  • (cs) in reply to Maurits
    Maurits:
    There's good Hungarian notation and bad Hungarian notation.

    Bad Hungarian notation tells you the language type that you're storing the data in, e.g. DWORD dwWindowWidth, String sContactEmailAddress.

    Good Hungarian notation tells the you semantic type of the data, e.g. DWORD dx, String emailContact. Note this is usually more specific than the language type.

    Often the prefix is enough (as in dx above.)

    http://www.joelonsoftware.com/articles/Wrong.html

    I was just complaining about this sort of thing in the sidebar the other day. The tl;dr version of what I said is: "Here's a nickel, kid. Go get yourself a real type system."

  • (cs) in reply to PedanticCurmudgeon
    PedanticCurmudgeon:
    I was just complaining about this sort of thing in the sidebar the other day. The tl;dr version of what I said is: "Here's a nickel, kid. Go get yourself a real type system."
    My type system is more turing-complete than your type system!

    (Unfortunately i never know if my compiler is still working checking the types ...)

    In fact state of the art are dependant type systems.

  • Z (unregistered) in reply to vt_mruhlin

    But he IS that guy. And the guy who uses variable names like 'q' and 'whatever' just because he has no imagination. And the guy who keeps all of his code checked out of the repository for three months, then complains that he has merge conflicts. And the guy... Well, you get the point.

    Every company, sooner or later, has 'that guy'. They come in different flavors, with different degrees of competence, but their fingerprints are unmistakeable.

  • Gibbon1 (unregistered) in reply to PedanticCurmudgeon
    PedanticCurmudgeon:
    Maurits:
    age type.

    Often the prefix is enough (as in dx above.)

    http://www.joelonsoftware.com/articles/Wrong.html

    I was just complaining about this sort of thing in the sidebar the other day. The tl;dr version of what I said is: "Here's a nickel, kid. Go get yourself a real type system."

    This exactly what I was thinking. Really you should have a an untrusted string type to store user input. Attempts to send user supplied data to web form, or as part of an SQL command should result in type error at compile time.

  • Spudley (unregistered) in reply to Kasper
    Kasper:
    XXXXX:
    I remember back when the internet was young and all contact email addresses were dates.
    Today anybody can get all the email addresses they want. Must have been great back then if anybody could get all the dates they wanted.

    That's all very well, but we all know what having too many dates can do to your system.

    Ewww.

  • Shinobu (unregistered) in reply to KattMan
    KattMan:
    People ask for a phone number field and the guy makes a var iPhoneNumber completly forgetting that a phone number is NOT a number, it IS a string that happens to use a subset of characters, namely digits, you need to maintain any leading 0's
    But then it's just a number with an implicit leading 1. It's only when you have to preserve dashes and hook flashes that a number won't suffice. And you have to worry about the digit count. A 32-bit integer will allow you to store only 9 digits, which is generally not enough for North American phone numbers, not even for numbers within a state, since some have more than four NPAs. In many countries though, it's enough if you only intend to use national numbers, in which case you always have exactly 1 prefix zero, which you can lob off. But if you intend to allow international phone numbers you always have to use a 64-bit integer, which is long enough since the ITU limits telephone number length to 15 digits including country code (there is a claim floating around on the web about what supposedly is the longest telephone number; it's twice as long and a hoax). In any case, whatever encoding scheme you intend to use, a telephone number is neither a number, nor a string. You should write a special class for it that can't be accidentally mixed up with other things and use that.
    Gibbon1:
    This exactly what I was thinking. Really you should have a an untrusted string type to store user input. Attempts to send user supplied data to web form, or as part of an SQL command should result in type error at compile time.
    I agree. Hungarian notation is generally just an excuse not to write the code in a type-safe fashion. The only situation I've ever come across that makes me fix a warts to names is when I design dialogue boxes in VB. You often have a label and an associated text box. Since I don't refer to the labels in code I'd really rather not name them at all, but the IDE doesn't let me do that and since I don't want to leave them as Label<n> I tend to use a l<text box name> scheme.
  • LOADING (unregistered) in reply to Anonymous Coward
    Anonymous Coward:
    It's an XML file: all the values are strings.

    Exactly why you might want something to tell the receiver what it's getting although personally I would use an attribute (if not a DTD or somesuch) or something here rather than Hungarian to keep it atomic and machine readable.

  • LOADING (unregistered) in reply to Meep
    Meep:
    Anon:
    ObiWayneKenobi:

    Disagree. There is NO reason to use Hungarian Notation in modern code. The WTF here is clearly:

    A) (snip)

    B) The dev checked in ONLY this change as though it was some major feature.

    So, he fixed a showstopper bug in an application and he was supposed to wait to check it in until he had some major feature to bundle it with?

    If you're anything like the clowns here, you sit on it for weeks and then commit with a message like, "bunch of changes."

    Is it really so fucking hard to run hg diff in one terminal, hg commit in another, and just summarize what's changed? God almighty. /rant

    Yes because checking in 1 character is a waste of a -m (very bad ration because even the -m it 2x making some massive overhead) with next arg length significantly > 1 char (I mean fuck, the space and "" alone does that), and one must wait until the diff shows many characters changed and multiple lines to make it feel worth while (even if massively unrelated), but then if you have a boss who checks every commit within 5 minutes kill yourself problem solved guys.

  • caper (unregistered)

    Oh my, its like FORTRAN 77 all over again.

    I'll take the self documenting code thanks.

  • Captain troll (unregistered)

    The only TRWTF thing here is that you all, Nagesh included, are only pedantic wimps that find enjoyment in ridicule things that are obviously, blatantly wrong. It's like beating a dead dog or fighting with a barbie doll. You are a disgrace for the real nerd community. Study and be brillant frist before posting here or I promise I will destroy you with my troll powers.

  • blank (unregistered) in reply to Captain troll

    i do hope this guy becomes a regular i'll take his posts as "thread closed" (hence the top-posting)

    Captain troll:
    The only TRWTF thing here is that you all, Nagesh included, are only pedantic wimps that find enjoyment in ridicule things that are obviously, blatantly wrong. It's like beating a dead dog or fighting with a barbie doll. You are a disgrace for the real nerd community. Study and be brillant frist before posting here or I promise I will destroy you with my troll powers.
  • dude no (unregistered) in reply to blank

    lsat post!

  • Jammin on tha one (unregistered) in reply to pants

    Ill admit TFS is really good nowadays. I'm also an admitted microsoft junkie.

    But if cost was no object, Borland Starteam is THE best SCC system on the planet. Anyone who says otherwise simply hasn't tried it yet. The fact that it costs 5 times TFS (per developer/subject to features used) also doesn't help it get more market penetration.

  • Herr Otto Flick (unregistered) in reply to geoffrey, MCP, PMP
    geoffrey:
    fregas:
    The real WTF is that they are all using subversion. Everyone knows Microsoft VSS is king of source control.

    Nice try, troll. VSS gave up the throne to Team Foundation Server, and Subversion only runs on MACs anyway.

    I only play Team Foundation Classic Server as demo man.

  • Aaron (unregistered) in reply to Nicole

    This ^

    I've done this, usually I pick up on it when I diff before a checkin - but seriously this happens.

Leave a comment on “Mybad”

Log In or post as a guest

Replying to comment #:

« Return to Article