Comment On Mybad

"At my company," writes Ryan L, "we have a 'certain' developer who has been here a while but is very reluctant to learn or improve. In fact, he actively works against the rest of us when we want to implement pesky things like proper version control, design patterns, or architecture to our code behind having 3000-line code-behind files." [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: Mybad

2012-05-03 11:14 • by ArcLight (unregistered)
380321 in reply to 380274
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

Re: Mybad

2012-05-03 11:53 • by XXXXX (unregistered)
380322 in reply to 380320
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.

Mybad PIC X(80)

2012-05-03 12:12 • by Peter (unregistered)
380323 in reply to 380306
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!

Re: Mybad

2012-05-03 12:39 • by 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.

Re: Mybad

2012-05-03 12:55 • by Mr.Bob (unregistered)
380327 in reply to 380318
Nagesh:
Why is Alex robing readers by not post article? Last two have not even been WTF :(


Indeed. I demand a refund.

Re: Mybad

2012-05-03 13:17 • by Jay (unregistered)
380330 in reply to 380268
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.

Re: Mybad

2012-05-03 13:22 • by Jay (unregistered)
380331 in reply to 380294
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.

Re: Mybad

2012-05-03 13:26 • by Jay (unregistered)
380332 in reply to 380318
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.

Re: Mybad

2012-05-03 13:49 • by EmosaurusRex (unregistered)
TRWTF is "I was exploring our SVN logs". Time for some motherfucking programming kiddo.

Re: Mybad

2012-05-03 13:59 • by ObiWayneKenobi
380334 in reply to 380278
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.

Re: Mybad

2012-05-03 14:12 • by Anon (unregistered)
380335 in reply to 380334
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?

Re: Mybad

2012-05-03 14:19 • by Nagesh
Making modification to Config file is thing of past. Now convention over configuration will rule till something new is going to come.

Re: Mybad

2012-05-03 14:20 • by Nagesh
380337 in reply to 380322
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.

Re: Mybad

2012-05-03 14:37 • by Nagesh
380338 in reply to 380305
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.

Re: Mybad

2012-05-03 14:49 • by ObiWayneKenobi
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.

Re: Mybad

2012-05-03 14:58 • by Joe (unregistered)
380340 in reply to 380332
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.

Re: Mybad

2012-05-03 15:52 • by APL_Troll (unregistered)
380341 in reply to 380338
Real programmers use APL.
Java, C, C# etc are for sissies.

Re: Mybad

2012-05-03 16:01 • by Roman (unregistered)
ALL HUNGARIAN NOTATION USERS SHALL BURN IN HELL!!!

Exception

2012-05-03 16:23 • by Frank (unregistered)
380343 in reply to 380289
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.

Re: Mybad

2012-05-03 16:36 • by shadowman
380344 in reply to 380311
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.

Re: Mybad

2012-05-03 16:53 • by Meep (unregistered)
380345 in reply to 380335
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

Re: Mybad

2012-05-03 18:35 • by 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

Re: Mybad

2012-05-03 18:55 • by Code monkey (unregistered)
The real WTF is still using XML when all the cool kids have moved onto JSON.

Re: Mybad

2012-05-03 19:16 • by barf4eva (unregistered)
woopdie doo... what a lame WTF today...

Re: Mybad

2012-05-03 21:02 • by fregas (unregistered)
The real WTF is that they are all using subversion. Everyone knows Microsoft VSS is king of source control.

Re: Mybad

2012-05-03 21:29 • by geoffrey, MCP, PMP (unregistered)
380354 in reply to 380352
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.

Re: Mybad

2012-05-03 22:13 • by pants (unregistered)
380355 in reply to 380354
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.

Re: Mybad

2012-05-03 22:32 • by 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.

Re: Mybad

2012-05-04 03:12 • by 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).

Re: Mybad

2012-05-04 04:36 • by Gibbon1 (unregistered)
380360 in reply to 380344
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.

Re: Mybad

2012-05-04 06:04 • by Anti-Nagesh (unregistered)
380361 in reply to 380336
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"

Re: Mybad

2012-05-04 07:39 • by Stig (unregistered)
He is bad and he know it

Re: Mybad

2012-05-04 08:45 • by KattMan
380368 in reply to 380356
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.

Re: Mybad

2012-05-04 08:58 • by 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.

Re: mybad

2012-05-04 09:31 • by no laughing matter
380371 in reply to 380280
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.

Re: Mybad

2012-05-04 10:34 • by PedanticCurmudgeon
380372 in reply to 380348
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."

Re: Mybad

2012-05-04 11:30 • by no laughing matter
380379 in reply to 380372
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.

Re: Mybad

2012-05-04 15:49 • by Z (unregistered)
380411 in reply to 380302
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.

Re: Mybad

2012-05-04 16:59 • by Gibbon1 (unregistered)
380418 in reply to 380372
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.

Re: Mybad

2012-05-05 08:40 • by Spudley (unregistered)
380429 in reply to 380273
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.

Re: Mybad

2012-05-05 15:00 • by Shinobu (unregistered)
380430 in reply to 380368
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.

Re: Mybad

2012-05-05 17:53 • by LOADING (unregistered)
380431 in reply to 380269
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.

Re: Mybad

2012-05-05 17:58 • by LOADING (unregistered)
380432 in reply to 380345
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.

Re: Mybad

2012-05-05 20:27 • by caper (unregistered)
Oh my, its like FORTRAN 77 all over again.

I'll take the self documenting code thanks.

Re: Mybad

2012-05-05 20:41 • by 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.

Re: Mybad

2012-05-05 22:13 • by blank (unregistered)
380437 in reply to 380436
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.

Re: Mybad

2012-05-06 11:27 • by dude no (unregistered)
380438 in reply to 380437
lsat post!

Re: Mybad

2012-05-07 15:09 • by Jammin on tha one (unregistered)
380513 in reply to 380355
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.

Re: Mybad

2012-05-08 12:26 • by Herr Otto Flick (unregistered)
380584 in reply to 380354
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.

Re: Mybad

2012-05-09 09:55 • by Aaron (unregistered)
380682 in reply to 380288
This ^

I've done this, usually I pick up on it when I diff before a checkin - but seriously this happens.
« PrevPage 1 | Page 2 | Page 3Next »

Add Comment