Mybad

  • Timeroot 2012-05-02 20:09
    sFrist = "Frist", then?
  • K41184 2012-05-02 20:11
    My first 2nd
  • Callin 2012-05-02 20:15
    uhoh

    myfrist
  • Chrisb 2012-05-02 20:26
    If he was changing the key in the config file then someone else must have set the key to be that value in code.
  • Anonymous Coward 2012-05-02 20:49
    It's an XML file: all the values are strings.
  • Andrew 2012-05-02 21:29
    His bad indeed :p
  • XXXXX 2012-05-02 21:32
    Anonymous Coward:
    It's an XML file: all the values are strings.

    But that string could have been an integer, a date, or a float.
    Don't you know xml schema?????

    I remember back when the internet was young and all contact email addresses were dates. I could be contacted at 04-21-1628.
  • Cheong 2012-05-02 21:40
    His bad is because the configuration use a key that's not the same as the key being used in code, of course it's "Mybad".

    The comment on whether it's a string is irrelevent because it should be on seperate schema file, as most configuration files are.

    If not, it's TRWTF(TM).
  • Kasper 2012-05-02 21:40
    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.
  • MartinD 2012-05-02 21:47
    He corrected the config so that the key used in the config matches the key used in the code. There is no WTF here.
  • ¯\(°_o)/¯ I DUNNO LOL 2012-05-02 21:59
    <tApp aKey="sContactEmailAddress" aValue="addrJdoe@initrode.com"/>
    Dumbass. He forgot to put warts on the tags and attributes. Fixed.
  • pez 2012-05-02 22:16
    architecture to our code behind having 3000-line code-behind files


    Mybad.
  • Drone 2012-05-02 22:25
    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.

    But... she told me she had to wash her hair!
  • ThatGuy 2012-05-03 00:51
    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.
  • Severity One 2012-05-03 02:29
    Well, me being responsible for Subversion in our company, I complained to one of our developers that he never put in a commit message, always leaving it empty. He solved that by no longer committing his code (as I found out after he left).
  • Matt Westwood 2012-05-03 02:29
    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 ...
  • TheRider 2012-05-03 02:48
    Severity One:
    Well, me being responsible for Subversion in our company, I complained to one of our developers that he never put in a commit message, always leaving it empty. He solved that by no longer committing his code (as I found out after he left).
    Ouch
    ...or was it just as well that his code "undid" itself?
  • sirhegel 2012-05-03 03:39
    csMyBad to indicate that it is a comment string.
  • Hatshepsut 2012-05-03 03:46
    Ryan you're an idiot.
  • Lord0 2012-05-03 03:53
    What a rubbish WTF. Try harder.
  • Kryptus 2012-05-03 03:57
    <app key="sUselessComment" value="MyBad" />

    <app key="sCaptcha" value="Genitus - WTF ?" />
  • Alex Papadimoulis 2012-05-03 04:06
    Lord0:
    What a rubbish WTF. Try harder.

    Mybad.
  • Nicole 2012-05-03 04:21
    It might just be a more innocent mistake.

    Like opening the file, trying to save it, but mistyping the CTRL + S accidentally adding an s without noticing it and actually saving it a second try and committing it (without running tests).

    My suggestion: ask questions about people's intentions, instead of assuming and pointing the finger.
  • Severity One 2012-05-03 04:38
    TheRider:
    Severity One:
    Well, me being responsible for Subversion in our company, I complained to one of our developers that he never put in a commit message, always leaving it empty. He solved that by no longer committing his code (as I found out after he left).
    Ouch
    ...or was it just as well that his code "undid" itself?
    Put it this way: he's a brilliant programmer, but also bone-lazy.

    So whilst he would develop really sophisticated things (involving reflection, automatic bytecode generation, and similar magic), he could never be bothered by such things like generics or proper exception handling, and he really had a fondness of arrays and static methods and members.
  • Quicksilver 2012-05-03 04:45
    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
  • Ron 2012-05-03 05:29
    Committing code without viewing the changes and without running tests is not an innocent mistake.
  • Boris 2012-05-03 05:43
    Haven't you read the article? He corrected value , but without using design patterns! Bad boy, bad boy, err....The article suggests rest of the team would have :-)
  • null 2012-05-03 06:15
    <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"
  • Verdict 2012-05-03 07:02
    TRWTF is this getting posted at all.

    Captcha: opto - This is not opto snuff
  • Geoff 2012-05-03 07:06
    You know I have had this fight before. I know there are lots of haters but I Hungarian notation is often useful in code, especially when working with languages that are not strongly typed, or offer 'features' like a variant type in an otherwise strong typed system.

    When it comes to config files though I am all for striping off 's', 'i', 'o', etc and otherwise preserving the variable name. End users sometimes see config files especially when working with support. These things don't mean anything to them and it just makes the file harder to talk about, with them.

    Working with code its never been difficult for my imagination to guess that SystemName="SomeName", read from a config file most likely gets stored in this variable sSystemName I am seeing all over the start up module.
  • rfoxmich 2012-05-03 07:25
    TRWTF is XML right?
  • Ralph 2012-05-03 07:30
    Geoff:
    End users sometimes see config files
    Oh the horror! The humanity! Please, make it stop!

    Users are only ever to see pictures. Cartoons. No words. No letters. The keyboard is very scary. Haven't you been paying attention the last 30 years?
  • vt_mruhlin 2012-05-03 08:21
    That's really kind of a stretch to call that a WTF. He made a minor change to fix a stupid typo. Sure, the commit message could use a little work, but 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...
  • Mike 2012-05-03 08:58
    vt_mruhlin:
    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...

    Guilty.
  • PedanticCurmudgeon 2012-05-03 09:08
    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.
  • emaN ruoY 2012-05-03 09:11
    XXXXX:
    Anonymous Coward:
    It's an XML file: all the values are strings.

    But that string could have been an integer, a date, or a float.
    Don't you know xml schema?????

    I remember back when the internet was young and all contact email addresses were dates. I could be contacted at 04-21-1628.


    I don't believe it! There was nothing in the computer world before 1970 Jan 01.
  • English Man 2012-05-03 09:17
    he did a commit with no indication of what the commit was for, simply to add a Hungarian Notation prefix to a configuration file setting
    So it didn't need a commit comment then did it?
  • MCoder 2012-05-03 09:19
    Quicksilver:
    So the WTF is that people agreed on hungarian notation...


    Yes, I'd guess so. It seems there is only one sane dev at that shop.
  • ekolis 2012-05-03 09:37
    Hmm, VB.NET has the My namespace, used for configuration (My.Settings) as well as accessing standard Windows locations (My.Computer)... perhaps it needs a My.Bad class to store examples of horrible code that if the compiler finds it in your project, it flags it as an error! :D
  • Mike 2012-05-03 09:45
    He may have just added a random character (in this case s) in front just to invalidate the key. Commenting it out.
  • Shinobu 2012-05-03 09:48
    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.
  • ¯\(°_o)/¯ I DUNNO LOL 2012-05-03 09:51
    Geoff:
    You know I have had this fight before. I know there are lots of haters but I Hungarian notation is often useful in code, especially when working with languages that are not strongly typed, or offer 'features' like a variant type in an otherwise strong typed system.
    Indeed. I'm not against "functional" warts being used in a strongly typed language like C, indicating such things as an iIterator or nNumItems.

    But then you get the WTFs like the guy in the cubicle next to me found, where a previous programmer had created a new variable simply so that he could use a different wart when he needed a variable to be 16 bits for a while, instead of 8 bits. This is in straight C code, not even C++.

    Ralph:
    Geoff:
    End users sometimes see config files
    Oh the horror! The humanity! Please, make it stop!

    Users are only ever to see pictures. Cartoons. No words. No letters. The keyboard is very scary. Haven't you been paying attention the last 30 years?
    We must start requiring everyone to use voice recognition and Kinect immediately. Then everyone can look just like Tom Cruise in Minority Report... or like a babbling mental ward escapee... if you can tell the difference.
  • RyansBad 2012-05-03 09:53
    Agreed. Ryan is an idiot.
  • tOmcOlins 2012-05-03 09:57
    Well I hope Ryan L enjoys his mug. This is the most disappointing TwoOrThreeTimesAWeekWTF in a long time.
  • hax0r 2012-05-03 10:12
    I'm not sure why this Ryan L. is bagging on the unnamed 'certain coder.' He insists that this developer is uninterested in learning or improving, yet the sample he provides shows said developer checking in an improvement to the code.
  • KattMan 2012-05-03 10:16
    ¯\(°_o)/¯ I DUNNO LOL:
    Then everyone can look just like Tom Cruise in Minority Report... or like a babbling mental ward escapee... if you can tell the difference.


    Wait, you mean there is a difference?
  • wonk 2012-05-03 10:18
    My god! It's full of strings!
  • Nagesh 2012-05-03 10:47
    Why is Alex robing readers by not post article? Last two have not even been WTF :(
  • Shark8 2012-05-03 10:53
    ¯\(°_o)/¯ I DUNNO LOL:
    Geoff:
    You know I have had this fight before. I know there are lots of haters but I Hungarian notation is often useful in code, especially when working with languages that are not strongly typed, or offer 'features' like a variant type in an otherwise strong typed system.
    Indeed. I'm not against "functional" warts being used in a strongly typed language like C, indicating such things as an iIterator or nNumItems.

    Wait, what? C is not a strongly-typed language; implement a medium-sized project in Ada and you'll never think it is again.
  • dkf 2012-05-03 10:59
    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?
  • ArcLight 2012-05-03 11:14
    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 2012-05-03 11:53
    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 2012-05-03 12:12
    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 2012-05-03 12:39
    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 2012-05-03 12:55
    Nagesh:
    Why is Alex robing readers by not post article? Last two have not even been WTF :(


    Indeed. I demand a refund.
  • Jay 2012-05-03 13:17
    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 2012-05-03 13:22
    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 2012-05-03 13:26
    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 2012-05-03 13:49
    TRWTF is "I was exploring our SVN logs". Time for some motherfucking programming kiddo.
  • ObiWayneKenobi 2012-05-03 13:59
    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 2012-05-03 14:12
    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?
  • Nagesh 2012-05-03 14:19
    Making modification to Config file is thing of past. Now convention over configuration will rule till something new is going to come.

  • Nagesh 2012-05-03 14:20
    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.
  • Nagesh 2012-05-03 14:37
    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.
  • ObiWayneKenobi 2012-05-03 14:49
    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 2012-05-03 14:58
    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 2012-05-03 15:52
    Real programmers use APL.
    Java, C, C# etc are for sissies.
  • Roman 2012-05-03 16:01
    ALL HUNGARIAN NOTATION USERS SHALL BURN IN HELL!!!
  • Frank 2012-05-03 16:23
    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.
  • shadowman 2012-05-03 16:36
    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 2012-05-03 16:53
    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
  • Maurits 2012-05-03 18:35
    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 2012-05-03 18:55
    The real WTF is still using XML when all the cool kids have moved onto JSON.
  • barf4eva 2012-05-03 19:16
    woopdie doo... what a lame WTF today...
  • fregas 2012-05-03 21:02
    The real WTF is that they are all using subversion. Everyone knows Microsoft VSS is king of source control.
  • geoffrey, MCP, PMP 2012-05-03 21:29
    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 2012-05-03 22:13
    geoffrey, MCP, PMP:
    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 2012-05-03 22:32
    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 2012-05-04 03:12
    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 2012-05-04 04:36
    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 2012-05-04 06:04
    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 2012-05-04 07:39
    He is bad and he know it
  • KattMan 2012-05-04 08:45
    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 2012-05-04 08:58
    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.
  • no laughing matter 2012-05-04 09:31
    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.
  • PedanticCurmudgeon 2012-05-04 10:34
    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."
  • no laughing matter 2012-05-04 11:30
    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 2012-05-04 15:49
    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 2012-05-04 16:59
    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 2012-05-05 08:40
    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 2012-05-05 15:00
    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 2012-05-05 17:53
    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 2012-05-05 17:58
    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 2012-05-05 20:27
    Oh my, its like FORTRAN 77 all over again.

    I'll take the self documenting code thanks.
  • Captain troll 2012-05-05 20:41
    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 2012-05-05 22:13
    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 2012-05-06 11:27
    lsat post!
  • Jammin on tha one 2012-05-07 15:09
    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 2012-05-08 12:26
    geoffrey, MCP, PMP:
    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 2012-05-09 09:55
    This ^

    I've done this, usually I pick up on it when I diff before a checkin - but seriously this happens.
  • Neil 2012-05-09 12:37
    Nagesh:
    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.
    Notation Polish Reverse Programmers Real Use.
    FTFY. (Assuming that Real, Reverse and Polish were prefix operators and Use was an infix operator.)
  • Captain troll 2012-05-10 08:21
    Meh
    Here we go: now there is all this buzz around TFS, VSS, etc.
    My (whathever thing) is holier than thou, but because...
    because what? where is the "argument"?
    Oh here it is: it is because <emphatic>I</emphatic> know that.
    What a bunch of weaklings you are.
    And come on, feed me. I'm hungry.
    Captcha: genitus
  • WTF 2012-05-10 20:31
    [quote user="Nagesh"][quote user="XXXXX"][quote user="dkf"]
    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.[/quote]

    Apart from that, C is of pratical use 0, since invention of java.[/quote]

    Java adds nothing to the programming world that C++ didn't already provide.