3 ms·
Whats wrong about the above code? Does it not do what it means to do? Is your personal feeling for how this construct should be written syntactically any measur
by MrDosu 12y ago
Whats wrong about the above code? Does it not do what it means to do? Is your personal feeling for how this construct should be written syntactically any measure of intelligence?
- louthy 12y agoIt can be written: return (NULL != lpDataPointer)
- MrDosu 12y agoI know, it can also be written in many other ways. What decides which one is more correct if they are all semantically equivalent? Is it less characters? Is it using exactly as many 'e's as 'a's? Is it the unnecessary braces?
- mojuba 12y agoThere is probably no "correct" way of writing this, but there are ways of making your next code maintainer's life easier (which might be you in a few months from now). One line is easier to read and understand than 10, especially if that one line is just "return p".
- MrDosu 12y agoPersonally most of the time id rather have 10: main(int c,charv){return!m(v[1],v[2]);}m(chars,chart){returnt-42?s?63==t|s==t&&m(s+1,t+1):!t:m(s,t+1)||*s&&m(s+1,t);}
- mojuba 12y agoBut I meant return p, not some gibberish that obviously should be formatted better. It's just that for some developers "formatting better" doesn't translate to "make it shorter and sweeter".
- MrDosu 12y agoHow dare you call this beautiful, correct and award winning glob matcher gibberish shakes fist
- mojuba 12y agoOr, taken to the extreme: return p;
- louthy 12y agoDepends on the language. Clearly 'lpDataPointer' suggests C or C++, but if it was C# or Java then 'return p;' would only compile if 'p' was of boolean type. </pedant>