It Depends & Too Good To Be True

  • Brian 2008-08-26 11:21
    It depends on whether you want the job or not.
  • A. Bear 2008-08-26 11:23
    Personally, I was a bit confused over 1 not being a prime number. I am not a mathematician, so I went looking. A minute of searching and I found this:
    The number 1 is a special case which is considered neither prime nor composite (Wells 1986, p. 31). Although the number 1 used to be considered a prime (Goldbach 1742; Lehmer 1909; Lehmer 1914; Hardy and Wright 1979, p. 11; Gardner 1984, pp. 86-87; Sloane and Plouffe 1995, p. 33; Hardy 1999, p. 46), it requires special treatment in so many definitions and applications involving primes greater than or equal to 2 that it is usually placed into a class of its own. A good reason not to call 1 a prime number is that if 1 were prime, then the statement of the fundamental theorem of arithmetic would have to be modified since "in exactly one way" would be false because any n=n·1. In other words, unique factorization into a product of primes would fail if the primes included 1. A slightly less illuminating but mathematically correct reason is noted by Tietze (1965, p. 2), who states "Why is the number 1 made an exception? This is a problem that schoolboys often argue about, but since it is a question of definition, it is not arguable." As more simply noted by Derbyshire (2004, p. 33), "2 pays its way [as a prime] on balance; 1 doesn't."
    http://mathworld.wolfram.com/PrimeNumber.html
  • Outlaw Programmer 2008-08-26 11:25
    Marty McFly:
    I hope this does not affect my possible future employment with ------- in the past.


    Their problem was they weren't thinking fourth-dimensionally!
  • Top Cod3r 2008-08-26 11:31
    That test reminds me of the test that I personally designed for our department. I purposely tried to make it complex so we could weed out developers who think they know everything but don't. I like to start off with simple questions like the proper use of On Error Resume Next, and the importance of naming your variables with a prefix that tells you what type it is. Then I move on to more complex questions about theory, such as choosing between different application designs, 2-tier, 3-tier, 4-tier and 5-tier (with and without a facade). I then ask them other theory questions, such as "Name 3 disadvantages of the MVC design pattern".

    The last couple years, we have had problems with new developers questioning the code and methodology we use, so I decided to add some real-life questions with some actual code examples from our apps to make sure that they are willing to learn from my code and not think that they know it all.
  • gabba 2008-08-26 11:35
    So David passed up an opportunity with a promising startup because of this nerdy pedantic prime number disagreement? They're better off without him.

    And Greg passed up an enterprising candidate who finds unconventional ways to solve difficult problems? Nice.

    Lots of WTFs here, but not in the ways the authors intended.
  • Moitah 2008-08-26 11:39
    gabba:
    So David passed up an opportunity with a promising startup because of this nerdy pedantic prime number disagreement? They're better off without him.

    And Greg passed up an enterprising candidate who finds unconventional ways to solve difficult problems? Nice.

    Lots of WTFs here, but not in the ways the authors intended.


    I agree with you. Today's WTFs aren't that great.
  • Vroomfundel 2008-08-26 11:40
    Top Cod3r:
    the importance of naming your variables with a prefix that tells you what type it is


    WTF? Why don't you ask why Jesus is so much cooler than Buddha?
  • John 2008-08-26 11:45
    "Lots of WTFs here, but not in the ways the authors intended. "

    Got to agree with you. The Prime Number [WTF] doesn't mention what type of company the startup was. Quite possibly the CEO was the kind of person that knows Primes inside-out.

    For those that think their knowledge of maths is excellent (myself included), have a look at this: http://xkcd.com/179/
    My reaction was the exact same, and had to go to quickmath.com the verify it.

    btw. What's with people saying what the captchas were?
  • Top Cod3r 2008-08-26 11:46
    Vroomfundel:
    Top Cod3r:
    the importance of naming your variables with a prefix that tells you what type it is


    WTF? Why don't you ask why Jesus is so much cooler than Buddha?


    Because we aren't allowed to ask questions like that when hiring people. Someday if you interview candidates, your HR person will tell you what kinds of questions are not allowed to ask.
  • wtf 2008-08-26 11:46
    Surely you're joking...

    But seriously, what 3 disadvantages to MVC do you have in mind?
  • Eric 2008-08-26 11:48
    gabba:
    And Greg passed up an enterprising candidate who finds unconventional ways to solve difficult problems? Nice.

    Lots of WTFs here, but not in the ways the authors intended.


    Of course - it's obvious that they should have kept the candidate who took questionable shortcuts to make up for his lack of knowledge. That's exactly the kind of coder they'd love to have, I'm sure.
  • Sam B 2008-08-26 11:49
    Top Cod3r:
    That test reminds me of the test that I personally designed for our department. I purposely tried to make it complex so we could weed out developers who think they know everything but don't.


    Would it be too much to say that quite possibly you might suffer from said syndrome? The "Top Cod3r" moniker doesn't give you a really good defense either.

    Top Cod3r:

    I like to start off with simple questions like the proper use of On Error Resume Next, and the importance of naming your variables with a prefix that tells you what type it is.


    Well, I assume since you talk about On Error Resume Next, you're talking about VB. While I can't ever think of a situation you'd use "OERN" in VB (after all, ignoring errors is not the way to solve the problem), I think "The Real WTF" is that you advocate Hungarian Notation... in Visual Basic.

    Now, there's nothing wrong with Hungarian Notation; the problem is, Microsoft's systems department misinterpreted Simonyi's original intention for HN, and thereby created the convoluted form of "lpstrMyFirstName". Read more about it if you're interested.

    In this day and age, with IDEs (especially with the VB IDE) helping the programmer find out what type a variable is, there is absolutely no reason why anyone should advocate Hungarian Notation, save for the continued maintenance of legacy code. Even Microsoft does not recommend it any longer ("Do not use Hungarian Notation").

    Top Cod3r:

    The last couple years, we have had problems with new developers questioning the code and methodology we use, so I decided to add some real-life questions with some actual code examples from our apps to make sure that they are willing to learn from my code and not think that they know it all.


    Maybe you should be willing to learn from their code, too. Saying something like "we had problems with new developers questioning the code methodology we use" is pretty ridiculous, especially when you advocate Hungarian Notation and seem to believe you're an ubercoder. Because clearly, you think you know it all. I believe "think" is the key word, here.

    If I found myself interviewing for your company, and found out you guys are using HN for Visual Basic, and on top of that the dev lead in the interview is being a complete douche know-it-all, I'd be out the door in a second. No thanks, buddy.

    You're be driving a lot of the real programmers away. But I guess you'd want it that way; keep your bosses thinking you're the best!
  • panzi 2008-08-26 11:49
    Top Cod3r:
    On Error Resume Next


    One of the "greatest" features of Visual Basic. "Just ignore all errors." *shudder*

    Top Cod3r:
    Name 3 disadvantages of the MVC design pattern.


    I'm curious, what are disadvantages of the MVC design pattern? I can't think of any. It's not overly complex, it does not add a lot of overhead... what are the disadvantages?
  • Me 2008-08-26 11:50
    Top Cod3r:
    Vroomfundel:
    Top Cod3r:
    the importance of naming your variables with a prefix that tells you what type it is


    WTF? Why don't you ask why Jesus is so much cooler than Buddha?


    Because we aren't allowed to ask questions like that when hiring people. Someday if you interview candidates, your HR person will tell you what kinds of questions are not allowed to ask.


    You don't get it, it went whoosh. He's saying that's not a fact, it's an opinion. Like assholes, everyone has one.

    Saying "Our practice is to:" is one thing, but asking people to explain to YOU why YOUR practice is the greatest ever, well, it's almost like being God and needing everyone to pray and tell you that you are the God.
  • SNF 2008-08-26 12:05
    Top Cod3r:
    That test reminds me of the test that I personally designed for our department.


    Truly sir, you are a god among men.
  • Code Dependent 2008-08-26 12:08
    Is it still possible to apply in the future?
    Certainly! Apply as often as you wish.

    Getting accepted, now... that'll be a bit different.
  • Peter 2008-08-26 12:09
    Outlaw Programmer:
    Marty McFly:
    I hope this does not affect my possible future employment with ------- in the past.


    Their problem was they weren't thinking fourth-dimensionally!


    Fourth-dimensionally, right, I always have a problem with that.
  • Top Cod3r 2008-08-26 12:11
    I don't register my name because I know that internet bully programmers will find out my personally identifiable information and heckle my bosses about how I advocate archaic standards.

    All of you are right. I'm a douche.
  • Vroomfundel 2008-08-26 12:15
    Muahaha, I'm beginning to like the way Top Cod3r is becoming the laughing stock of the day.

    Frist, in this sense!
  • zip 2008-08-26 12:15
    Top Cod3r:
    I like to start off with simple questions like the proper use of On Error Resume Next, and the importance of naming your variables with a prefix that tells you what type it is.


    This might be the best troll I've ever seen here.
  • sadwings 2008-08-26 12:15
    Top Cod3r:
    All of you are right. I'm a douche.


    No, you are the light and the way.

    Satire should never be unmasked, no matter how confused it leaves the troglodytes.

    conventioNever break character again.
  • Sam B 2008-08-26 12:16
    Top Cod3r:


    All of you are right. I'm a douche.


    Good for you! As they say, the road to recovery begins by first admitting you have a problem.
  • sadwings 2008-08-26 12:16
    8(

    conventio was my captcha test
  • Benjamin 2008-08-26 12:17
    Top Cod3r:
    That test reminds me of the test that I personally designed for our department. I purposely tried to make it complex so we could weed out developers who think they know everything but don't.


    So your test will tell you... which prospective programmers are good at taking tests about programming... and happen to think exactly like you.
  • reminds me of that xkcd 2008-08-26 12:21
    http://xkcd.com/179/
  • Save Me Jebus 2008-08-26 12:22
    Me:
    Top Cod3r:
    Vroomfundel:
    Top Cod3r:
    the importance of naming your variables with a prefix that tells you what type it is


    WTF? Why don't you ask why Jesus is so much cooler than Buddha?


    Because we aren't allowed to ask questions like that when hiring people. Someday if you interview candidates, your HR person will tell you what kinds of questions are not allowed to ask.


    You don't get it, it went whoosh. He's saying that's not a fact, it's an opinion. Like assholes, everyone has one.

    Saying "Our practice is to:" is one thing, but asking people to explain to YOU why YOUR practice is the greatest ever, well, it's almost like being God and needing everyone to pray and tell you that you are the God.


    Speaking of "whoosh" ...

    For all you idiots attempting meaningful dissection of Top Cod3r's post, please go back and read a handful of the comments he's posted on other articles. I think you'll find a pretty strong pattern emerging: they're all tongue-in-cheek.

    Yet he still manages to push someone's buttons; every single time.
  • Chris 2008-08-26 12:22
    Top Cod3r:
    I like to start off with simple questions like the proper use of On Error Resume Next, and the importance of naming your variables with a prefix that tells you what type it is.


    Or alternatively use a proper programming language where you always know the type and the proper use of "On Error Resume Next" is to never use it.
  • Vroomfundel 2008-08-26 12:22
    John:

    For those that think their knowledge of maths is excellent (myself included), have a look at this: http://xkcd.com/179/
    My reaction was the exact same, and had to go to quickmath.com the verify it.


    Man, if you have to go to quickmath to verify this, then I seem to have a serious gap in my command of English - it's either "knowledge" or "excellent" that I have misunderstood all my life.

    PS I might be hard on John if he is a high school student, but thinking twice - what will a high school student be doing here. Anyway, if we had a "go away if you are < 18" here on TDWTF i would be much more at ease.
  • Bappi 2008-08-26 12:25
    Eric:
    gabba:
    And Greg passed up an enterprising candidate who finds unconventional ways to solve difficult problems? Nice.

    Lots of WTFs here, but not in the ways the authors intended.


    Of course - it's obvious that they should have kept the candidate who took questionable shortcuts to make up for his lack of knowledge. That's exactly the kind of coder they'd love to have, I'm sure.

    You're creating a test on the web, and you're assuming that the person applying is the same as the person taking the test. Or even that only one person was involved in taking the test. That's the first WTF.

    You're looking for consultants, and you don't want to hire the ones that think outside the box. That's the second WTF.

    Now, the guy originally lied about how many times he took the test: that's a good reason not to hire him.
  • Alan 2008-08-26 12:26
    The test I got for my current job was web-based and one question was asking the output of a program. I really fretted over the answer to one question, and was worrying about it well after the interview was over.

    Anyway I got the job, and a few months later came across the test database. Turns out that an error in the web code meant that the answer for that question wasnt saved.
  • Sam B 2008-08-26 12:27
    Save Me Jebus:

    For all you idiots attempting meaningful dissection of Top Cod3r's post, please go back and read a handful of the comments he's posted on other articles. I think you'll find a pretty strong pattern emerging: they're all tongue-in-cheek.


    There's a point where if your satire or sarcasm is so veiled as to be undetectable, consistently, then it's just plain trolling.

    So, either he's an idiot or a troll. *shrug*
  • mdkess 2008-08-26 12:28
    A mathematician, an engineer and a computer scientist are in a group interview where they are tasked with finding all of the odd prime numbers.

    The mathematician starts and says "3 is prime, 5 is prime, 7 is prime, 11 is prime, ..."

    The engineer says, "3 is prime, 5 is prime, 7 is prime, 9 is a measurement error, 11 is prime, 13 is prime, ..."

    Finally, the computer scientist says "1 is prime, 1 is prime, 1 is prime, 1 is prime, 1 is prime..."
  • G'Mo 2008-08-26 12:30
    Top Cod3r:
    That test reminds me of the test that I personally designed for our department. I purposely tried to make it complex so we could weed out developers who think they know everything but don't. I like to start off with simple questions like the proper use of On Error Resume Next, and the importance of naming your variables with a prefix that tells you what type it is. Then I move on to more complex questions about theory, such as choosing between different application designs, 2-tier, 3-tier, 4-tier and 5-tier (with and without a facade). I then ask them other theory questions, such as "Name 3 disadvantages of the MVC design pattern".

    The last couple years, we have had problems with new developers questioning the code and methodology we use, so I decided to add some real-life questions with some actual code examples from our apps to make sure that they are willing to learn from my code and not think that they know it all.


    I call troll.
  • Ville 2008-08-26 12:34
    Or alternatively use a proper programming language where you always know the type and the proper use of "On Error Resume Next" is to never use it.
    So you refer to some language that doesn't have typed variables and doesn't support try catch style semantics?
  • Eam 2008-08-26 12:34
    panzi:

    I'm curious, what are disadvantages of the MVC design pattern? I can't think of any. It's not overly complex, it does not add a lot of overhead... what are the disadvantages?


    It's a bit concerning that no one can think of *any* disadvantages to MVC. Don't get me wrong, I use MVC often, but it's not always appropriate.

    It may not add much complexity, but it adds enough that it should not be used for small projects. Also, it pretty much always requires some duplication of business logic across the tiers (the alternative being lots of added complexity).

    The trick to applying MVC is evaluating the current and potential future scale of your project, then balancing logic duplication with complexity.
  • Nemo 2008-08-26 12:35
    Of course it depends -- 1 is prime when it's followed by a vowel.
  • Gary Williams 2008-08-26 12:36
    gabba:
    So David passed up an opportunity with a promising startup because of this nerdy pedantic prime number disagreement? They're better off without him.

    And Greg passed up an enterprising candidate who finds unconventional ways to solve difficult problems? Nice.

    Lots of WTFs here, but not in the ways the authors intended.


    Also a very keen candidate. I wonder how many people would take the test 140 times and say "Well, I learnt from that".
  • Eam 2008-08-26 12:37
    Sam B:
    Save Me Jebus:

    For all you idiots attempting meaningful dissection of Top Cod3r's post, please go back and read a handful of the comments he's posted on other articles. I think you'll find a pretty strong pattern emerging: they're all tongue-in-cheek.


    There's a point where if your satire or sarcasm is so veiled as to be undetectable, consistently, then it's just plain trolling.

    So, either he's an idiot or a troll. *shrug*

    What about the point where one fails to detect satire or sarcasm, consistently?
  • A Wizard a True Star 2008-08-26 12:39
    Oh boy... just when I thought the Hungarian Notation holy war was over.

    Sam B:
    In this day and age, with IDEs (especially with the VB IDE) helping the programmer find out what type a variable is, there is absolutely no reason why anyone should advocate Hungarian Notation, save for the continued maintenance of legacy code.


    Well, I can see a couple of important reasons to use Hungarian Notation, or least some variation of it.

    In the VB.NET IDE you have to hover your mouse over a variable to figure out what type it is. Sometimes you can only see the type during run-time. Whereas, with some kind of variable naming convention, you can just read the code and know what the variable is supposed to be. I know it seems like a minor thing, but it really does make life a lot easier.

    And god forbid you're stuck debugging code without an IDE, which happens more often than you'd think.


    Sam B:
    I think "The Real WTF" is that you advocate Hungarian Notation... in Visual Basic.


    So, in which languages do you think Hungarian Notation would actually be useful?


    Sam B:
    Even Microsoft does not recommend it any longer ("Do not use Hungarian Notation").


    Microsoft recommends a lot of things which are not exactly a) smart or b) the best way to increase productivity.

  • Alan 2008-08-26 12:40
    Ville:
    So you refer to some language that doesn't have typed variables and doesn't support try catch style semantics?


    What - VBScript?
  • WhiskeyJack 2008-08-26 12:41
    My company advocates the practice of indicating the variable type in its name.

    cFoo = class variable
    pFoo = parameter variable
    gFoo = global variable

    foo = local variable

    Why is this so bad? Sure, I could rely on the IDE to trace back and give me an icon or tooltip or some reminder of where the variable was defined, but if it's right there in the name...

    Edit: oh, I see, we're talking about two different things.

  • amischiefr 2008-08-26 12:41
    Prime numbers:

    1
    1!!1
    !!one!1!!!
    11!!!eleventyone!!1!
    1!11!!1one!!!
  • Sam B 2008-08-26 12:43
    Eam:

    What about the point where one fails to detect satire or sarcasm, consistently?


    Well, this being the Internet, where it's already difficult to detect satire or sarcasm, one must make an "extra effort", as it were, to ensure that people get your point.

    But notice I said "so veiled as to be undetectable". There's a difference between "difficult to detect" and "virtually undetectable". There was no indication that what "Top Cod3r" said was sarcastic or satiric. None whatsoever. There are plenty of idiots on the Internet, and some of them are probaby on this site. WTFs also happen on Daily WTF.

    Also, I have not seen any of his other posts.

    So based on my observations (and I suppose all the others who took "Top Cod3r"'s idiocy as true), I would say that he failed miserably at being satiric. Whether or not he did it purposely is what would determine whether or not he was a troll.

    But quote honestly, who cares, right?
  • John 2008-08-26 12:44
    Granted, my use of excellent may have been^H^H^H^H^H^H^H^H^ was over the top, but being an Aero-Engineer, I would say that my math is pretty good, so personally I think you're being a tad harsh.

    Admittedly, I haven't had to use de Moivre's theorem since having to do basic proofs in uni.
  • Sam B 2008-08-26 12:47


    So, in which languages do you think Hungarian Notation would actually be useful?


    I'd be able to excuse its use in something like C or C++, where even Visual Studio fails in several areas to provide consistent Intellisense.
  • mister 2008-08-26 12:49
    In one of the Stephen King's "The Dark Tower" books (I think the third) appears a riddle regarding prime numbers, and 1 is included in them. It surprised me, too.
  • Global Warmer 2008-08-26 12:50
    Top Cod3r:
    That test reminds me of the test that I personally designed for our department. I purposely tried to make it complex so we could weed out developers who think they know everything but don't. I like to start off with simple questions like the proper use of On Error Resume Next, and the importance of naming your variables with a prefix that tells you what type it is. Then I move on to more complex questions about theory, such as choosing between different application designs, 2-tier, 3-tier, 4-tier and 5-tier (with and without a facade). I then ask them other theory questions, such as "Name 3 disadvantages of the MVC design pattern".

    The last couple years, we have had problems with new developers questioning the code and methodology we use, so I decided to add some real-life questions with some actual code examples from our apps to make sure that they are willing to learn from my code and not think that they know it all.


    Sounds to me like you are the one who thinks "he knows it all" and is unwilling to learn.
  • wtfdude 2008-08-26 13:03
    I dont know how you people who say they been visiting this site "forever" don't know the Top Cod3r is a troll.
    Seriously, look at all of his comments over the past year, and you can CLEARLY tell he is being very sarcastic or a complete troll.
    You guys are TRWTF if you can't tell yet.

    I guess Top Coder deserves a 10/10 for fooling so many of you idiots.
  • Chris 2008-08-26 13:03
    We had bizarre failures in our java app and unit tests.

    We had recently changed some behavior at the domain bean/DAO level and a senior developer was being proactive about verifying that the changes had been fully implemented. He put some assertions in to the business logic to ensure everything was sane.

    The "hey, I'm a senior developer too!" developer was hitting that assertion and it was failing -- we had overlooked something. But Junior Birdman wouldn't let it keep him from finishing his task.

    He commented it out. He didn't bother telling anyone that he was seeing the assertion tripped. We, of course, didn't notice it since the assertion had been removed from the common source code.

    It was a very interesting meeting the next day!
  • SarcasmFTW 2008-08-26 13:05
    You kinda have to assume that the first interview is for a position requiring a fair amount of mathematical knowledge. Because unless I have really fallen out of touch, knowing off the top of your head how to calculate the nth prime is not something everyone is expected to know how to do.
    Unless of course, they were expected the exhaustive search method, but if they were only expecting that, why even bother ask the question.
  • Guest 2008-08-26 13:05
    So, in which languages do you think Hungarian Notation would actually be useful?

    In any language that a) does accept one name to be used multiple times as long as the type is different and b) does not have a strong type-checking.
  • D. T. North 2008-08-26 13:07
    panzi:
    Top Cod3r:
    On Error Resume Next


    One of the "greatest" features of Visual Basic. "Just ignore all errors." *shudder*


    And isn't that the root of everything coded by Microsoft?
  • zoips 2008-08-26 13:10
    Sam B:

    But quote honestly, who cares, right?


    You should care. If you don't feed and appreciate good trolls, they go away and all you get are shitty trolls that are unbearable and annoying instead of amusing.
  • schaefer 2008-08-26 13:12
    If the company's purpose was to find prime numbers I would be worried that the CEO didn't know that 1 was not prime. However, I wouldn't want to work for a company that was just finding prime numbers. I am sure that at least some of the people I do work with probably think that 1 is prime and I have no problem with that. I would be more worried about hiring someone who spends his free time calculating prime numbers and not something more productive.
  • KattMan 2008-08-26 13:13
    Ville:
    Or alternatively use a proper programming language where you always know the type and the proper use of "On Error Resume Next" is to never use it.
    So you refer to some language that doesn't have typed variables and doesn't support try catch style semantics?


    And even in VB6, try-catch-finally semantics can be implemented. Given the following:

    On Error Goto Catch
    'Working code here
    Goto Finally
    Catch:
    'Error trapping code here
    Finally:
    'clean up code here

    You get the try-catch-finally semantics very easily.
    Now notice that On Error Resume Next breaks even this, so yes, the appropriate usage of OERN is to not use it.
  • Outlaw Programmer 2008-08-26 13:13
    SarcasmFTW:
    You kinda have to assume that the first interview is for a position requiring a fair amount of mathematical knowledge. Because unless I have really fallen out of touch, knowing off the top of your head how to calculate the nth prime is not something everyone is expected to know how to do.
    Unless of course, they were expected the exhaustive search method, but if they were only expecting that, why even bother ask the question.


    I think it's a pretty fair question as long as the interviewer is willing to give some hints. Most people probably don't know the solution off the top of their head but all developers should know what a prime number is, and how to determine if any given number is a prime.

    There's also plenty of room for modifying the problem, such as adding a look-up table or some wacky recursive solution or something.
  • Chiper 2008-08-26 13:14
    Sounds to me like you are the one who thinks "he knows it all" and is unwilling to learn.

    And that would be the point of the post. I got the joke, why didn't you?

    I can name one disadvantage of MVC, at least in web projects. Code overhead. By pure definition you have three or more files required to create one page (in the case of some frameworks like CakePHP, you have over a dozen includes). If said page is small and/or simple, those extra files are just wasted bulk, as is the memory required to pass data between all those files.

    Of course, now I've fed the anti-php trolls. You're welcome, enjoy your sustenance.
  • Chris 2008-08-26 13:16
    int iValue;

    ... 20,000 lines later...

    Oops, we need to handle more widgets than we expected. Make iValue a 'long'.

    Now what do you do? Do you change every instance of 'iValue' to 'lValue'? How long will that take? Remember to include time for testing, documentation, etc. This may not even be possible, e.g., if this is in a published libraries used by others.

    Or, you could say 'iValue' is an exception. But that means you're not using pseudoHungarian notation any longer and you can't trust your prefixes. So they not only no longer helpful, they're actively misleading in some cases.

    Then there's the whole 'far pointer to an array of pointers to functions expecting a string and an integer and returning nulls' prefix thang. (Oops, not the function takes a long!). Any meaningful prefix for that will be a nightmare to read -- "fpApfvSia[i++] = fpApfvSib[j++];" anyone?

    The bottom line is that the original HN was an interesting idea. The pseudoHN pushed by Microsoft is a cute idea that fails horribly in the real world.
  • Ville 2008-08-26 13:18
    KattMan:
    And even in VB6, try-catch-finally semantics can be implemented.

    Yes, I'm aware of that. But the guy I quoted was referring to "a proper programming language" that by his explanation would not have typed variables nor support for try catch style semantics. So I was just wondering, what "proper" programming language he was referring to.
  • Ville 2008-08-26 13:24
    Chris:
    Now what do you do? Do you change every instance of 'iValue' to 'lValue'? How long will that take? Remember to include time for testing, documentation, etc. This may not even be possible, e.g., if this is in a published libraries used by others.
    If that would be public property of a class or a member of structure, then yes, changing the name would be a problem in a published library. But wouldn't changing the data type be at least equally problematic? For functions changing the name of a parameter wouldn't be a problem at all in most languages, but changing the data type would be.
  • Top Cod3r 2008-08-26 13:32
    The problem with not registering and creating an identity for yourself is that someone will come along and register your name.

    See you under your new login name, or you can buy this one off me for the right price :)

    ~Not Top Cod3r
  • Expatriot 2008-08-26 13:33
    Sam B:

    Well, this being the Internet, where it's already difficult to detect satire or sarcasm, one must make an "extra effort", as it were, to ensure that people get your point.

    But notice I said "so veiled as to be undetectable". There's a difference between "difficult to detect" and "virtually undetectable". There was no indication that what "Top Cod3r" said was sarcastic or satiric. None whatsoever.


    Well, it tripped my satire detector in the second sentence, and it was pretty unambiguous by the end. You don't need to hang around here long to pick up that "On Error Resume Next" and excessively enterprisey application architectures are running jokes.

    Yay! I win at Internet!
  • Sam B 2008-08-26 13:33
    zoips:
    Sam B:

    But quote honestly, who cares, right?


    You should care. If you don't feed and appreciate good trolls, they go away and all you get are shitty trolls that are unbearable and annoying instead of amusing.


    True enough! Wise words indeed :)
  • Vechni 2008-08-26 13:34
    Usually Interview WTFs are my only true enjoyment that I derive from this website... but man these sucked.

    And what happened to all the math fascists that normally would rejoice in this kind of post? The grammar nazi's are in full reign?

    Actually, I think prior to the grammar nazi's, it was the logic communists that had large movement a couple of years ago... So, it is definitely not the right time for the math fascists to strike. Ahh.. I see now. You all are biding your time... waiting for the perfect moment to strike.
  • Sam B 2008-08-26 13:35
    Chris:
    int iValue;

    ... 20,000 lines later...

    Oops, we need to handle more widgets than we expected. Make iValue a 'long'.

    Now what do you do? Do you change every instance of 'iValue' to 'lValue'? How long will that take? Remember to include time for testing, documentation, etc. This may not even be possible, e.g., if this is in a published libraries used by others.


    Well, Visual Studio 8 (and even 7, AFAIK) makes it really easy to rename variables. It will refactor the code accordingly.

    But, I get your point and agree with you.
  • Sam B 2008-08-26 13:37
    Expatriot:
    Sam B:

    Well, this being the Internet, where it's already difficult to detect satire or sarcasm, one must make an "extra effort", as it were, to ensure that people get your point.

    But notice I said "so veiled as to be undetectable". There's a difference between "difficult to detect" and "virtually undetectable". There was no indication that what "Top Cod3r" said was sarcastic or satiric. None whatsoever.


    Well, it tripped my satire detector in the second sentence, and it was pretty unambiguous by the end. You don't need to hang around here long to pick up that "On Error Resume Next" and excessively enterprisey application architectures are running jokes.

    Yay! I win at Internet!


    While I've been following Daily WTF now for a bit over a year, I've not really read the comments. So I guess it's partly my fault, then, too, for not understanding the memes floating around here xD
  • shepd 2008-08-26 13:40
    Two WTFs, that aren't? Say it isn't so!

    WTF #1: Obviously, the WTF is the person complaining that 1 isn't prime when, just like the interviewer said, it's a "maybe".

    WTF #2: If the guy did the test that many times, you might not employ him (up to you, I'd have him in for an interview myself, I like people who think outside the box), but perhaps you should congratulate him for being smart enough to figure out how to ace the test, and for pointing out a flaw in your scoring system (the flaw being that you return results while the exam is still available). Deriding him for taking it 140 times is deriding yourself 139 times, IMHO.

    I know when I was in College, if I had figured out to do something like this to pass a test in a programming class, I'd have a 50/50 shot of either impressing the hell out of the teacher, or getting in some (minor) trouble and having to take a new (fixed) exam.
  • iamunregistered 2008-08-26 13:42
    To all the people laughing at the On Error Resume Next question: it is not necessarily used to ignore errors. I guess you guys would fail the question because you don't know how it's supposed to be used.

    http://www.powerasp.com/content/new/on-error-resume-next.asp

    Sheeesh.

    My captcha was "immitto".
  • Franz Kafka 2008-08-26 13:43
    gabba:
    So David passed up an opportunity with a promising startup because of this nerdy pedantic prime number disagreement? They're better off without him.

    And Greg passed up an enterprising candidate who finds unconventional ways to solve difficult problems? Nice.

    Lots of WTFs here, but not in the ways the authors intended.


    Well, David passed up a startup that had 4 people in it and 2 CEOs. I'd bolt too. Greg passed up some idiot who took the brute force approach - how is that good as a consultant? We make fun of those guys in here.
  • Code Dependent 2008-08-26 13:44
    Chris:
    int iValue;

    ... 20,000 lines later...

    Oops, we need to handle more widgets than we expected. Make iValue a 'long'.

    Now what do you do? Do you change every instance of 'iValue' to 'lValue'? How long will that take?
  • Andrew 2008-08-26 13:46
    Vroomfundel:
    Top Cod3r:
    the importance of naming your variables with a prefix that tells you what type it is


    WTF? Why don't you ask why Jesus is so much cooler than Buddha?


    Easy, Buddha has more body fat.
  • beau29 2008-08-26 13:46
    Top Cod3r:
    I like to start off with simple questions like the proper use of On Error Resume Next, and the importance of naming your variables with a prefix that tells you what type it is. Then I move on to more complex questions about theory, such as choosing between different application designs, 2-tier, 3-tier, 4-tier and 5-tier (with and without a facade). I then ask them other theory questions, such as "Name 3 disadvantages of the MVC design pattern".

    The last couple years, we have had problems with new developers questioning the code and methodology we use, so I decided to add some real-life questions with some actual code examples from our apps to make sure that they are willing to learn from my code and not think that they know it all.


    It doesn't sound like you're identifying the best developers. It sounds like you're asking some subjective questions and then assessing whether the candidate feels the same way about them as you.

    These questions are valuable to you - obviously you have a very specific way of doing things that you consider architecturally correct. You clearly don't want to work with people who don't agree with you on these topics.

    But don't kid yourself - you're not finding the best developers. You're finding people who agree with you.

    Incidentally, I don't think we would agree. My responses would be:

    1) On Error Resume Next should be avoided because it hides failures. Individual errors can be specifically squelched using "catch" blocks, although even that technique should be used with caution and justified with a comment. In release builds, I do tend to use something like On Error Resume Next (although I don't use VB) in order to squelch exceptions that do make it to production. Typically, I just catch, maybe log, and squelch these at the outermost level possible. All of this is based on the value of the DEBUG preprocessor macro, which allows me to apply error squelching appropriately.

    2) Hungarian notation is a dying and discredited technique that attempted to make C++ more usable for Windows programming. Even Microsoft has abandoned it recently. In more modern languages, this notation really just clutters the code and serves to make me reach for the Shift key too often.

    3) The 2-tier architecture arises from the need to put data on a distinct machine (or machines) from the UI. The 3-tier architecture arises from a desire for better maintainability: stakeholders want a way to change GUIs without throwing away what's perceived to be a whole bunch of non-GUI logic. In my experience, 2-tier is often essential; 3-tier is sometimes justified, particularly if different, identifiable presentation tiers exist. Presumably 4+ tiers would exist to make an app more robust with respect to future changes. I don't generally advocate 4+ tiers because there's a point of diminishing returns to all this. For example, if inputs are validated at every tier, then 4+ tiers can really result in a lot of redundant code.

    4) I don't remember exactly what the facade pattern is, and I'm not going to close my eyes and try and remember so that I can parrot it back to you. When I study design patterns, I do so to perhaps see people using the OO features of a language in ways I didn't anticipate. I think it's infantile to file these patterns mentally and then walk around looking for opportunities to use them. And when I'm discussing OO design, I want to speak at a lower level (class hierarchy, declarations, etc.) than the vocabulary of patterns allows.

    5) MVC has the same drawbacks as any tiered approach. The most obvious examples for me are extra validation and poor designer support (because abstraction confuses things like VS.NET's "Go to Definition")

    So I guess you wouldn't hire me. But I don't think this make s me a bad developer. Where I am working now, we had a test that asked very specific questions about things like closures, the ASP.NET page lifecycle, and so on, where's there's no room for subjectivity. And I am the all-time leading scorer on that.

    If people are questioning your methodology, there may be a damn good reason!

    Addendum (2008-08-26 13:55):
    EDIT: On number 5, I would add that many things are by nature "MVC"... ASP.NET is an example. These native implementations don't really suffer from the problems I raised... I am speaking of people who try to "roll their own" MVC implementations using high-level code in an existing tool
  • Franz Kafka 2008-08-26 13:48
    Chris:
    int iValue;

    ... 20,000 lines later...

    Oops, we need to handle more widgets than we expected. Make iValue a 'long'.

    Now what do you do? Do you change every instance of 'iValue' to 'lValue'? How long will that take? Remember to include time for testing, documentation, etc. This may not even be possible, e.g., if this is in a published libraries used by others.


    This takes about 10 seconds to change in any decent IDE (refactoring code), and you hopefully have decent unit tests already. If this is a published interface, then you're sort of screwed, but you can refactor up to the API wall, then publish updated interfaces that take a long (and do a better job next time). This works okay depending on how widely your interface is distributed. HN isn't really the problem in here anyway - it's a nuisance, but it doesn't break things. Real HN, where it describes what the variable means, doesn't have this problem.
  • J B 2008-08-26 13:51
    Seriously, you have an out of the box thinker.
    Someone with potential, they hack away a bit - and you pass him up. You're an id10t.

    Seriously wtf.
  • the real wtf 2008-08-26 13:52
    zoips:
    Sam B:

    But quote honestly, who cares, right?


    You should care. If you don't feed and appreciate good trolls, they go away and all you get are shitty trolls that are unbearable and annoying instead of amusing.


    I have to concur, top cod3r's posts were pretty good. I almost bit.
  • Franz Kafka 2008-08-26 13:53
    beau29:

    1) On Error Resume Next should be avoided because it hides failures. Individual errors can be specifically squelched using "catch" blocks, although even that technique should be used with caution and justified with a comment. In release builds, I do tend to use something like On Error Resume Next (although I don't use VB) in order to squelch exceptions that do make it to production. Typically, I just catch, maybe log, and squelch these at the outermost level possible. All of this is based on the value of the DEBUG preprocessor macro, which allows me to apply error squelching appropriately.


    I can think of one situation where ORNE is a good idea - if you're processing a large amount of records and some small portion are assumed to be anomalous, structure your code to not persist anything if there are errors and run the records through your ORNE loop, then examine the leftovers in more detail. Especially handy when accepting user input that can be messed up if you don't want to just toss the bad data.
  • stone 2008-08-26 13:57
    The last couple years, we have had problems with new developers questioning the code and methodology we use, so I decided to add some real-life questions with some actual code examples from our apps to make sure that they are willing to learn from my code and not think that they know it all.
    Yeah because you do.
  • beau29 2008-08-26 13:59
    Expatriot:
    Sam B:

    Well, this being the Internet, where it's already difficult to detect satire or sarcasm, one must make an "extra effort", as it were, to ensure that people get your point.

    But notice I said "so veiled as to be undetectable". There's a difference between "difficult to detect" and "virtually undetectable". There was no indication that what "Top Cod3r" said was sarcastic or satiric. None whatsoever.


    Well, it tripped my satire detector in the second sentence, and it was pretty unambiguous by the end. You don't need to hang around here long to pick up that "On Error Resume Next" and excessively enterprisey application architectures are running jokes.

    Yay! I win at Internet!


    My God, if TopCod3r is a troll, he/she/it sure knows how to push my buttons.
  • Global Warmer 2008-08-26 14:00
    shepd:
    Two WTFs, that aren't? Say it isn't so!

    WTF #1: Obviously, the WTF is the person complaining that 1 isn't prime when, just like the interviewer said, it's a "maybe".

    WTF #2: If the guy did the test that many times, you might not employ him (up to you, I'd have him in for an interview myself, I like people who think outside the box), but perhaps you should congratulate him for being smart enough to figure out how to ace the test, and for pointing out a flaw in your scoring system (the flaw being that you return results while the exam is still available). Deriding him for taking it 140 times is deriding yourself 139 times, IMHO.

    I know when I was in College, if I had figured out to do something like this to pass a test in a programming class, I'd have a 50/50 shot of either impressing the hell out of the teacher, or getting in some (minor) trouble and having to take a new (fixed) exam.


    I completely agree. I would add to your second WTF, as someone else pointed out that the author has no way to be sure it was actually this person taking the test 140 times.
  • wee 2008-08-26 14:01
    Top Cod3r:
    the importance of naming your variables with a prefix that tells you what type it is.


    You need to get yourself a more loosely-typed language, son. And declench in any case.
  • Jesus 2008-08-26 14:02
    Vroomfundel:
    Top Cod3r:
    the importance of naming your variables with a prefix that tells you what type it is


    WTF? Why don't you ask why Jesus is so much cooler than Buddha?

    Oh, I think we already know the answer to that one.
  • Buddha 2008-08-26 14:02
    Jesus:
    Vroomfundel:
    Top Cod3r:
    the importance of naming your variables with a prefix that tells you what type it is


    WTF? Why don't you ask why Jesus is so much cooler than Buddha?

    Oh, I think we already know the answer to that one.

    FUCK YOU JESUS!!
  • cconroy 2008-08-26 14:04
    A Wizard a True Star:
    So, in which languages do you think Hungarian Notation would actually be useful?

    Hungarian, presumably.
  • Andy L. 2008-08-26 14:05
    gabba:
    And Greg passed up an enterprising candidate who finds unconventional ways to solve difficult problems? Nice.


    The candidate proved two things :
    1) He can deploy unconventional ways to solve difficult problems.
    2) He does not have the experience level Greg was looking for.

    I don't see why not hiring him is a WTF.

    (He also proved that he didn't think through his actions well enough to anticipate that Greg would check the logs.)
  • Franz Kafka 2008-08-26 14:05
    wee:
    Top Cod3r:
    the importance of naming your variables with a prefix that tells you what type it is.


    You need to get yourself a more loosely-typed language, son. And declench in any case.


    loosely typed languages need real HN even more - how are you supposed to know what variable x is supposed to be unless you tag it with something like name or amount?
  • John Locke 2008-08-26 14:06
    zip:
    Top Cod3r:
    I like to start off with simple questions like the proper use of On Error Resume Next, and the importance of naming your variables with a prefix that tells you what type it is.


    This might be the best troll I've ever seen here.

    Dude, you let the cat out.
  • TopCod3r 2008-08-26 14:07
    Hey guys, sorry but someone has been "stealing" my name and impersonating me on this thread, so I just registered it, so it won't happen again hopefully. I didn't post any of the offensive stuff before.

    But I am _passionate_ about sharing my best practices with junior developers, so they can aspire to achieve MCAD certification someday!
  • Code Dependent 2008-08-26 14:08
    Buddha:
    FUCK YOU JESUS!!
    Take three slow, deep breaths, and say, "Ommmmmm...."
  • wee 2008-08-26 14:12
    Franz Kafka:
    loosely typed languages need real HN even more - how are you supposed to know what variable x is supposed to be unless you tag it with something like name or amount?


    Ummm... you're a very serious person, aren't you?
  • El Duderino 2008-08-26 14:17
    A Wizard a True Star:
    So, in which languages do you think Hungarian Notation would actually be useful?
    pI advActually vLove adjHungarian nNotation advSo adjMuch, pI vUse pIt advAll artThe nTime! pIt advSure vMakes nEnglish adjEasier prepTo vUnderstand. vImagine cIf pYou vHad prepTo vRead pThis prepWithout pIt. pYou vWould vHave adjNo nClue advWhat pThese nWords vMeant prepWithout pTheir nParts prepOf nSpeech!
  • Marvin the Martian 2008-08-26 14:18
    Vroomfundel:
    John:

    For those that think their knowledge of maths is excellent (myself included), have a look at this: http://xkcd.com/179/

    Man, if you have to go to quickmath to verify this, then I seem to have a serious gap in my command of English

    On the plus side, XKCD has gone light the last few months, and only posts throwaway /b/ meme jokes.
    This kind of embarassment is now officially archaic!

    I don't know what this kind of calculus has to do with the given simple programming exercise --- but if you get a symbolic calculus programming task during an interview, hm, that's a toughie. The obvious task is to check with the supervisor (in this case, the acting-CEO annex king&tyrant annex president-for-life) on a standard [1 prime or not]: both for interviewer AND interviewee it is important --- if the applicant says "screw this I define my own reality" you have a problem, if the supervisor cannot see the ambiguity and resolve it straightforwardly (or temporarily until standards are revised) then the whole shop is doomed.

    Knowing maths in and out doesn't imply being a historian of number theory so the explanation that the supervisor may have been far smarter than he seemed does not hold much water here, it doesn't really change anything in the interaction.
  • Mark 2008-08-26 14:18
    Man, I though 1 was prime as well. I'm glad I'm not alone!
  • snoofle 2008-08-26 14:28
    El Duderino:
    A Wizard a True Star:
    So, in which languages do you think Hungarian Notation would actually be useful?
    pI advActually vLove adjHungarian nNotation advSo adjMuch, pI vUse pIt advAll artThe nTime! pIt advSure vMakes nEnglish adjEasier prepTo vUnderstand. vImagine cIf pYou vHad prepTo vRead pThis prepWithout pIt. pYou vWould vHave adjNo nClue advWhat pThese nWords vMeant prepWithout pTheir nParts prepOf nSpeech!

    Freaking awesome!
  • JohnFx 2008-08-26 14:29
    [quote user="panzi"][quote user="Top Cod3r"]On Error Resume Next[/quote]

    One of the "greatest" features of Visual Basic. "Just ignore all errors." *shudder*

    Don't be so hasty. I hate to defend the often atrocious use of the OERN construct to "ignore all errors", it is merely an alternative to allow in-line error handling instead of a makeshift catch block using "ON ERROR GOTO". Sometimes turning on OERN and then checking the error object is a much more concise and readable way to write an error handler, at least it was until VB.NET FINALLY introduced the try...catch...finally syntax.
  • Ville 2008-08-26 14:29
    It's interesting to see how many here thinks ORNE is only suitable for hiding errors.

    The only times I've used ORNE are basically something like the following

    On Error Resume Next
    Open FileToRead for Input as #FileId
    If Err Then
    ReturnValue = FAILED_FILE_INACCESSIBLE
    Exit Sub
    End If
    On Error Goto 0
  • Ville 2008-08-26 14:30
    Sorry, I meant OERN, not ORNE
  • WC 2008-08-26 14:32
    The problem I see wasn't that he didn't know 1 wasn't prime. The problem was that he wasn't interested in the truth, he was only interested in winning the argument. Have you ever tried to work with someone like that? Imagine trying to work -for- them. Every single day would be an up-hill battle just to complete tasks as the boss argues that no matter what he wrote, that wasn't what was wanted. And you should have known that, somehow.

    I wouldn't want to work for them, either, no matter how 'promising' they are.
  • panzi 2008-08-26 14:33
    Eam:
    panzi:

    I'm curious, what are disadvantages of the MVC design pattern? I can't think of any. It's not overly complex, it does not add a lot of overhead... what are the disadvantages?


    It's a bit concerning that no one can think of *any* disadvantages to MVC. Don't get me wrong, I use MVC often, but it's not always appropriate.

    It may not add much complexity, but it adds enough that it should not be used for small projects. Also, it pretty much always requires some duplication of business logic across the tiers (the alternative being lots of added complexity).

    The trick to applying MVC is evaluating the current and potential future scale of your project, then balancing logic duplication with complexity.


    Yes, for very small projects it does not make much sense. I didn't understand the question that way. I immediately thought about a project where one would choose that pattern. And then there are no downsides. *g*
  • Franz Kafka 2008-08-26 14:40
    wee:
    Franz Kafka:
    loosely typed languages need real HN even more - how are you supposed to know what variable x is supposed to be unless you tag it with something like name or amount?


    Ummm... you're a very serious person, aren't you?


    A philosopher, some would say.
  • Smash King 2008-08-26 14:42
    I can think of one situation where ORNE is a good idea

    On Resume, Next Error?? Wow. That's some pretty good material for all the VB/ASP/VBScript haters out there.
  • Walleye 2008-08-26 14:46
    Nemo:
    Of course it depends -- 1 is prime when it's followed by a vowel.


    Or if it's followed by a detective. Then it's a prime suspect.
  • rd 2008-08-26 14:47
    John:
    The Prime Number [WTF] doesn't mention what type of company the startup was. Quite possibly the CEO was the kind of person that knows Primes inside-out.

    I would guess that the company was a publisher of 19th century mathematics texts.
  • strNickname 2008-08-26 14:48
    Sam B:
    Eam:

    What about the point where one fails to detect satire or sarcasm, consistently?


    There was no indication that what "Top Cod3r" said was sarcastic or satiric. None whatsoever. There are plenty of idiots on the Internet, and some of them are probaby on this site. WTFs also happen on Daily WTF.

    Also, I have not seen any of his other posts.

    So based on my observations (and I suppose all the others who took "Top Cod3r"'s idiocy as true), I would say that he failed miserably at being satiric.


    No, he didn't. And if "proper use of On Error Resume Next" isn't a good enough indication for you, you fail.

    Eam:


    But quote honestly, who cares, right?


    I certainly don't.
  • SomeName 2008-08-26 14:51
    El Duderino:
    A Wizard a True Star:
    So, in which languages do you think Hungarian Notation would actually be useful?
    pI advActually vLove adjHungarian nNotation advSo adjMuch, pI vUse pIt advAll artThe nTime! pIt advSure vMakes nEnglish adjEasier prepTo vUnderstand. vImagine cIf pYou vHad prepTo vRead pThis prepWithout pIt. pYou vWould vHave adjNo nClue advWhat pThese nWords vMeant prepWithout pTheir nParts prepOf nSpeech!


    I lol'd. Thanks ;o)
  • panzi 2008-08-26 14:52
    Franz Kafka:
    wee:
    Top Cod3r:
    the importance of naming your variables with a prefix that tells you what type it is.


    You need to get yourself a more loosely-typed language, son. And declench in any case.


    loosely typed languages need real HN even more - how are you supposed to know what variable x is supposed to be unless you tag it with something like name or amount?


    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.
  • strNickname 2008-08-26 14:52
    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. :)
  • panzi 2008-08-26 14:53
    El Duderino:
    A Wizard a True Star:
    So, in which languages do you think Hungarian Notation would actually be useful?
    pI advActually vLove adjHungarian nNotation advSo adjMuch, pI vUse pIt advAll artThe nTime! pIt advSure vMakes nEnglish adjEasier prepTo vUnderstand. vImagine cIf pYou vHad prepTo vRead pThis prepWithout pIt. pYou vWould vHave adjNo nClue advWhat pThese nWords vMeant prepWithout pTheir nParts prepOf nSpeech!
    roflol! :)
  • Doog 2008-08-26 14:53
    Vroomfundel:

    PS I might be hard on John if he is a high school student, but thinking twice - what will a high school student be doing here. Anyway, if we had a "go away if you are < 18" here on TDWTF i would be much more at ease.


    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.
  • Smash King 2008-08-26 14:54
    Sam B:
    But quote honestly, who cares, right?
    honestly
  • Adam 2008-08-26 14:55
    John:
    btw. What's with people saying what the captchas were?


    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!
  • Franz Kafka 2008-08-26 14:56
    panzi:

    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.


    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.
  • silent d 2008-08-26 14:56
    Ville:
    Sorry, I meant OERN, not ORNE


    This whole thing is just making me ORNEry.
  • oldfraud 2008-08-26 14:59
    as the old fraud in house m.d. said:

    i'm 21 ... unless it's relevant.
  • KattMan 2008-08-26 15:10
    Adam:


    Captcha: genitus. WTF is that? A super-hero with super-genital powers? Or Genitus, the God and Overlord of All Genitals!


    Can I just be god and overlord of all female genitals?
  • Max 2008-08-26 15:20
    Top Cod3r:
    That test reminds me of the test that I personally designed for our department. I purposely tried to make it complex so we could weed out developers who think they know everything but don't. I like to start off with simple questions like the proper use of On Error Resume Next, and the importance of naming your variables with a prefix that tells you what type it is. Then I move on to more complex questions about theory, such as choosing between different application designs, 2-tier, 3-tier, 4-tier and 5-tier (with and without a facade). I then ask them other theory questions, such as "Name 3 disadvantages of the MVC design pattern".

    The last couple years, we have had problems with new developers questioning the code and methodology we use, so I decided to add some real-life questions with some actual code examples from our apps to make sure that they are willing to learn from my code and not think that they know it all.


    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.
  • jonnyq 2008-08-26 15:27
    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"
  • John 2008-08-26 15:37
    1 is the only odd prime number, the rest are just regular primes ... ... ...
  • Kermos 2008-08-26 15:44
    Sam B:


    So, in which languages do you think Hungarian Notation would actually be useful?


    I'd be able to excuse its use in something like C or C++, where even Visual Studio fails in several areas to provide consistent Intellisense.


    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.

  • Code Dependent 2008-08-26 15:47
    KattMan:
    Can I just be god and overlord of all female genitals?
    Not if you have to ask.
  • Anonymous Cow-orker 2008-08-26 16:01
    Ville:
    Or alternatively use a proper programming language where you always know the type and the proper use of "On Error Resume Next" is to never use it.
    So you refer to some language that doesn't have typed variables and doesn't support try catch style semantics?


    BASIC ?
  • real_aardvark 2008-08-26 16:09
    John:
    1 is the only odd prime number, the rest are just regular primes ... ... ...
    I'm thinking of restarting the debate on the finally keyword. It's not so much a debate, more a matter of me being bashed repeatedly over the head; but I can handle that better than this endless wittering about primes.

    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:
    Ville:
    It's interesting to see how many here thinks ORNE is only suitable for hiding errors.

    The only times I've used ORNE are basically something like the following

    On Error Resume Next
    Open FileToRead for Input as #FileId
    If Err Then
    ReturnValue = FAILED_FILE_INACCESSIBLE
    Exit Sub
    End If
    On Error Goto 0
    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.
  • Kev 2008-08-26 16:13
    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.
  • Kev 2008-08-26 16:14
    Kev:
    ... He used some 3rd party site that let him make the exam and send give him the results...


    I should have mentioned that it was an english class. Not one of my strong subjects.
  • demon 2008-08-26 16:15
    SNF:
    Top Cod3r:
    That test reminds me of the test that I personally designed for our department.


    Truly sir, you are a god among men.


    nah.. he's just "*Top* Cod3r" :-)
  • Ville 2008-08-26 16:16
    real_aardvark:
    Sheesh. Man can't even spell FILE_NOT_FOUND properly.
    Who might you be referring to. And if you don't understand what you read, maybe you shouldn't comment on that particular message.
  • Code Dependent 2008-08-26 16:25
    Ville:
    real_aardvark:
    Sheesh. Man can't even spell FILE_NOT_FOUND properly.
    Who might you be referring to. And if you don't understand what you read, maybe you shouldn't comment on that particular message.
    POINT_NOT_GRASPED
  • Ben 2008-08-26 16:29
    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:

    1. 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.

    2. 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.

    3. 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.
  • Andy L. 2008-08-26 16:30
    "When would you use 'On Error Resume Next'?"
    "About three in the morning."
  • nikki9696 2008-08-26 16:30
    El Duderino:
    A Wizard a True Star:
    So, in which languages do you think Hungarian Notation would actually be useful?
    pI advActually vLove adjHungarian nNotation advSo adjMuch, pI vUse pIt advAll artThe nTime! pIt advSure vMakes nEnglish adjEasier prepTo vUnderstand. vImagine cIf pYou vHad prepTo vRead pThis prepWithout pIt. pYou vWould vHave adjNo nClue advWhat pThese nWords vMeant prepWithout pTheir nParts prepOf nSpeech!


    nThat vIs advAwesome.
  • Dan 2008-08-26 16:33
    Sometimes this is a comment and sometimes it's not.
  • Lyle 2008-08-26 16:33
    Lyle would have scored 100%.
  • real_aardvark 2008-08-26 16:41
    Ville:
    real_aardvark:
    Sheesh. Man can't even spell FILE_NOT_FOUND properly.
    Who might you be referring to. And if you don't understand what you read, maybe you shouldn't comment on that particular message.
    To whom might you be referring? Up with ignorance I will not put.

    FTFY.

    /Grammar Nazi

    PS Can we get back to finally now?
  • snoofle 2008-08-26 16:43
    Code Dependent:
    Ville:
    real_aardvark:
    Sheesh. Man can't even spell FILE_NOT_FOUND properly.
    Who might you be referring to. And if you don't understand what you read, maybe you shouldn't comment on that particular message.
    POINT_NOT_GRASPED
    Agreed!

    The ONE time where fnf would have actually made great sense *and* a great pun...

    *sigh*
  • Mr.J 2008-08-26 16:44
    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".



  • Mr.J 2008-08-26 16:45
    I'm already sorry I posted the rant. It's late.
    Pre-apologies?
  • real_aardvark 2008-08-26 16:47
    nikki9696:
    El Duderino:
    A Wizard a True Star:
    So, in which languages do you think Hungarian Notation would actually be useful?
    pI advActually vLove adjHungarian nNotation advSo adjMuch, pI vUse pIt advAll artThe nTime! pIt advSure vMakes nEnglish adjEasier prepTo vUnderstand. vImagine cIf pYou vHad prepTo vRead pThis prepWithout pIt. pYou vWould vHave adjNo nClue advWhat pThese nWords vMeant prepWithout pTheir nParts prepOf nSpeech!


    nThat vIs adv^HjAwesome.
    FTFY also.

    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.
  • Dice 2008-08-26 16:48
    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!
  • pyro789x 2008-08-26 17:05
    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.
  • ahnfelt 2008-08-26 17:07
    zip:
    Top Cod3r:
    I like to start off with simple questions like the proper use of On Error Resume Next, and the importance of naming your variables with a prefix that tells you what type it is.


    This might be the best troll I've ever seen here.

    Yes, it was awesome! I almost started pointing out the flaws when I realized... it's too bad to be true, and then read a few comments.

    Nice job!
  • Code Dependent 2008-08-26 17:09
    pyro789x:
    Has anybody else spotted the error in logic that those who are defending Hungarian notation are using? *snip*
    Pass that bowl.
  • Dan 2008-08-26 17:31
    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.
  • Sann B 2008-08-26 17:32
    Sam B:
    Eam:

    What about the point where one fails to detect satire or sarcasm, consistently?


    Well, this being the Internet, where it's already difficult to detect satire or sarcasm, one must make an "extra effort", as it were, to ensure that people get your point.


    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.
  • Franz Kafka 2008-08-26 17:34
    pyro789x:
    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.


    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'.
  • A Wizard a True Star 2008-08-26 17:36
    nikki9696:
    El Duderino:
    A Wizard a True Star:
    So, in which languages do you think Hungarian Notation would actually be useful?
    pI advActually vLove adjHungarian nNotation advSo adjMuch, pI vUse pIt advAll artThe nTime! pIt advSure vMakes nEnglish adjEasier prepTo vUnderstand. vImagine cIf pYou vHad prepTo vRead pThis prepWithout pIt. pYou vWould vHave adjNo nClue advWhat pThese nWords vMeant prepWithout pTheir nParts prepOf nSpeech!


    nThat vIs advAwesome.


    Sorry, but just because you can abuse a programming practice doesn't make it useless.

  • pong 2008-08-26 17:37
    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.
  • Bob 2008-08-26 17:37
    And here I was thinking we were going to get a story about diapers. That would have been a treat.
  • A Wizard a True Star 2008-08-26 17:45
    Dan:
    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.


    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.




  • Hungarian 2008-08-26 17:59
    A Wizard a True Star:

    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.


    Or, call it s because it's a string. If s us used, move on to t, or s1, etc.
  • A Gould 2008-08-26 17:59
    Sam B:

    Well, I assume since you talk about On Error Resume Next, you're talking about VB. While I can't ever think of a situation you'd use "OERN" in VB (after all, ignoring errors is not the way to solve the problem),


    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.
  • real_aardvark 2008-08-26 18:06
    Dan:
    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.
    Aw, go on. Pick on someone, or somebody.

    What was your point, again?
  • Bappi 2008-08-26 18:08
    pyro789x:
    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.

    ABAP.

    It's serious business.
  • real_aardvark 2008-08-26 18:09
    A Wizard a True Star:
    nikki9696:
    El Duderino:
    A Wizard a True Star:
    So, in which languages do you think Hungarian Notation would actually be useful?
    pI advActually vLove adjHungarian nNotation advSo adjMuch, pI vUse pIt advAll artThe nTime! pIt advSure vMakes nEnglish adjEasier prepTo vUnderstand. vImagine cIf pYou vHad prepTo vRead pThis prepWithout pIt. pYou vWould vHave adjNo nClue advWhat pThese nWords vMeant prepWithout pTheir nParts prepOf nSpeech!


    nThat vIs advAwesome.


    Sorry, but just because you can abuse a programming practice doesn't make it useless.

    Sigh.

    Hungarian Notation (as used outside Systems Programming, and I'm not remotely convinced of its worth even there) is somewhere between Cargo Cult and CYA.

    Yup.

    It is, truly, useless.

    Dangerous, also.
  • emddudley 2008-08-26 18:23
    WhiskeyJack:
    My company advocates the practice of indicating the variable type in its name.

    cFoo = class variable
    pFoo = parameter variable
    gFoo = global variable

    foo = local variable

    Why is this so bad? Sure, I could rely on the IDE to trace back and give me an icon or tooltip or some reminder of where the variable was defined, but if it's right there in the name...

    Edit: oh, I see, we're talking about two different things.



    I use a similar naming scheme myself and I think it works very well. To be a bit pedantic, however, I prefer the following:

    mFoo = Member variable
    aFoo = Argument variable
    gFoo = Global variable

    foo = Local variable

    A class variable is a type of member variable. You use the term class variable to distinguish from instance variables.

    Secondly, a parameter is what you define when you declare a function, and an argument is the value that is passed in to that function when it is called. Since the variable inside the function represents whatever is passed in, I prefer the "a" prefix.
  • Havokk 2008-08-26 18:26
    Franz Kafka:
    The whole point of HN is a fairly consistent of naming variables semantically.

    If I understand Hungarian Notation correctly, this is wrong. The whole point of a type identifier is to indicate syntax, not semantics.

    My answer to the question is in two parts.
    Stack allocated variables - use a notation to indicate general type (integer, float, string, datetime) not specific type (int32, int64, etc).
    Object types - the whole point of polymorphism is that object type is not important (as long as inheritance chains match) so using a type identifier in the name is not required and might be counterproductive.

    THe comments about renaming in the programming tool doens't work if the item you are renaming is an external property and is referenced in other code that calls yours.

    B
  • Havokk 2008-08-26 18:32
    Havokk:
    My answer to the question is in two parts.

    Oops, missed one.
    I use a type prefix to indicate user interface objects (for example controls on an HTML form).

    I also missed a few speeling mistaks... oh well, I'll try harrder next tyme.

    B
  • awefawef 2008-08-26 18:50
    wtf:
    Surely you're joking...

    But seriously, what 3 disadvantages to MVC do you have in mind?
    Monolithic controllers. That's a big disadvantage, if your MVC implementation doesn't support multiple controllers.

  • real_aardvark 2008-08-26 19:03
    awefawef:
    wtf:
    Surely you're joking...

    But seriously, what 3 disadvantages to MVC do you have in mind?
    Monolithic controllers. That's a big disadvantage, if your MVC implementation doesn't support multiple controllers.

    Splendid: now we're on to JMK's beauty contests.

    In the mean time, check out Terrence Parr on the basics of doing MVC right.

    It's just fucking organisation, for God's sake.

    Oh, and for the total lunatic who suggested that it leads to "overhead" because of "too many files" and "wasting memory by passing messages between those files," well ...

    ... Try parsing Sanskrit. You can't possibly be more useless in the real world, and, you never know, it could be fun.
  • JD 2008-08-26 19:10
    The RWTF is that you are such a vain person
  • awefawef 2008-08-26 19:12
    real_aardvark:
    awefawef:
    wtf:
    Surely you're joking...

    But seriously, what 3 disadvantages to MVC do you have in mind?
    Monolithic controllers. That's a big disadvantage, if your MVC implementation doesn't support multiple controllers.

    Splendid: now we're on to JMK's beauty contests.

    In the mean time, check out Terrence Parr on the basics of doing MVC right.

    It's just fucking organisation, for God's sake.

    Oh, and for the total lunatic who suggested that it leads to "overhead" because of "too many files" and "wasting memory by passing messages between those files," well ...

    ... Try parsing Sanskrit. You can't possibly be more useless in the real world, and, you never know, it could be fun.
    WTF? You know, not all MVC implementations support multiple controllers. Nothing says fun like rummaging through a 4000 line controller file.

    Jesus Christ in a can, if "organisation" was all that it took to program properly, Martha Steward would own your ass.
  • John Hardin 2008-08-26 19:13
    140 tries? Geeze, what a lamer.

    A multiple choice quiz with maximum (for example) five options per question, minimal feedback on the results (e.g. you got it right/wrong vs. telling you what the right answer is and why), and the same questions every time can be aced in at most five tries, even if you have zero knowledge of the subject matter...

    I'm reminded of War Games where WOPR is trying to guess the launch code. It could guess the characters of the code individually (vs. having to guess the whole code at once, no doubt as a poorly-thought-out dramatic tension enhancement ploy) - which means the launch code would have taken at most 36 tries to guess.

    "WOPR's trying to guess the... oh. Crap."
  • Appomattox 2008-08-26 19:45
    TRWTF in the second story is that the applicant didn't log the answers that got him the high score and submit them from a different IP address.

    TSRWTF is that the test was designed to report the score directly to the user -- and then let the user take the test again.

    TTRWTF is that the person who designed the test didn't at least have the kid in to interview for some low-level testing position, since he's obviously pretty good at breaking your code.
  • cfreak 2008-08-26 20:24
    Top Cod3r:
    and the importance of naming your variables with a prefix that tells you what type it is.


    What is it with Windows developers that feel the need for this? What if you change the code and your variable needs to change type? Do you find and replace every file to make sure you change the variable (annoying, tedious and error prone) or do you change the type and don't bother to go change the variable name? (making the practice useless).

    What do you do if the program itself needs to change the variable's type?

    I won't go so far as to call it a WTF but it just seems it creates more problems that it solves; especially with modern IDEs that can easily show you the variable's definition.

    Of course I develop on Linux so what do I know? :)
  • lokey 2008-08-26 20:38
    A Wizard a True Star:
    Oh boy... just when I thought the Hungarian Notation holy war was over.

    Sam B:
    In this day and age, with IDEs (especially with the VB IDE) helping the programmer find out what type a variable is, there is absolutely no reason why anyone should advocate Hungarian Notation, save for the continued maintenance of legacy code.


    Well, I can see a couple of important reasons to use Hungarian Notation, or least some variation of it.

    In the VB.NET IDE you have to hover your mouse over a variable to figure out what type it is. Sometimes you can only see the type during run-time. Whereas, with some kind of variable naming convention, you can just read the code and know what the variable is supposed to be. I know it seems like a minor thing, but it really does make life a lot easier.

    And god forbid you're stuck debugging code without an IDE, which happens more often than you'd think.


    Sam B:
    I think "The Real WTF" is that you advocate Hungarian Notation... in Visual Basic.


    So, in which languages do you think Hungarian Notation would actually be useful?


    Sam B:
    Even Microsoft does not recommend it any longer ("Do not use Hungarian Notation").


    Microsoft recommends a lot of things which are not exactly a) smart or b) the best way to increase productivity.



    Yes, like using any Microsoft product - definitely not: a) smart or b) the best way to increase productivity - but a definite win for marketing...
  • lokey 2008-08-26 21:04
    Sann B:
    Sam B:
    Eam:

    What about the point where one fails to detect satire or sarcasm, consistently?


    Well, this being the Internet, where it's already difficult to detect satire or sarcasm, one must make an "extra effort", as it were, to ensure that people get your point.


    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.


    Don't slam Americans! Asshats exist in all countries - just look in the mirror...
  • Ggreg 2008-08-26 21:14
    Where are the grammar nazis: nThat vIs adjAwesome

  • Me 2008-08-26 22:03
    A Wizard a True Star:
    Oh boy... just when I thought the Hungarian Notation holy war was over.

    Sam B:
    Even Microsoft does not recommend it any longer ("Do not use Hungarian Notation").


    Microsoft recommends a lot of things which are not exactly a) smart or b) the best way to increase productivity.



    Damn. M$FT can't catch a break. People dump on them for using HN, and when they finally own up to their mistake, someone comes along and dumps on for that.
  • montgomery 2008-08-26 22:04
    Both contributors are douchebags.

    I cower in the awesome intellect of Mr Prime. His knowledge that 1 is not a prime (anymore) is dizzying nee sublime. All hail Ultimate Prime, you sir are my hero. Next time you have our permission to dispatch such heretics that stick to the old ways of one-as-prime.

    Or maybe the CEO douchebag just wanted you to prove you knew C# and write a simple 5 line program, and instead you stalled, got in a huff, and left.

    Next time, it's going to be the awesome tale of how Sir Prime was forced to write a string reversal algorithm. I crap my pants in suspense.
  • Mr.'; Drop Database -- 2008-08-26 23:07
    awefawef:
    wtf:
    Surely you're joking...

    But seriously, what 3 disadvantages to MVC do you have in mind?
    Monolithic controllers. That's a big disadvantage, if your MVC implementation doesn't support multiple controllers.
    Don't forget:

    * Poor documentation. That's a big disadvantage, if your MVC implementation isn't documented well.
    * Random crashes/data loss. That's a big disadvantage, if your MVC implementation contains lots of bugs.
    * Getting raided by the FBI. That's a big disadvantage, if your MVC implementation automatically attacks government websites.
  • Chris 2008-08-26 23:20
    John:
    "Lots of WTFs here, but not in the ways the authors intended. "

    Got to agree with you. The Prime Number [WTF] doesn't mention what type of company the startup was. Quite possibly the CEO was the kind of person that knows Primes inside-out.

    For those that think their knowledge of maths is excellent (myself included), have a look at this: http://xkcd.com/179/
    My reaction was the exact same, and had to go to quickmath.com the verify it.

    btw. What's with people saying what the captchas were?
    e^(i*pi) is a well known in engineering mathematics. I wouldn't exactly call a knowledge of math without differential equations "excellent".
  • Zoinks 2008-08-26 23:39
    "That", in the given context, is not a noun but a pronoun.
    If you're going to "fix" something, why not actually fix it?

    Also, to all the biters of TopCod3r (especially Sam B): please stop ruining this site with your pathetic attempts to argue with satire/trolling -- whichever it is, it's way more advanced than anything you've posted.
    Go back to slashdot, where you stand a chance of appearing (relatively) intelligent. You're strictly 1st percentile here, you miserable oxygen thieves.
  • Kuba 2008-08-27 00:09
    panzi:
    Top Cod3r:
    Name 3 disadvantages of the MVC design pattern.


    I'm curious, what are disadvantages of the MVC design pattern? I can't think of any. It's not overly complex, it does not add a lot of overhead... what are the disadvantages?


    In some cases -- BTDT -- it produces code that's harder to maintain, understand and extend than non-MVC design.

    For example, I've had one project where I, quite artificially, decoupled the forms from the "controller" which populated them, switched them, validated inputs, extracted data, etc. This was using the Qt famework. So, instead of using all that Qt provides and having a nice, self-contained and understandable form that could handle its own problems (such as wrong data, parsing/formatting from/to model, etc), the form was dumb, and the code to handle it (the controller) was elsewhere.

    While MVC-kosher, in retrospect it was a small-scale snafu. MVC led the form to be stripped of any encapsulation that OOP would normally provide, in fact there were multiple levels of encapsulation: some things, which didn't break MVC separation, were abstracted out in the form, while others couldn't due to controller's involvement. During maintenance it wasn't exactly trivial to determine which way it would be without looking at the code. I wrote it and I had to constantly look things up, which meant someone else would just call it a clusterfuck and refuse to touch it.

    I have later rewritten it to bundle the view and the controller, and the code shrank by 50% and became a breeze to work with. It was, just by the feel of it, the simplest, least astonishing way of doing it, and pretty natural when dealing with code targeting Qt.

    Qt provides reasonably good M-VC separation in its model-oriented controls, but they too don't force you to separate the controller out; in fact they make the controller functionality subclasseable/extendable on as-needed basis. It just feels "sane" when using, and seems natural - at least to me.

    Of course there are situations, like in web programming, where not only the model and view are physically separated, but the controller can have multiple personalities too, and be spliced between the ajax client and the application server. But there it actually makes sense, and still it doesn't come with its own pains (thus emergence of all those nifty web application frameworks).

    Cheers, Kuba
  • Zemm 2008-08-27 00:23
    panzi:
    Top Cod3r:
    On Error Resume Next


    One of the "greatest" features of Visual Basic. "Just ignore all errors." *shudder*


    It started in QuickBasic. I remember finding it quite handy, but since learning more elegant ways to handle errors, I haven't used it since about 1997. QB also used the old BASIC type suffix: like S$ for a string or N! for float or I% for integer. Does VB still support those? I have never used VB so I wouldn't know. :)
  • more randomer than you 2008-08-27 00:25
    Vroomfundel:
    Muahaha, I'm beginning to like the way Top Cod3r is becoming the laughing stock of the day.

    Frist, in this sense!


    Actually, it is all the idiots who can't recognize a troll when they see one (i.e. people like you) who we laugh at.

    Topcod3r aka 'Brian' is a clever troll and chooses sides of contraversial topics to claim as fact.

    You were the bait. Fact.
  • 6pac 2008-08-27 00:29
    Gotta say, it was 100% obvious to me he was a troll as soon as I read the post. I just couldn't believe that so many people took the bait.
    And I've never seen him post before.

    But I suppose I am a former VB/C++/C#/QuickBASIC/Forth/Pascal/Transact-SQL/6502 Assembler programmer so that probably helps.
    Seriously, if ANYONE starts extolling the virtues of Hungarian notation (shudder) and ON ERROR RESUME NEXT, your troll ears have got to start twitching !
    Not that ON ERROR RESUME NEXT isn't very useful in the right hands, but it's a real favourite twig to bash VB coders with !
  • Jim 2008-08-27 00:34
    Sam B:

    There's a point where if your satire or sarcasm is so veiled as to be undetectable, consistently, then it's just plain trolling.


    It was plainly obvious that he was joking to us true top coders :) It was a materful troll and I'm glad it made people like you so grumpy.
  • montgomery 2008-08-27 00:46
    6pac:
    Gotta say, it was 100% obvious to me he was a troll as soon as I read the post. I just couldn't believe that so many people took the bait.
    And I've never seen him post before.

    But I suppose I am a former VB/C++/C#/QuickBASIC/Forth/Pascal/Transact-SQL/6502 Assembler programmer so that probably helps.
    Seriously, if ANYONE starts extolling the virtues of Hungarian notation (shudder) and ON ERROR RESUME NEXT, your troll ears have got to start twitching !
    Not that ON ERROR RESUME NEXT isn't very useful in the right hands, but it's a real favourite twig to bash VB coders with !


    It was a necessity when years ago, some of us were writing some VBScript, IIS4 or 5 running Classic ASP calling COM objects. The reason to do On Error Resume Next was because an error HResult from a COM object would kill the Classic ASP script dead in its tracks. Not exactly desired behavior for your website. So if you set errors off, you can then query the Err object and handle the situation properly.

    It's not exactly rocket science, and it's nowhere as clean as try/catch/finally, but it has it's place.
  • more randomer than you 2008-08-27 00:49
    SarcasmFTW:
    You kinda have to assume that the first interview is for a position requiring a fair amount of mathematical knowledge. Because unless I have really fallen out of touch, knowing off the top of your head how to calculate the nth prime is not something everyone is expected to know how to do.
    Unless of course, they were expected the exhaustive search method, but if they were only expecting that, why even bother ask the question.




    I think it is a good beginner question. Wondering what the nth prime is shows a lack of understanding the question. You only want to know what the n'th prime is after you already know the (n-1)th prime, recursively until the first prime. Knowing not to bother testing division by non-prime numbers is also something else they would have been looking for. You don't have to have a mathematical PHD to realise that there is no point testing for division by 6 if you have already tested for division by 2. Finally, there would probably be bonus 'marks' for people who put in optimisations such as only testing odd numbers higher than 2. In short, it is a simple problem which an intelligent applicant should be able to solve in short time regardless of their mathematical knowledge - provided they know what a prime is.

    I didn't test or double check this code, but it should be pretty clear how it is working.


    double possiblePrime = 1;
    for(numFoundPrimes=0;numFoundPrimes<n;possiblePrime++) {
    isPrime = false;

    for(int prime : foundPrimes) {
    if(possiblePrime/prime % 1 == 0) {
    isPrime = false;
    break;
    }
    }

    if(isPrime) {
    numFoundPrimes++;
    foundPrimes.add(possiblePrime);
    }

    }

    print(foundPrimes);
  • Hungarian 2008-08-27 00:55
    Zemm:
    panzi:
    Top Cod3r:
    On Error Resume Next


    One of the "greatest" features of Visual Basic. "Just ignore all errors." *shudder*


    It started in QuickBasic. I remember finding it quite handy, but since learning more elegant ways to handle errors, I haven't used it since about 1997. QB also used the old BASIC type suffix: like S$ for a string or N! for float or I% for integer. Does VB still support those? I have never used VB so I wouldn't know. :)


    QB was a bit of a hybrid. It also supported dim s as string, IIRC.
  • Sam B 2008-08-27 03:16
    Jim:
    Sam B:

    There's a point where if your satire or sarcasm is so veiled as to be undetectable, consistently, then it's just plain trolling.


    It was plainly obvious that he was joking to us true top coders :) It was a materful troll and I'm glad it made people like you so grumpy.


    Not grumpy :) I don't particularly care; after all, this is the internets, right? I enjoy debate, or putting an idiot in his place. If it turns out the idiot was a troll and I fell for it... *shrug* I'm over it.

    The only reason it seemed plausible to me is because I've actually heard from serious people the same crap that "Top Cod3r" was spewing. And they were being serious. And it happened many times throughout my tenure as a programmer. So, Top Cod3r's stance wasn't beyond-a-shadow-of-a-doubt illegit.

    Oh well. It's all fun and games, etc.
  • Mr.'; Drop Database -- 2008-08-27 03:57
    more randomer than you:

    double possiblePrime = 1;
    for(numFoundPrimes=0;numFoundPrimes<n;possiblePrime++) {
    isPrime = false;
    for(int prime : foundPrimes) {
    if(possiblePrime/prime % 1 == 0) {
    isPrime = false;
    break;
    }
    }
    if(isPrime) {
    numFoundPrimes++;
    foundPrimes.add(possiblePrime);
    }
    }
    print(foundPrimes);
    I sense a golf challenge coming on ...
    primeFilter (p:ns) = p : primeFilter [n | n <- ns, n `mod` p /= 0]
    
    allPrimes = primeFilter [2..]
    main = do numPrimes <- readLn
    print $ take numPrimes allPrimes
  • Tourist 2008-08-27 04:24
    Chris:
    int iValue;

    ... 20,000 lines later...

    Oops, we need to handle more widgets than we expected. Make iValue a 'long'.

    Now what do you do? Do you change every instance of 'iValue' to 'lValue'? How long will that take? Remember to include time for testing, documentation, etc. This may not even be possible, e.g., if this is in a published libraries used by others.


    You call the variable nItem

    Chris:

    Then there's the whole 'far pointer to an array of pointers to functions expecting a string and an integer and returning nulls' prefix thang. (Oops, not the function takes a long!). Any meaningful prefix for that will be a nightmare to read -- "fpApfvSia[i++] = fpApfvSib[j++];" anyone?


    ever heard of typedef's ?


  • None given 2008-08-27 04:55
    [quote user="John]
    ...
    For those that think their knowledge of maths is excellent (myself included), have a look at this: http://xkcd.com/179/
    My reaction was the exact same, and had to go to quickmath.com the verify it.
    [/quote]

    That's actually an inferior rewrite of what some consider to be the most beautiful equation in mathematics, involving only the constants pi, e, 0, i and 1.
  • Robert Synnott 2008-08-27 04:59
    "I like to start off with simple questions like the proper use of On Error Resume Next," - Answer: Don't use it, or a language which contains it. (I assume it died with classic VB[script], right?)

    "and the importance of naming your variables with a prefix that tells you what type it is." - No value. Silly. Your IDE will tell you. Looks mad. Even Microsoft no longer seems to bother.

    So, do I get the job? :)
  • Hatshepsut 2008-08-27 05:14
    ... a pretty difficult, broad-scoped multiple choice quiz ... designed to gauge experience, not book smarts.


    This sounds to me like a pretty ambitious goal. Can you provide some realistic example questions?
  • Robert Synnott 2008-08-27 05:21
    6pac:

    Not that ON ERROR RESUME NEXT isn't very useful in the right hands...


    No it bloody isn't. Stop justifying absurd design decisions on their path. It's just bad and silly and wrong.

    (I once did maintenance on some ASP classic code for a while. It wasn't very nice.)
  • Tepsifüles 2008-08-27 05:30
    John Hardin:
    140 tries? Geeze, what a lamer.

    A multiple choice quiz with maximum (for example) five options per question, minimal feedback on the results (e.g. you got it right/wrong vs. telling you what the right answer is and why), and the same questions every time can be aced in at most five tries, even if you have zero knowledge of the subject matter...

    If the minimal feedback consists only of the number of questions you got right/wrong and not which ones they were, then you would be very hard pressed to get all the questions right after 5 dummy runs. Granted, 140 tries is still excessive for any reasonably sized quiz (and getting only to 92% out of that), but it definitely requires some thinking to get the right answers in a small number of tries.
  • Ville 2008-08-27 05:39
    Robert Synnott:
    6pac:

    Not that ON ERROR RESUME NEXT isn't very useful in the right hands...


    No it bloody isn't. Stop justifying absurd design decisions on their path. It's just bad and silly and wrong.

    (I once did maintenance on some ASP classic code for a while. It wasn't very nice.)

    Ok, so just out of curiosity, what is the big difference:

    Try
    
    SomeFileFiddlingFunction()
    Catch ex As System.IO.FileNotFoundException
    DoProperThingsForFileNotFound()
    Catch ex As System.IO.InvalidDataException
    DoProperThingsForInvalidData()
    End Try


    'vs

    On Error Resume Next
    SomeFileFiddlingFunction
    Select Case Err.Number
    Case 53 'File Not Found
    DoProperThingsForFileNotFound
    Case INVALID_DATA
    DoProperThingsForInvalidData
    End Select
    On Error GoTo 0
    [/code]

    Obviously the above one looks nicer, but consider it isn't an option.
  • fbjon 2008-08-27 06:25
    Franz Kafka:

    loosely typed languages need real HN even more - how are you supposed to know what variable x is supposed to be unless you tag it with something like name or amount?

    Then why are you using a loosely typed language in the first place?
  • hikari 2008-08-27 06:28
    Well it does depend...on whether you're a pre-C19th mathematician or not.
  • dkf 2008-08-27 06:59
    fbjon:
    Franz Kafka:
    loosely typed languages need real HN even more - how are you supposed to know what variable x is supposed to be unless you tag it with something like name or amount?
    Then why are you using a loosely typed language in the first place?
    Unless you go completely overboard with the types in the first place (yes, I've seen this in Ada derivatives and I never want to again) then the type will only capture the operations that are legal on the value and not the purpose of the value. IDEs are great at showing types and terrible at conveying purposes, and yet it is the purpose of the value that is important. For example, if you have x and y coordinates, it's usually not a good idea to add them — unless you're applying a transformation matrix, of course — and yet they're naturally the same numeric type, and so addition is quite legal; spotting that sort of thing is a good use of purpose annotations. You can have similar things with strings. If you put the purpose of the variable in the name, it's much easier to use. And remember, you're allowed to use multiple letters for a purpose; cryptic single letter stuff makes Baby Jesus cry.
  • Hans 2008-08-27 07:12
    Moitah:
    gabba:

    Lots of WTFs here, but not in the ways the authors intended.


    I agree with you. Today's WTFs aren't that great.


    I agree as well. Today's comments aren't that great.
  • Sellnosoup 2008-08-27 07:27
    lets see-

    we had:
    table
    wood
    printed on a sheet of paper

    ...Almost!!
  • Flagger 2008-08-27 09:02
    Lots of people don't know that 1 is prime. That's not a wtf at all, really. Prime numbers are just some definition. Most people can live just great without knowing it. Even programers.

    The later wtf is really sad. For a good part of the text I thought the wtf would be that the test was quite lame. As it turns out someone showed how flawed it is for using a test to qualify someone and instead of thanking him, he only got ignored.
  • KenW 2008-08-27 09:03
    D. T. North:

    And isn't that the root of everything coded by Microsoft?


    Ahhh... The clearest possible sign that someone has no programming skills and no intelligence: the need to mindlessly and needlessly engage in Microsoft bashing.

    Congratulations.
  • KenW 2008-08-27 09:06
    schaefer:
    If the company's purpose was to find prime numbers I would be worried that the CEO didn't know that 1 was not prime.


    However, if the CEO thought that the ability to calculate prime was important enough to use that as an interview question, you'd think he'd trouble himself to know the right answer, wouldn't you?

  • VP 2008-08-27 09:14
    How I aced a online consultant test a couple years ago? Fired up ollydbg and paused the thread the app was running inn... Gave me more than the 2-5 mins per question. Hey if I can freeze a thread and use google to find it I sure as hell can find it via google at a job :P
  • KenW 2008-08-27 09:22
    J B:
    Seriously, you have an out of the box thinker.
    Someone with potential, they hack away a bit - and you pass him up. You're an id10t.

    Seriously wtf.


    Seriously, you have an idiot who doesn't realize that cheating your way through a test doesn't make you an "out of the box thinker"; it makes you a liar and cheater.

    I'd pass you up. You think that lying and cheating makes you a "hacker". You're a moron. (And on top of that, you can't spell, either - real intellect knows that there are no numbers in idiot, no matter how kewl you think it makes you look. We all still know you're a loser script kiddie.)
  • rick 2008-08-27 09:40
    isn't that how the attorney general's office works?
  • rick 2008-08-27 09:41
    Top Cod3r:
    Vroomfundel:
    Top Cod3r:
    the importance of naming your variables with a prefix that tells you what type it is


    WTF? Why don't you ask why Jesus is so much cooler than Buddha?


    Because we aren't allowed to ask questions like that when hiring people. Someday if you interview candidates, your HR person will tell you what kinds of questions are not allowed to ask.


    Isn't that how the attorney general's office hires people.

    -sorry about the duplicate.
  • KenW 2008-08-27 09:58
    Kev:
    Kev:
    ... He used some 3rd party site that let him make the exam and send give him the results...


    I should have mentioned that it was an english class. Not one of my strong subjects.


    You might be doing better with it now if you hadn't cheated your way through it then. ;-)
  • KenW 2008-08-27 09:59
    Ville:
    real_aardvark:
    Sheesh. Man can't even spell FILE_NOT_FOUND properly.
    Who might you be referring to. And if you don't understand what you read, maybe you shouldn't comment on that particular message.


    Emphasis added to help you, Ville.
  • KenW 2008-08-27 11:46
    Robert Synnott:
    "I like to start off with simple questions like the proper use of On Error Resume Next," - Answer: Don't use it, or a language which contains it. (I assume it died with classic VB[script], right?)

    "and the importance of naming your variables with a prefix that tells you what type it is." - No value. Silly. Your IDE will tell you. Looks mad. Even Microsoft no longer seems to bother.

    So, do I get the job? :)


    Not until you're smart enough to quote properly. ;-)
  • Robert Synnott 2008-08-27 12:21

    Ville:
    It's interesting to see how many here thinks ORNE is only suitable for hiding errors.

    The only times I've used ORNE are basically something like the following

    On Error Resume Next
    Open FileToRead for Input as #FileId
    If Err Then
    ReturnValue = FAILED_FILE_INACCESSIBLE
    Exit Sub
    End If
    On Error Goto 0


    *gapes in horror*

    I mean, really. It's not 1980 any more. We have real non-mad exception handling which doesn't rely on mad GOTO tricks exposed to the programmer. Err is some sort of magic variable, I assume?
  • Ville 2008-08-27 12:22
    KenW:
    Emphasis added to help you, Ville.
    Well, I realised later that FILE_NOT_FOUND might be some insiders joke, that I'm just not getting yet. There seems to be many references to it on other threads.

    Otherwise I don't see how that comment would be relevant, considering file not existing is only one of several reasons why file open might fail.
  • Ville 2008-08-27 12:26
    Robert Synnott:
    Err is some sort of magic variable, I assume?
    In Visual Basic Err is an object containing details of occurred error, pretty much like the Exception object you would catch in more recent languages.
  • Mark 2008-08-27 12:43
    wtf:
    Surely you're joking...

    But seriously, what 3 disadvantages to MVC do you have in mind?


    Unjustifiable overhead in apps that don't benefit from MVC?

    MVC is great, but not always the solution. Using it in Access for example doesn't really work so well. You can separate your presentation layer, business logic layer, and data access layers separately which is still a win. But that's not necessarily MVC.
  • Ville 2008-08-27 12:57
    Actually, I'll explain in a bit more detail.

    Robert Synnott:

    Ville:
    On Error Resume Next
    Open FileToRead for Input as #FileId
    If Err Then
    ReturnValue = FAILED_FILE_INACCESSIBLE
    Exit Sub
    End If
    On Error Goto 0


    *gapes in horror*


    The above code is effectively equivalent to more recent syntax:
    Try
    
    MethodAccessingFileThatMayThrowException
    Catch (Ex as Exception)
    Return FAILED_FILE_INACCESSIBLE
    End Try


    So basically "On Error Resume Next" means that we don't want to throw error possibly generated by the following sentence(s) to next level, but instead we would like to handle them here.

    The next line "If Err Then" is basically the same as "Catch (Ex as Exception)". Err is an object that gets information of any errors occurred after we instructed "On Error...". "If Err Then" is shorter way of writing "If Err.Number <> 0 Then" because Number is the default value of Err object and anything besides 0 is considered true as boolean.

    And On Error Goto 0 means that we don't want to handle errors locally anymore but instead throw it to next level. So it's basically "End Try"

    I agree the syntax was not nice, but it was generally something a programmer could not decide by himself/herself.

    So yeah, I guess in twenty years from now when we've come up with neater syntax someone might look at todays "Try .. Catch .. Finally" block and gape in horror.

    Robert Synnott:
    I mean, really. It's not 1980 any more.
    Well, I wasn't saying this is something that should be used today, was I? I was commenting about the misconception people have about how OERN was supposed to be used - back in the day when people used languages that had different ways of handling errors than what we are used to today.

    Saying OERN is only good for ignoring errors is just as sane comment as claiming that Try Catch is only good for ignoring errors. Sure, both can be used for that, but neither are designed for that.
  • Mark 2008-08-27 13:18
    It has been a long time since I have done VB coding, but if I remember correctly On Error Resume next had some practical purposes.

    I think one of the most common purposes was dealing with pulling items from a collection or seeing if an item was in a collection. If I recall correctly, one of the best ways was to set On Error Resume next ant then access the item as if it was in there. If there is an error then it was not, if there is no error than it was.
  • savar 2008-08-27 13:25
    I can name 3 off the bat:

    1) Possibly overkill for small projects. You might not need a model layer for a quick n' dirty.
    2) Requires you to segment code along MVC dimensions, rather than functional areas. (Of course, this is also a benefit of MVC, but it's a double edged sword.)
    3) Business logic is still not all in one place, because some will be in the model layer and some will be in the controller layer.

    Still I think it makes the most sense for nearly every business application out there.
  • Steve 2008-08-27 14:09
    The trouble with MVC in web applications is that it's never done right. Hint: if your controller is server-side, then you're doing it wrong.

    MVC is about user interfaces and event loops, not program organization.


    The controller interprets the mouse and keyboard inputs from the user, commanding the model and/or the view to change as appropriate.


  • An Old Hacker 2008-08-27 14:53
    Sorry. Buy yourself a real test engineer, and he'll automate this joker out of a job in a few days. Test is harder than design, people.
  • real_aardvark 2008-08-27 15:31
    Tourist:
    Chris:

    Then there's the whole 'far pointer to an array of pointers to functions expecting a string and an integer and returning nulls' prefix thang. (Oops, not the function takes a long!). Any meaningful prefix for that will be a nightmare to read -- "fpApfvSia[i++] = fpApfvSib[j++];" anyone?


    ever heard of typedef's ?


    Yes, let's invent a totally unnecessary and obfuscatory way to mangle our code, and then use the built-in aliasing of the language to magic away the migraine (and also the supposed semantic or syntactic carrier signal).

    This wins the Tin Foil Hat Award for the most entertaining defence of the indefensible seen so far. Or for trolling. Or for sarcasm. Any which way, it's superbly tin-foily.

    (Lose the green-grocers' apostrophe, btw. An opportunity to exercise my inner Grammar Nazi as well ... can life get any sweeter?)
  • Tom JP 2008-08-27 15:46
    El Duderino:
    A Wizard a True Star:
    So, in which languages do you think Hungarian Notation would actually be useful?
    pI advActually vLove adjHungarian nNotation advSo adjMuch, pI vUse pIt advAll artThe nTime! pIt advSure vMakes nEnglish adjEasier prepTo vUnderstand. vImagine cIf pYou vHad prepTo vRead pThis prepWithout pIt. pYou vWould vHave adjNo nClue advWhat pThese nWords vMeant prepWithout pTheir nParts prepOf nSpeech!


    I never was into the whole brevity thing.
  • pglewis 2008-08-27 16:12
    Always refreshing to see the amazing level of penis fencing in the comments.

    As has been pointed out by several reasonable people, On Error Resume Next had quite legitimate uses in VB6 and prior. One might prefer to check for error conditions in-line in certain situations rather than construct a series of complex error handlers (leads to spaghetti) or having a catch-all handler try to figure out the context. Remember good ol' fashioned ANSI C?
  • Jay 2008-08-27 16:46
    I'm working on a reference book which I think might be valuable to many aspiring mathematicians: A List of Even Primes (Abridged Edition).
  • Maurits 2008-08-27 16:51
    real_aardvark:
    Tourist:
    ever heard of typedef's ?

    (Lose the green-grocers' apostrophe)


    That's not a greengrocers' apostrophe. It is acceptable to use an apostrophe before a plural "s" in cases where this removes ambiguity. I would include compiler keywords in such cases.

    http://en.wikipedia.org/wiki/Apostrophe#Use_in_forming_certain_plurals

    E.g., in a code review, I might say "consider replacing all of your fget's with fget_s" and I would heartily defend that apostrophe to the core of my eating-shoots-and-leaving being.
  • Jay 2008-08-27 16:59
    When I'm interviewing people for jobs, I give them a sample of code that I've written. If they immediately fall to their knees and shout, "You are a programming god! I am not worthy to study at your feet, but please allow me the privilege of basking in your glory!" then I conclude the person should be hired. If they presume to find flaws in my code, I order that they be immediately killed.
  • Maurits 2008-08-27 17:08

    "It depends?" I questioned, unsure if this was some sort of trick question, "it depends on...?"

    "Well," he responded, "there are times when '1' is prime, and times when it's not."

    I was tempted to ask what it depended on


    Um, you *did* ask what it depended on.

    The interviewer's answer, though not especially informative, is fairly close to correct. 1 is "prime" if your notion of "prime" is "non-negative, non-composite integer."

    The more forthcoming answer is that 1 is *better* than prime - it's the *multiplicative identity* (or a "unit", for those versed in ring theory.)

    The interviewer was probably less interested in whether you printed 1 than if you did other things... like use the inequality

    Pn < n ln n + n ln ln n (for n >= 6)

    to do a Sieve-of-Erastosthenes solution for speed...

    or some other approach for memory...

    Most of the "code interview" is tackling the problem. Surprisingly little is actual code.
  • Jay 2008-08-27 17:16
    I can think of lots of drawbacks of MVC, like for starters, by splitting code across three modules, you can make it more difficult for a reader to see the flow.

    I'd be hard-pressed to think of any programming technique that has absolutely no drawbacks. Someone who says that he cannot even imagine any situation where a given technique would be a bad idea is admitting that he either doesn't understand all the implications of the technique or that he doesn't have much imagination. Database normalization? Excellent idea, but surely we all know times when denormalization can simplify code or improve performance. Data hiding? Sure, but sometimes a variable is used in so many places and is so obviously generic that a public global is preferable to passing it up and down every parameter list in the system. Etc.
  • real_aardvark 2008-08-27 17:42
    Maurits:
    real_aardvark:
    Tourist:
    ever heard of typedef's ?

    (Lose the green-grocers' apostrophe)


    That's not a greengrocers' apostrophe. It is acceptable to use an apostrophe before a plural "s" in cases where this removes ambiguity. I would include compiler keywords in such cases.

    http://en.wikipedia.org/wiki/Apostrophe#Use_in_forming_certain_plurals

    E.g., in a code review, I might say "consider replacing all of your fget's with fget_s" and I would heartily defend that apostrophe to the core of my eating-shoots-and-leaving being.
    (a) Read better authorities (Fowler et al spring to mind)
    (b) You are, I'm afraid, wrong
    (c) Itll' happen anyhoo. Us gots no choice.
    (d) Consider replacing 'fget' with 'fget_s.' Or did you mean, consider replacing 'fgets' with 'fget_s'? Or did you mean "I don't give a fuck whether there's an apostrophe or a plural or any other form of grammatical annoyance -- just type 'fget_s' whether it makes any sense or not?

    This is a terribly important question.

    (e) I'm guessing here, because Wikipedia is renowned throughout the academic world as an incorruptible authority par excellence -- and, of course, a simple URL link to such a treasure trove would immediately lead me to your point -- that you are referring to the following comment:

    "The apostrophe is often used in plurals of symbols. Again, since there can be no misreading, this is also regarded\[who?\] as wrong.\[23\] That page has too many &s and #s on it."

    You will find my answer to your assertion somewhere between your upper thighs and your lower abdomen. Don't squeeze too hard. Somebody might be listening.
  • Ville 2008-08-27 19:15
    Jay:
    I'm working on a reference book which I think might be valuable to many aspiring mathematicians: A List of Even Primes (Abridged Edition).


    One definition of even number is that it has integer factor 2. This naturally leads to certain limits on how many even primes can exist.

    If your book becomes succesful you should consider sequel called A List of Primes With Integer Factor 3 (Abridged Edition).
  • Maurits 2008-08-27 20:12
    real_aardvark:

    (a) Read better authorities (Fowler et al spring to mind)

    Conventions are not formed by authorities, merely reported by them; as such they are constantly out-of-date. And by the way, "et al." has a period after "al".

    real_aardvark:

    (d) Consider replacing 'fget' with 'fget_s.' Or did you mean, consider replacing 'fgets' with 'fget_s'? Or did you mean "I don't give a fuck whether there's an apostrophe or a plural or any other form of grammatical annoyance -- just type 'fget_s' whether it makes any sense or not?


    Oops, bad example (the function name is fgets) - make that "Consider replacing sprintf's with sprintf_s'es"

    real_aardvark:

    (e) I'm guessing here, because Wikipedia is renowned throughout the academic world as an incorruptible authority par excellence -- and, of course, a simple URL link to such a treasure trove would immediately lead me to your point -- that you are referring to the following comment:

    "The apostrophe is often used in plurals of symbols. Again, since there can be no misreading, this is also regarded\[who?\] as wrong.\[23\] That page has too many &s and #s on it."


    I was actually referring to this:
    "An apostrophe is used by some writers to form a plural for abbreviations, acronyms, and symbols where adding just s rather than 's may leave things ambiguous or inelegant."

    Adding just s to a compiler token creates a different compiler token. Adding 's makes it clear that the thing preceding the apostrophe is the term, and that the s is not part of it.
  • anonymous 2008-08-27 22:04
    Top Cod3r:
    I purposely tried to make it complex so we could weed out developers who think they know everything but don't. ..., and the importance of naming your variables with a prefix that tells you what type it is. ...

    The last couple years, we have had problems with new developers questioning the code and methodology we use, so I decided to add some real-life questions with some actual code examples from our apps to make sure that they are willing to learn from my code and not think that they know it all.


    How'd you get in then? Oh wait, you *do* know it all, despite the insistence that Hungarian (or similar) notation isn't an idea that should have died long ago.
  • Péter 2008-08-28 04:13
    Trivial to pronounce for some, for you maybe (or Top Cod3r). You can easily say "Gyagyás vagyok", right? "Mit sütsz, kis szűcs? Tán sós húst sütsz kis szűcs?"

    Let's then start the flame war over "Asiatic" languages:
    Hungarian belongs to the Finno-ugric subfamily of the Uralic family
    Turkish is a prominent member of the Turkic family.

    Bring it on!
  • Alex 2008-08-28 04:26
    "Well," he responded, "there are times when '1' is prime, and times when it's not."


    If you are old, 1 is a prime. Basically, a bunch of mathematicians decided that for certain proofs to work they had to change the definition of prime numbers. I call that cheating; 2+2=5 for large values of 2.
  • Ville 2008-08-28 05:42
    Alex:
    If you are old, 1 is a prime. Basically, a bunch of mathematicians decided that for certain proofs to work they had to change the definition of prime numbers. I call that cheating; 2+2=5 for large values of 2.
    Number 1 being prime is not very eloquent in many aspects. Consider factoring any number. Like 18, would that be 1 * 1 * 1 * 1 * 1 * 1 * 1 * 2 * 3 * 3. Technically that might be okay, but not too useful.

    Changing an arbitrary definition to another arbitrary definition in order to make rest of the things simpler is not cheating in my opinion.

    The "certain proofs" you are referring to would work even if 1 was considered prime, their wording would just be a bit more cumbersome.
  • Aran 2008-08-28 05:53
    Outlaw Programmer:
    Marty McFly:
    I hope this does not affect my possible future employment with ------- in the past.


    Their problem was they weren't thinking fourth-dimensionally!


    They actually had the chance to hire The Doctor, and they missed out on it!
  • Jobsworth 2008-08-28 05:54
    SarcasmFTW:
    You kinda have to assume that the first interview is for a position requiring a fair amount of mathematical knowledge. Because unless I have really fallen out of touch, knowing off the top of your head how to calculate the nth prime is not something everyone is expected to know how to do.
    Unless of course, they were expected the exhaustive search method, but if they were only expecting that, why even bother ask the question.

    I know about 4 different algorithms to calculate up the n-th prime: 2 sieve methods, one based on probability, and the Fermat test (which is actually for pseudoprimes).
    While I'm typing this comment, I just thought of a fifth: wgetting a primes list from the web, like http://primes.utm.edu/lists/small/1000.txt for the first 1000 primes, and parsing it in a bash script.

    Why do all the calculation if others have done it before you?

    CAPTCHA: ratis
  • Jobsworth 2008-08-28 07:27
    real_aardvark:
    Incidentally, Hungarian Notation would be a seriously bad idea for Magyar.

    Because Magyar is an agglutinative language?

    real_aardvark:
    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).

    If you are you referring to the hypothetical Uralo-Altaic language group (with Finnish, Estonian, Hungarian, Turkish, Mongolian, Korean, Japanese), the evidence is so thin and circumstantial, and so polluted with racial prejudices (because most linguist are from the Indo-European language group), that I call a Godwin.
  • eryn 2008-08-28 10:56
    Vroomfundel:
    Top Cod3r:
    the importance of naming your variables with a prefix that tells you what type it is


    WTF? Why don't you ask why Jesus is so much cooler than Buddha?


    it's different for everybody, i used to do this until i found that everybody was using different prefixs, so i just use suffixes now like SaveButton, NameTextBox, etc, its easier to remember the control/variable and i can choose the correct one (if there is more than one type of control with the same function, i.e. NameTextBox and NameLabel), using Intellisense that is.

    my 2cents, take it or leave it.
  • real_aardvark 2008-08-28 11:47
    Jobsworth:
    real_aardvark:
    Incidentally, Hungarian Notation would be a seriously bad idea for Magyar.

    Because Magyar is an agglutinative language?

    real_aardvark:
    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).

    If you are you referring to the hypothetical Uralo-Altaic language group (with Finnish, Estonian, Hungarian, Turkish, Mongolian, Korean, Japanese), the evidence is so thin and circumstantial, and so polluted with racial prejudices (because most linguist are from the Indo-European language group), that I call a Godwin.
    Hello, Mikey (a) G!

    Gosh, I forgot to mention the Nazis, didn't I? Naughty me. It's so obvious that I was associating Magyar and türkçe from an Aryan Nationalist point of view.

    Luckily you caught me at it. Silly me. I thought I was just talking about non-PIE languages, and assigning two of them the vague epithet of "asiatic."

    Love to know how the evidence is thin and polluted with racial prejudice, however. Even though I didn't mention it, and it's not remotely relevant to the fact that Turkish and Hungarian are not PIE, and I wasn't suggesting in any way, shape or form that Hungarian and Turkish share a recent common root; nor to the fact that both languages are pleasingly pronouncable (unlike, say, English), but ... Uralo-Altaic is a genuine and reasonable approximation for a linguistic group.

    I call dickhead.
  • real_aardvark 2008-08-28 11:53
    Maurits:

    I was actually referring to this:
    "An apostrophe is used by some writers to form a plural for abbreviations, acronyms, and symbols where adding just s rather than 's may leave things ambiguous or inelegant."

    Adding just s to a compiler token creates a different compiler token. Adding 's makes it clear that the thing preceding the apostrophe is the term, and that the s is not part of it.
    Well, I see your point, and I can't deny that I make exactly the same distinction for exactly the same reason.

    I try to avoid it if there's any alternative recourse, however.

    The basic problem is that you and I are two amongst six billion people, many of whom speak English, and many of whom speak English as a second language. Misuse of the apostrophe is easy, because it's practically universal, for understandable reasons of convenience. But why stop there? Why not mangle any other part of language.

    Permit me once more to introduce my friend Larry Trask, who is far better qualified on the subject than I.
  • pscs 2008-08-28 12:31
    Chris:
    int iValue;

    ... 20,000 lines later...

    Oops, we need to handle more widgets than we expected. Make iValue a 'long'.

    Now what do you do? Do you change every instance of 'iValue' to 'lValue'? How long will that take? Remember to include time for testing, documentation, etc.


    And here you come to one good reason TO use HN...

    So, you're not using HN, and you change

    int Value;

    to

    long Value;
    (easy, see, so why not do it?)

    Now, suddenly you get errors all over the place, for instance data persistence to binary files breaks, database storage problems occur (SMALLINT fields no longer work, and NUMERIC(5) fields do strange things), you get weird mathematical errors (long x = (long)Value * 50000) and so on.

    Having HN would at least make you think hard about changing the type of a variable without having tests in place.
  • DWalker59 2008-08-28 12:54
    Top Cod3r:
    I like to start off with simple questions like the proper use of On Error Resume Next, and the importance of naming your variables with a prefix that tells you what type it is.


    The "importance" of naming your variables with a prefix that tells you what type it is? Do you mean the low-level data type? If so, that's a horrible idea, and it has been denounced many times. What if you need to change the type of the variable, do you rename it everywhere it's used?

  • CiH 2008-08-28 19:07
    Me:
    Like assholes, everyone has one.

    Everyone has them.

    Pedantry in honor of Dennis Leary. Couldn't resist.
  • Joe 2008-08-28 19:41

    Stargate Featurette

    http://stargate.mgm.com/specialops/link.php?urlid=9&id=5924

    An Official Stargate Special Ops Member

    http://stargate.mgm.com/specialops/link.php?urlid=10&id=5924

    An Official Stargate Special Ops Member
  • CiH 2008-08-28 20:46
    Sam B:
    There's a point where if your satire or sarcasm is so veiled as to be undetectable, consistently, then it's just plain trolling.

    "Clattering with diction and dice, I outwit the solemn assistants: all those stern watchers shall my will and purpose elude.

    That no one might see down into my depth and into mine ultimate will--for that purpose did I devise the long clear silence.

    Many a shrewd one did I find: he veiled his countenance and made his water muddy, that no one might see therethrough and thereunder.

    But precisely unto him came the shrewder distrusters and
    nut-crackers: precisely from him did they fish his best-concealed fish!

    But the clear, the honest, the transparent--these are for me the wisest silent ones: in them, so profound is the depth that even the clearest water doth not betray it."

    --Nietzsche, Thus Spake Zarathustra

  • Pinkerton 2008-08-28 21:24
    Your variables are directly accessible from files they're not actually defined in?

    You are the obvious master of encapsulation and scope.

  • TME 2008-08-29 09:52
    So basically that article is saying that... It depends.
  • Leonhard Euler 2008-08-29 13:25
    Let me get this straight - you don't know what Euler's identity is and consider yourself as have "excellent" math skills. Please tell me your a high school student.
  • Leonhard Euler 2008-08-29 13:30
    Jobsworth:
    SarcasmFTW:
    You kinda have to assume that the first interview is for a position requiring a fair amount of mathematical knowledge. Because unless I have really fallen out of touch, knowing off the top of your head how to calculate the nth prime is not something everyone is expected to know how to do.
    Unless of course, they were expected the exhaustive search method, but if they were only expecting that, why even bother ask the question.

    I know about 4 different algorithms to calculate up the n-th prime: 2 sieve methods, one based on probability, and the Fermat test (which is actually for pseudoprimes).
    While I'm typing this comment, I just thought of a fifth: wgetting a primes list from the web, like http://primes.utm.edu/lists/small/1000.txt for the first 1000 primes, and parsing it in a bash script.

    Why do all the calculation if others have done it before you?

    CAPTCHA: ratis


    It's probably for a job with an encryption company.
  • Francisco 2008-08-29 14:12
    El Duderino:
    A Wizard a True Star:
    So, in which languages do you think Hungarian Notation would actually be useful?
    pI advActually vLove adjHungarian nNotation advSo adjMuch, pI vUse pIt advAll artThe nTime! pIt advSure vMakes nEnglish adjEasier prepTo vUnderstand. vImagine cIf pYou vHad prepTo vRead pThis prepWithout pIt. pYou vWould vHave adjNo nClue advWhat pThese nWords vMeant prepWithout pTheir nParts prepOf nSpeech!


    Considering the standard of education these days, some people may not.

    << slaps hand to forehead

    Oh no! I'm turning into an old fuddy duddy!
  • ObiWayneKenobi 2008-08-29 14:28
    There is nothing intrinsically wrong with using On Error Resume Next, if you handle errors. The problem is that too many VBScript/Classic ASP "programmers" litter their code with OERN, and then don't even bother to continuously check for errors, they just happily code away.

    Try dealing with over 1,000 ASP files, all of which use OERN, and trying to track down bugs in it. It's not a simple matter of just removing OERN, because the code doesn't work without it, due to the original programmer calling methods on objects before they're created or referencing variables that don't exist.

    It's a freaking nightmare. I could deal with it, if it was only done properly and not used as a crutch.
  • Francisco 2008-08-29 14:43
    Aran:
    Outlaw Programmer:
    Marty McFly:
    I hope this does not affect my possible future employment with ------- in the past.


    Their problem was they weren't thinking fourth-dimensionally!


    They actually had the chance to hire The Doctor, and they missed out on it!


    I think it was the Doctor's daughter (see Season 4 of the new set of Dr Who) as the Doctor would have got 100% first time and re-wrote the test to confound a Dalek so that he could deal with it. ;-)
  • Francisco 2008-08-29 14:52
    lokey:
    [...]

    Yes, like using any Microsoft product - definitely not: a) smart or b) the best way to increase productivity - but a definite win for marketing...


    I'm not going to get into an argument about the merits or otherwise of any platform, OS, etc, as my point is separate to that.

    If your employer has UNIX at work then you write scripts compatible with that, if your employer has Microsoft products then you write scripts compatible with that, if your employer has their own architecture...
  • Maurits 2008-08-29 18:27
    real_aardvark:
    Permit me once more to introduce my friend Larry Trask, who is far better qualified on the subject than I.


    I note he lists this sentence as correct:

    It is very bad style to spatter e.g.'s and i.e.'s through your writing.

    He's doing the same thing as I am, just for literary jargon rather than technical jargon.
  • BOB 2008-09-01 10:14
    The prime number one is really a trick queston -- it's impossible since there are complex numbers that are prime (Gaussian Primes) and Complex numbers are not ordered.
  • Dennis 2008-09-01 23:06
    Quite simply your knowledge of maths isn't excellent. e^i*Pi=-1 is highschool mathematics.
  • Paolone 2008-09-02 04:12
    El Duderino:
    A Wizard a True Star:
    So, in which languages do you think Hungarian Notation would actually be useful?
    pI advActually vLove adjHungarian nNotation advSo adjMuch, pI vUse pIt advAll artThe nTime! pIt advSure vMakes nEnglish adjEasier prepTo vUnderstand. vImagine cIf pYou vHad prepTo vRead pThis prepWithout pIt. pYou vWould vHave adjNo nClue advWhat pThese nWords vMeant prepWithout pTheir nParts prepOf nSpeech!

    varcharStill varcharCan't varcharSee varcharThe varcharPoint.
  • GregGregGregGregGregGregGregGregGregGreg 2008-09-02 12:17
    Alex Papadimoulis:
    Dear Greg,
    I really apologize for taking the test so many times. Is it still possible to apply in the future?

    Sincerely,
    C------
    Dear C------,
    Please feel free to apply in the future. As soon as we receive your 140th application we will give it serious consideration. Really.
    Greg

  • tbrown 2008-09-02 15:35
    cconroy:
    A Wizard a True Star:
    So, in which languages do you think Hungarian Notation would actually be useful?

    Hungarian, presumably.


    Brilliant! I award you the Laugh Out Loud prize!
  • tego 2008-09-04 08:03
    Maybe make them submit resume first and fill the quiz next?
  • Top3 Codd3r 2008-10-07 21:58
    I'm sure we could all learn from your code and be humbled by it. This is especially the case with those 12 tier architectures (with and without facades, proxies, adapters and factories). OK, that's a little harsh.

    I apologize.

    I'm too old to be all smoke and fire anymore.

    Don't spank MVC too much. Where would .NET be without it? :)

    -Tim the Enchanter
  • �����ѷ� 2009-01-21 12:20
    ���������ѷ������������������ѷ�Ƶ�����ṩ���������ѷ����㣬�人�����ѷ����㣬�ṩ�人�����ѷ���˾���人�����ѷ���·�����й�����������ëý����վ�����Լ�ʱ��������ë���š�������������ë��Ѷ�Ͷ�����������ë��Ϣ������Ϊ���������ë������ɽ��������ë ,�й�������ë ,�й�������ë ��,������ë ,�л�������ë ,̫ԭ������ë ,ɽ��,������ë ����,������ë ͼƬԽ���ʼ������������˾�Ǻ���רҵ���ʼ������������˾,��Ӫҵ����,Ӣ���ʼ����������,�����ʼ����������,��������ʼ����������,�����ʼ�����������ȸ���רҵ�ʼ��������������!�����ʼ����������ԭ�ʼ���������̶��ʼ���أ���ԭ�ʼ����չ�� �ʼ����չ������飺�������ʼ��������ѩ�������ƣ��������������ʼ�����۹��Լ��������ʼ�����汾.��飺�������ʼ��շ��������ѩ�������ƣ��������������ʼ��շ�����۹��Լ��������ʼ��շ�����汾.�͸�.��Ҫ�ṩ�͸�ϵ�в�Ʒ���ṩ�й����͸׼��͸������Ϣ��ѯ�����߶����͸׵ȷ���
  • sfsad 2009-01-21 23:49
  • vacation deals 2009-02-15 03:10
    ����vacation deals��--��Ҫ�ṩ����vacation deals,���־Ƶ�Ԥ��,����vacation deals���㣻��������vacation deals,�����Լݳ�vacation deals��vacation deals�����޷�����ŵ��ë��ʽvacation package���ۣ��������Ƶ�vacation package��������Ʒ��vacation package��vacation package�����������Ļ���vacation package�����ԡ�vacation spots����,vacation spots��վ����,vacation spots����׬Ǯ,����vacation spots����,����vacation spots����ϵͳ,����vacation spots�����������vibrating condom ring��̳�����Ծ��vibrating condom ring��̳֮һ,�������ʵЧvibrating condom ringƽ̨,רҵvibrating condom ring������,vibrating condom ring��Դ����������video converter mac���ۣ�����video converter mac��·������video converter mac������video converter mac������video converter mac����˫����video converter mac���������video converter mac��ŭ��video converter mac���º�video converter mac����VI������ṩ������ȫ�ĸ���VI�������VI��ƾ��㣬�й�VI��ƣ�VI��ƹ����VI��Ƶ�ͼ��VI�����·��VI���ʤ�أ�VI�����վ��������Ѷ.WAGO CONNECTOR�������ȵ�WAGO CONNECTOR����������WAGO CONNECTOR�Ż�������iPlus������WAGO CONNECTORЧ��������ϵ���������WAGO CONNECTOR������վ�����롣�Ͼ���������wago����,����wago����,�Ͼ�wago���Ӳ�Ʒ����,�Ͼ�wago������Ŀ�ƹ�,�Ͼ�wago���Ӿ���ͼ��չʾ,�Ͼ�wago���ӽ�ͨ���Ͼ�wago���ӵ�ʽ���
  • Daniel Smedegaard Buus 2009-03-18 14:54
    256 comments? Let's see if TDWTF can handle another byte! (Or maybe it was signed, in which case I already lost :/)
  • ʪ������ 2009-05-07 10:34
    ��ɳʪ��������˾|ǧ������-��ɳʪ�����ƹ�˾: רҵ�ij�ɳʪ�����ƹ�˾���ṩ62�����Ե�ʪ�����Ʒ���ʮ������,ʮ������,ʮ���幫˾,ʮ������,ʮ���岩��,ʮ����ɳ��,ʮ���忯��,ʮ����ý��,ʮ������̸����ʲô�Ǽ��Լ���ʪ�����㽭ʲô�Ǽ��Լ���ʪ�������㽭ʲô�Ǽ��Լ���ʪ�๫˾����ʲô�Ǽ��Լ���ʪ�๫˾���ݻ���ʲô�Ǽ��Լ���ʪ���ʲô�Ǽ��Լ���ʪ����Ϣ������������, ��Ĵ�ʲô�Ǽ���ʪ�� ��, ��������ʲô�Ǽ���ʪ�� , �ȱ���ʲô�Ǽ���ʪ�� , �dz�����ʲô�Ǽ���ʪ�� Ƶ��, �ۼ�ͨ�߶���, �й�ʲô�Ǽ���ʪ�� ������,����ʲô���ܲ� ��˾����֪������ʲô���ܲ� ��˾������ʲô���ܲ� ��˾������ʲô���ܲ� ��˾����ݸʲô���ܲ� ��˾���ʲô��ǰ������,����ʲô��ǰ������,����ʲô��ǰ������,����ʲô��ǰ������׬Ǯ,����ʲô��ǰ���������,�������ʲô��ǰ������,���ʲô��ǰ�����׸��ѡ�ʲô��֧ԭ���Ⱦ ����. ʲô��֧ԭ���Ⱦ Ϊ��������ѷͶʲô��֧ԭ���Ⱦ ; ʲô��֧ԭ���Ⱦ ��������. ��ϵʲô��֧ԭ���Ⱦ ҵ�� ʯī����������. ʯī������Ϊ��������ѷͶʯī������; ʯī��������������. ��ϵʯī������ҵ��
  • few 2009-05-19 07:01


    ドルチェ&ガッバーナ
    DOLCE & GABBANA
    ドルチェ&ガッバーナ バッグ


    ドルチェ&ガッバーナ 財布


    ドルチェ&ガッバーナ ネ

    ックレス

    ドルチェ&ガッバーナ 

    サングラス

    ドルチェ&ガッバーナ リング


    ドルチェ&ガッバーナ 香水


    ドルチェ&ガッバーナ シュー


    ドルチェ&ガッバーナ アウタ


    ドルチェ&ガッバーナ インナ


    ドルチェ&ガッバーナ シャツ


    ドルチェ&ガッバーナ ジーン


    ドルチェ&ガッバーナ 時計


    ドルチェ&ガッバーナ Tシ

    ャツ


    グッチ
    gucci
    グッチ バッグ
    グッチ 財布
    グッチ ネックレス
    グッチ サングラス


    グッチ リング
    グッチ 香水
    グッチ シューズ
    グッチ アウター
    グッチ シャツ
    グッチ ジーンズ
    グッチ 時計
    グッチ Tシャツ
    グッチ アウター
    グッチ インナー


    ディオール
    Christian Dior
    ディオール バッグ
    ディオール 財布
    ディオール ネックレス


    ディオール サングラス


    ディオール リング
    ディオール 香水
    ディオール シューズ
    ディオール アウター
    ディオール シャツ
    ディオール ジーンズ
    ディオール Tシャツ
    ディオール 時計
    ディオール インナー

    ヴィトン
    LOUIS VUITTON
    ヴィトン バッグ
    ヴィトン 財布
    ヴィトン ネックレス


    ヴィトン サングラス


    ヴィトン リング
    ヴィトン シューズ
    ヴィトン アウター
    ヴィトン シャツ
    ヴィトン ジーンズ
    ヴィトン Tシャツ
    ヴィトン 時計

    シャネル
    CHANEL
    シャネル バッグ
    シャネル 財布
    シャネル ネックレス


    シャネル サングラス


    シャネル リング
    シャネル 香水
    シャネル シューズ
    シャネル アウター
    シャネル シャツ
    シャネル ジーンズ
    シャネル Tシャツ
    シャネル 時計
    シャネル インナー


    プラダ
    prada
    プラダ バッグ
    プラダ 財布
    プラダ ネックレス
    プラダ サングラス


    プラダ リング
    プラダ 香水
    プラダ シューズ
    プラダ アウター
    プラダ シャツ
    プラダ ジーンズ
    プラダ Tシャツ
    プラダ 時計



    フェラガモ
    SALVATORE FERRAGAMO
    フェラガモ バッグ
    フェラガモ 財布
    フェラガモ ネックレ


    フェラガモ サング

    ラス

    フェラガモ リング
    フェラガモ 香水


    フェラガモ シューズ


    フェラガモ アウター


    フェラガモ シャツ


    フェラガモ ジーンズ


    フェラガモ Tシャツ


    フェラガモ 時計


    セリーヌ
    CELINE
    セリーヌ バッグ
    セリーヌ 財布
    セリーヌ ネックレス


    セリーヌ サングラス



    [URL=http://celine-lukus.com/item/category/perfume]セリーヌ 香水

    セリーヌ シューズ
    セリーヌ アウター
    セリーヌ シャツ
    セリーヌ ジーンズ
    セリーヌ Tシャツ

    ボッテガ
    BOTTEGA VENETA
    ボッテガ バッグ
    ボッテガ 財布
    ボッテガ ネックレス


    ボッテガ サングラス


    ボッテガ リング
    ボッテガ 香水
    ボッテガ シューズ
    ボッテガ アウター
    ボッテガ シャツ
    ボッテガ ジーンズ
    ボッテガ Tシャツ

    コーチ
    COACH
    コーチ バッグ
    コーチ 財布
    コーチ ネックレス
    コーチ サングラス


    コーチ リング
    コーチ 香水
    コーチ シューズ
    コーチ アウター
    コーチ シャツ
    コーチ ジーンズ
    コーチ Tシャツ
    コーチ 時計


    ダンヒル
    dunhill
    ダンヒル バッグ
    ダンヒル 財布
    ダンヒル カフスボタン



    [URL=http://dunhill-lukus.com/item/category/ring]ダンヒル リング

    ダンヒル 香水
    ダンヒル シューズ
    ダンヒル アウター
    ダンヒル シャツ
    ダンヒル ジーンズ
    ダンヒル Tシャツ
    ダンヒル 時計

    ロエベ
    LOEWE
    ロエベ バッグ
    ロエベ 財布
    ロエベ ネックレス
    ロエベ サングラス


    ロエベ キーホルダー
    ロエベ 香水
    ロエベ シューズ
    ロエベ アウター
    ロエベ シャツ
    ロエベ ジーンズ
    ロエベ Tシャツ

    ディーゼル
    DIESEL
    ディーゼル バッグ
    ディーゼル 財布
    ディーゼル ネックレス


    ディーゼル サングラ


    ディーゼル リング
    ディーゼル 香水
    ディーゼル シューズ
    ディーゼル アウター
    ディーゼル シャツ
    ディーゼル ジーンズ
    ディーゼル Tシャツ


    ディーゼル 時計
    ディーゼル インナー

    デリヘル 大阪
    仙台 デリヘル
    仙台 風俗
    仙台 デリヘル
    仙台 風俗
    仙台 デリヘル
    仙台 風俗
    家族葬
    滋賀 賃貸
    葬儀 費用
    滋賀県の賃貸
    滋賀の賃貸
    アダルト SEO
    被リンク
    茶道具 買取
    絵画 買取
    レザー
    革小物
    クレジットカード 現金化
    現金化
    ショッピング枠 現金化
    クレジットカード 現金化
    現金化
    ショッピング枠 現金化
    FX
    FX 比較
    FX 初心者
    ダイエット
    ダイエット食品
    腕時計
    ヘアアイロン
    クレイツ
    アイビル
    アドスト
    バッグ
    ネイル
    アクセンツ
    脱毛 大阪
    埋没 大阪
    わきが 大阪
    オーロラ 大阪クリニック
    タウンサーチ
    探偵 大阪
    浮気調査 大阪
    素行調査 大阪
    別れさせ 大阪
    吹田 美容室
    エステ 尼崎
    メナード 梅田
    MM
    MAJORITY&MINORITY
    エムエム
    メナード 梅田


    キャッシング
    大阪 賃貸
    中古車 販売
    ルームウェア
    大阪 マンション
    賃貸マンション 神戸
    中古 ゴルフクラブ
    クールビズ
    フィットネスクラブ
    大阪府 司法書士
    クレジット 申し込み
    ベビードール
    矯正歯科 東京
    ホワイトニング 東京
    大阪 ラブホテル
    リサイクルショップ
    不動産
    カードローン
    投資 信託
    下着
    即日 キャッシング
    銀行
    神戸市 中央区 税理士
    FX
    消費者金融
    ローン
    引越し
    生命保険
    ジェルネイル
    人材派遣
    ネット証券
    アフィリエイト
    格安航空券
    ウィークリーマンション
    レンタカー
    SEO
    オフィス家具
    合宿免許
    ペット用品
    高速バス
    デリヘル
    キャバクラ
    派遣
    コラーゲン
    化粧品
    インテリア
    ウェディング
    結婚相談
    投資物件
    留学
    貸事務所 大阪
    経営コンサルティング
    工芸品
    高級品
    自動車保険
    ホテヘル
    レストランウェディング
    バイク買取
    運転免許
    ベビーカー
    外反母趾
    圧力鍋
    腕時計
    フェラガモ
    デリヘル
    キャバクラ
    セレブ
    プラセンタ
    カルシウム
    青汁
    ブルーベリー
    家具
    脱毛クリーム
    除毛クリーム
    コスト削減 大阪
    弁護士 大阪
    車買取 大阪
    バイク買取 大阪
    エステ 大阪
    リフォーム 大阪
    大阪 歯科
    派遣 大阪
    アルバイト 大阪
    転職 大阪
    大阪 住宅
    大阪 専門学校
    グルメ 大阪
    ホテル 大阪
    一戸建て 大阪
    大阪 宿泊
    大阪 マンション
    デリヘル 大阪
    印刷 大阪
    不動産 大阪
    賃貸 大阪
    ブライダル 大阪
    リサイクル
    アダルト SEO
    賃貸
    SEO 大阪
    イベント コンパニオン 大阪
    転職 大阪
    大阪 ラブホ
    ペット ショップ 大阪
    豆腐
    京都 不動産
    運転免許 合宿
    ヘアアイロン
    ダイエット
    ダイエット
    デリヘル
    キャバクラ
    シャンパン
    老人ホーム
    精力剤
    大阪 ラブホテル
    ブランド品 買取
    ワイン
    京都 不動産
    ペット
    リサイクルショップ
    歯科求人
    結婚式場
    バイク便
    動物病院
    美容整形外科
    エルメス
    ヘアアイロン
    クレイツ
    シャンプー
    アイビル
    ジェルネイル
    育毛剤
    ドライヤー
    アゲハ嬢
    ダイエットサプリ
    エステ 大阪 フェイシャル
    エステ 大阪 求人
    エステ 大阪 メンズ
    リフォーム 大阪 キッチン
    リフォーム 大阪 マンション
    リフォーム 大阪 外壁
    大阪 歯医者 ランキング
    大阪 歯医者 料金
    大阪 歯医者 矯正
    派遣 大阪 求人
    派遣 大阪 短期
    派遣 大阪 ランキング
    アルバイト 大阪 検索
    アルバイト 大阪 短期
    アルバイト 大阪 口コミ
    転職 大阪 求人
    転職 大阪 ランキング
    転職 大阪 女性
    大阪 住宅 検索
    大阪 住宅 ローン
    大阪 住宅 中古
    専門学校 大阪 美容
    専門学校 大阪 看護
    専門学校 大阪 調理
    大阪 グルメ カフェ
    大阪 グルメ お好み焼き
    大阪 グルメ たこ焼き
    ホテル 大阪 シティホテル
    ホテル 大阪 ビジネスホテル
    ホテル 大阪 モーテル
    大阪 一戸建て 検索
    大阪 一戸建て 口コミ
    大阪 一戸建て ランキング
    大阪 宿泊 格安
    大阪 宿泊 高級
    大阪 宿泊 口コミ
    大阪 マンション 新築
    大阪 マンション 中古
    大阪 マンション 賃貸
    大阪 デリヘル 人妻
    大阪 デリヘル OL
    大阪 デリヘル 3P
    印刷 大阪 チラシ
    印刷 大阪 名刺
    印刷 大阪 格安
    大阪 不動産 検索
    大阪 不動産 分譲
    大阪 不動産 比較
  • wm 2009-07-06 05:21
  • Kirby L. Wallace 2010-05-02 14:47
    Too good to be true:

    Tenacity, determination, ingenuity....

    Man, that's exactly the kind of guy I'd hire! And, finally, let's not forget: he scored 92!

    In other words, if you want someone who you know will keep at it until the job gets done, no matter what, and who will almost certainly succeed... that was your guy!

  • Prism 2011-07-12 06:47
    Eam:
    panzi:

    I'm curious, what are disadvantages of the MVC design pattern? I can't think of any. It's not overly complex, it does not add a lot of overhead... what are the disadvantages?


    It's a bit concerning that no one can think of *any* disadvantages to MVC. Don't get me wrong, I use MVC often, but it's not always appropriate.

    It may not add much complexity, but it adds enough that it should not be used for small projects. Also, it pretty much always requires some duplication of business logic across the tiers (the alternative being lots of added complexity).

    The trick to applying MVC is evaluating the current and potential future scale of your project, then balancing logic duplication with complexity.


    I don't know if these are disadvantages or simple issues, and it would depend on framework, in this case its PureMvc adapted for dot Net with some modifications:

    1) Original PureMvc for dot Net used refection to call notification handlers, which fucked up the stack trace.

    2) With the observer pattern, there is always a concern lurking in what observer got called first. You have to design so this never becomes an issue.

    3) When using an event system, whether Mvc or dot net, you cannot trace an execution path in your static code.

    4) Recursion. Fences have to be put up at times when you have events that do things that end up triggering the same event again.

    5) Wiring. Every view mediator has to be wired up to its controls and respective events. Using reflection some of this wiring can be automated.

    6) Since Mvc is designed to decouple things, it is often difficult to detect when something that should be hooked up, hasn't been. It fails silently.


    I wish dot Net had a language enhancement called 'transient', so you could create an instance of a transient class, but if that class was on an exclude list the runtime would ignore or refactor all statements using that class.

    public transient class C{}

    main(){

    var c=new C();// if c is excluded do nothing

    c.Something();// ignored if excluded

    int i=1;
    fn(c, i);// calls fn(int) if c is excluded and fn(int) exists, else do nothing
    }

    So this transient property would be used so you could unplug dependencies for development reasons. Accomplishing decoupling in dev.




  • ルイヴィトン 2012-05-18 02:44
    ルイヴィトン,http://www.bugbagsnow.com/
    ブランドバッグ,http://www.bugbagsnow.com/
    ハンドバッグ,http://www.bugbagsnow.com/women/bag-1/handbag.html
    ヴィトン財布,http://www.bugbagsnow.com/women/saifu.html
    ヴィトン財布,http://www.bugbagsnow.com/man/wallet.html
    ヴィトンバッグ,http://www.bugbagsnow.com/women/bag-1.html
    ヴィトンバッグ,http://www.bugbagsnow.com/man/bag.html
  • Late... 2013-03-28 17:04
    5 years later...

    Chris:
    Or alternatively use a proper programming language where you always know the type and the proper use of "On Error Resume Next" is to never use it.


    Yeah, VB isn't that great to begin with. But there IS a proper use of "On Error Resume Next". Hint: It should NOT be used at the beginning of your code to "ignore" all Errors!

    http://www.cpearson.com/excel/errorhandling.htm