Re:Let's Play a Game – find bugs in popular open-source proj...
by kbart on Wednesday July 13, 2016 @06:47AM
(#12085208)
The hardest part for me was to read an ugly formatted code with no highlights.
[ Parent
| on HN ]
Re:Let's Play a Game – find bugs in popular open-source proj...
by Superleroy on Wednesday July 13, 2016 @06:50AM
(#12085217)
Agree, badly formatted and thus hard to read. And when you find the error you don't know where to click as it only highlights a part of the error.
Re:Let's Play a Game – find bugs in popular open-source proj...
by dagurp on Wednesday July 13, 2016 @07:22AM
(#12085322)
And what kind of sadist names a variable l1?
Re:Let's Play a Game – find bugs in popular open-source proj...
by deong on Wednesday July 13, 2016 @10:06AM
(#12086211)
Well, there's L1 norms, Lagrange point L1, an L1 visa, etc. In any of those contexts, it's an excellent variable name.
There's also the case of short little utilities. For something like strncmp (or at least my slightly naive version), I'd rather see code like
int strncmp(const char* s1, const char* s2, int n)
{
for(; n>0; s1++, s2++, n--) {
if (*s1 < *s2) {
return -1;
} else if (*s1 > *s2) {
return 1;
}
}
return 0;
}
than have code where someone attempted to come up with long "meaningful" names for each variable. There isn't really meaning here beyond "pointer_to_string1" and "pointer_to_string2", and longer names here do nothing but add visual clutter.
Re:Let's Play a Game – find bugs in popular open-source proj...
by scott_s on Wednesday July 13, 2016 @03:31PM
(#12088971)
I think l1 is considered uniquely onerous because "l" and "1" render similarly in many fonts. That is, the complaint is not about x1, x2, x3, etc., it's about that specific combination.
Re:Let's Play a Game – find bugs in popular open-source proj...
by chatmasta on Wednesday July 13, 2016 @07:19AM
(#12085307)
That's a luxury! Try finding a bug in an obfuscated binary, without access to the source code or even header files, that implements anti-debugger techniques to crash or behave differently upon first detection of a debugger.
Re:Let's Play a Game – find bugs in popular open-source proj...
by lorenzhs on Wednesday July 13, 2016 @07:48AM
(#12085391)
What does that have to do with static analysis of C++ source code? Of course that's difficult, but the quiz is also purposefully made more difficult than it would be in real life.
Re:Let's Play a Game – find bugs in popular open-source proj...
by caf on Wednesday July 13, 2016 @08:07AM
(#12085466)
On the other hand the test is significantly easier than it would be in real life, because you know that there's a bug somewhere in the few lines it's showing you.
Re:Let's Play a Game – find bugs in popular open-source proj...
by svens_ on Wednesday July 13, 2016 @03:33PM
(#12088994)
You're right.
The timer on the page put me under more stress than I'd like to admit. Maybe this is quite a good simulation of code review reality though, where you try cover lots of code in a small amount of time.