News for hackers. Stuff that matters.
Re:I've implemented a new HTTP/1.1 request and response pars... by nostrademons on Monday November 30, 2009 @11:20PM (#969220)
I'm disappointed that the student who hardcoded the results was disqualified. You should get points for finding bugs in your professors' specification.
Re:I've implemented a new HTTP/1.1 request and response pars... by andreyf on Tuesday December 01, 2009 @12:17AM (#969276)
Not to mention the "winning" entry did exactly the same thing: found an `n' # of words which works for this input only, then created a fast algorithm that works for this input only, but is incorrect in general.
Re:I've implemented a new HTTP/1.1 request and response pars... by ricree on Tuesday December 01, 2009 @10:38AM (#969879)
Especially since the other solution that got docked for breaking the rules actually performed the calculation that was requested.
Re:I've implemented a new HTTP/1.1 request and response pars... by jimbokun on Tuesday December 01, 2009 @11:53AM (#970072)
I'm stunned that this was not for seen by the professor. Wasn't it obvious that the best way to do this was to give some sample documents for development, but keep the text that the program would be judged on a secret?
Re:I've implemented a new HTTP/1.1 request and response pars... by Frazzydee on Tuesday December 01, 2009 @07:25AM (#969609)
Well the specs say that the program must "calculate the 10 most common words". The disqualified program doesn't really calculate the 10 most common words– it simply outputs the answer.
Re:I've implemented a new HTTP/1.1 request and response pars... by eru on Tuesday December 01, 2009 @12:24PM (#970142)
It doesn't say they have to be calculated from the input.
Re:I've implemented a new HTTP/1.1 request and response pars... by benatkin on Tuesday December 01, 2009 @01:30AM (#969348)
Sounds like red/green/refactor would have come naturally to her.
Re:I've implemented a new HTTP/1.1 request and response pars... by Confusion on Tuesday December 01, 2009 @04:12PM (#970759)
The student missed the most important part of the spec: the intent. 99 Out of a 100 times, you aren't implementing a rigorous spec. The ability to understand what is requested is much more important than the ability to be a wise-ass.
Re:I've implemented a new HTTP/1.1 request and response pars... by viraptor on Tuesday December 01, 2009 @10:37PM (#971435)
> 99 Out of a 100 times, you aren't implementing a rigorous spec.

I'd argue that most programmers do, or are supposed to. Either because they are not the designers of the system they build and what they are expected to do is to "fill in the blanks and make it work", or because they implement something that operates with another system and should strictly adhere to the interface/protocol.

The ones who have anything to say about the design are usually the system designers (duh), small project contributors (because there is no spec) and UI people (because they're designers). So yes - if your spec is "1. make it work on this input; 2. make it fast", then making it work in O(1) for this and only this input is basically the best thing you can do (unless you can make it faster for every input in less time of course). Spending time on generalising it is based on second-guessing the intent.

I'd even go as far as saying that specs have absolutely no intent. You have an intent and describe it while writing the spec and you'd better formalise your intent precisely or you will end up with something you didn't request. If you want something on every input, you'd better write it down (when you give a task to someone else).