- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Or if it's followed by a detective. Then it's a prime suspect.
Admin
Admin
No, he didn't. And if "proper use of On Error Resume Next" isn't a good enough indication for you, you fail.
I certainly don't.
Admin
I lol'd. Thanks ;o)
Admin
Ok, then lets take python. You have a int variable iValue which has the value 2147483647. Now you add 1. What do you get? Right 2147483648L, a variable of the type long. So I don't care what type the variable is, it is some kind of integer. Something that can be used as a integer number. It could even be a complex object, if it emulates integers right. I don't care.
Admin
oops, misquoted.
BTW, does anyone realize that there is a limited dictionary for CAPTCHA and by posting your tests and marking them all very clearly, you make it quite possible to extract many of the words for a nice spam script? I know, the chances are slim, but still.
The funny thing is, if I just try submitting with no CAPTCHA, i get the same word again. :)
Admin
Admin
I'm under 18, I just know to keep my mouth shut and not look like a stupid little kid. No one will ever know the difference.
Admin
Admin
Don't encourage it. The more you point it out, the more they do it out of spite.
Uhhh....
Captcha: genitus. WTF is that? A super-hero with super-genital powers? Or Genitus, the God and Overlord of All Genitals!
Admin
Why would you call your variable something stupid like iValue? That means nothing. Call it count or amount, or countMsec - that's app-level HN, and it doesn't change when your datatype changes. The whole point of HN is a fairly consistent of naming variables semantically.
Admin
This whole thing is just making me ORNEry.
Admin
as the old fraud in house m.d. said:
i'm 21 ... unless it's relevant.
Admin
Can I just be god and overlord of all female genitals?
Admin
WOW. So basically, you know it all, and you hire based on whether or not applicants both agree with you on all things, and are willing to defer to you in all things.
And you wonder why you have a "problem" with new dev questioning things...
I'd run screaming from your shop, whether or not you are doing things right.
Admin
So when someone questions your methodologies, you throw some more of your code at them and impart some more of your knowledge? That sounds like a great way to weed out those pesky "know-it-alls"
Admin
1 is the only odd prime number, the rest are just regular primes ... ... ...
Admin
Yes but that is a Visual Studio (at least 2005 and prior. Haven't used 2008 so I can't say if MS did anything to improve things) problem not a C/C++ problem. The latest Eclipse has very excellent intellisense for C/C++ projects and very nice refactoring capabilities as well.
Admin
Admin
BASIC ?
Admin
C'mon, people, where's the meat? Access, XML, wooden tables ... there's so much more to life than fucking primes. Or even taking OERN seriously:
Sheesh. Man can't even spell FILE_NOT_FOUND properly."Only suitable...?"
And I'm still trying to get my head around the concept of a weakly-typed language that allows several (presumably distinct) variables with the same name (presumably in the same scope). Brainf*ck has nothing on this.
Admin
I was taking a college class in high school and the professor did all the tests and exams online. He used some 3rd party site that let him make the exam and send give him the results.
I took a peek at the source and one of the hidden fields had his email address as the place the results should go to. I made some changes to a local copy to include a junk email address of mine and hit submit.
Not only did it send the results to me, it also told me why I missed each question and gave the correct value. I shared that trick with the students 2 years behind me and it worked for them too.
Admin
I should have mentioned that it was an english class. Not one of my strong subjects.
Admin
nah.. he's just "Top Cod3r" :-)
Admin
Admin
Admin
OK, at first I thought this was complete idiocy as well, but reading over it again, I think it is great. Not only is it a good tongue in cheek post for TDWTF, but the trick questions would do a great job at weeding out poor candidates. Here are what I would expect to be the correct response to some of those questions:
Describe the proper use of On Error Resume Next. Answer: Only use it if it is your first VB program ever, and you are just copying and pasting code from a tutorial.
Why is it important to name your variables with a prefix that tells you what type it is? Answer: It's not! Hungarian notation is sloppy and bad coding style.
Some question about a 5-tier design without a facade that should have a facade. Answer: You should probably use a facade. [Code example of improvement]
I would guess that they had problems with people questioning the methodology they use since the applicants didn't realize these are trick questions and think that they actually use OERN, Hungarian notation, and complex 5-tier designs that should have facades but don't.
Admin
"When would you use 'On Error Resume Next'?" "About three in the morning."
Admin
nThat vIs advAwesome.
Admin
Sometimes this is a comment and sometimes it's not.
Admin
Lyle would have scored 100%.
Admin
FTFY.
/Grammar Nazi
PS Can we get back to finally now?
Admin
The ONE time where fnf would have actually made great sense and a great pun...
sigh
Admin
Sorry, I guess after all other angles have been depleted I'll come in from the grammar angle...
"Perusing through it"
You meant "leafing through it" or "reading through it", in the $3 word category, just stick with "perusing it".
Admin
I'm already sorry I posted the rant. It's late. Pre-apologies?
Admin
Incidentally, Hungarian Notation would be a seriously bad idea for Magyar. And the only advantage to the damn language is that it's trivial to pronounce (much like Turkish, if I may be permitted to start a small and obscure flame war over asiatic languages).
I'm sure that nCharles_ pnSimonyi would agree with me on this one.
Admin
e^(pi*i) = -1
It drops right out of Euler's formula. It freaked me out too when I first saw it when I was 17, coming across it in an essay by Arthur C. Clarke (IIRC). By the time I was 19, taking a 2nd year linear algebra course, it was blindingly straightforward. Wikipedia has a really good page on it, actually.
Cheers!
Admin
Has anybody else spotted the error in logic that those who are defending Hungarian notation are using? They argue that Hungarian notation is required because that there are IDEs that do not allow you to mouse over a variable and see what type it is. Another user then mentioned that there is a name renaming dilemma that arises when you change the variable's type. In response, they state that any good IDE will allow you to quickly and easily rename all instances of that variable within seconds. In order for this to be a valid argument, they would have to assume that anybody using Hungarian notation does not have access to an IDE that will tell you the variable's type upon mouse over, but which tracks each instance of the variable nonetheless, so that it can easily be changed to a different name should it be required.
This brings your number of possible uses of Hungarian notation down to an extreme niche market, in only those who are using IDEs that are of a very exact specification, one which is extremely unlikely to exist.
Admin
Nice job!
Admin
Admin
Not to pick on anyone, but the point of Hungarian notation is NOT to tell you the type of a variable, such as int, long, unsigned, etc. It is to identify some other aspect of the use of that variable. For example, you could have an unsafe variable (string, int, whatever) identified by uVar1. This would let you know, by looking right at it, that setting safe variable sVar1 = uVar1 is wrong because you haven't done anything to make it safe, regardless of what it means to be safe.
It seems that most here are referring to MS Apps Hungarian Notation, which is wrong because it has you identify the explicit type and there really isn't any need for that.
Admin
Would I be right in saying that you, and anyone else, who failed to notice the sarcasm are American? Or some other breed of dumbass? The ideas that he's espousing are so obviously ridiculous that I am embarassed for you. Please try harder next time. The internet is not such serious business.
Admin
That would be all of them. Sure, that variable is an int, but so what? Proper HN is about conveying what it represents, and that's something semantic, not 'int'.
Admin
Sorry, but just because you can abuse a programming practice doesn't make it useless.
Admin
i love all the people who want a programmer who doesn't know how to program. go ahead. Hire your 'out of the box thinker'. i'd ask for someone who's not a self-admitted novice.
Admin
And here I was thinking we were going to get a story about diapers. That would have been a treat.
Admin
I think there's one article on the net that recommends using Hungarian for the safe/unsafe notation. I've read it too. Problem is, no one has actually implemented that in the real world, as far as I've seen. So prefixing your variables with "u" and "s" are more likely to cause your co-workers to go WTF, because they'll have no clue what it means unless you explain it. You'd be better off calling your variables "SafeVar1" and "UnsafeVar1".
On the other hand, prefixing variables with the data type is a pretty common practice. Other programmers are far more likely to intuitively know that a variable called "sXml" contains an XML string. Sure, you could call it "XmlString" instead of "sXml" but the latter is at least closer to some sort of standard.
Admin
Or, call it s because it's a string. If s us used, move on to t, or s1, etc.
Admin
Not saying this is a Good Idea or not, but I generally see it recommended for primitive error-catching
On Error Resume Next (do something questionable here) If (err.number) Then (bail yourself out) End If
I've used the construct a few times, but then, I'm using VBA in a non-programming environment (read: hack macros together as time-savers, not Professional Software Development), so take it as you will.
Admin
What was your point, again?