Hacker News new | ask | show | jobs
by columbo 4314 days ago
I think you should show the comments first without a time-limit and then allow the user to play. For example:

        /*
         * @Input1: an integer
         * @Input2: an integer (@Input1 <= @Input2)
         * @Input3: an integer (@Input3 !== 0)
         * @Output: maximal integer from @Input1 to @Input2 inclusive
         * which is divisible by @Input3
         * or -1 if there in no such number
         */
<insert click to play button>

Right now it takes me 20-30 seconds just to read and understand the comments.

1 comments

Why should reading the code be timed, but reading comments not timed?
Because this is a test of ones ability to code; not the speed at which they can read English.

As I said earlier: https://news.ycombinator.com/item?id=8207116

Reading the comments is about understanding what the function is supposed to be doing. Reading the code is about actually finding the bug. I can see the argument for allowing one to understand the problem prior to hunting down the bug.
While I understand point people are making, I think understanding the problem is part of the debugging process, and should be a part of the puzzle and timer.

I remember entering programming competitions in high school and college. The first 5 minutes, when everyone is ripping open the envelope of their problem packet and trying to find the easiest problems was always very intense, and fun! Sometimes you would read through it too quickly, and miss a small detail that would render all the code you wrote completely useless. That's part of the challenge!

The difference in high school IMHO is that I give it a big chance that everybody was a native English speaker there.

I agree with you that understanding the (full) problem is part of the challenge in some cases, but since the headline here is 'How fast can you debug?' it has to test debugging skill.

I'm lucky to read and write English about every single day but have colleagues who are probably faster than me at debugging code that will take a lot longer because they'll first have to carefully read and translate the specification before they could continue.

I can definitely see both arguments. I think that they both have merits, and it's just a difference of opinion. :)