- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Admin
And isn't that the root of everything coded by Microsoft?
Admin
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.
Admin
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.
Admin
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.
Admin
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.
Admin
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.
Admin
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.
Admin
Admin
Admin
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
Admin
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!
Admin
True enough! Wise words indeed :)
Admin
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.
Admin
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.
Admin
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
Admin
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.
Admin
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".
Admin
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.
Admin
Admin
Easy, Buddha has more body fat.
Admin
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:
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.
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.
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.
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.
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
Admin
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.
Admin
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.
Admin
I have to concur, top cod3r's posts were pretty good. I almost bit.
Admin
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.
Admin
Admin
My God, if TopCod3r is a troll, he/she/it sure knows how to push my buttons.
Admin
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.
Admin
You need to get yourself a more loosely-typed language, son. And declench in any case.
Admin
Admin
Admin
Admin
The candidate proved two things :
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.)
Admin
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?
Admin
Admin
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!
Admin
Admin
Ummm... you're a very serious person, aren't you?
Admin
Admin
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.
Admin
Man, I though 1 was prime as well. I'm glad I'm not alone!
Admin
Admin
[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.
Admin
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
Admin
Sorry, I meant OERN, not ORNE
Admin
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.
Admin
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
Admin
A philosopher, some would say.
Admin