1,847 reputation
1013
bio website
location Houston, TX
age 32
visits member for 3 years, 7 months
seen 4 hours ago

Jun
13
comment Fixing a spelling mistake in a method name
@MainMa: I wouldn't consider the code in those books to be production-quality either.
Jun
13
comment Reconciling the Boy Scout Rule and Opportunistic Refactoring with code reviews
Are the reviewers really looking only at lines that changed? Or are change markers in the surrounding code making it harder to evaluate how that code relates to the functional change being made?
Jun
13
comment Fixing a spelling mistake in a method name
@MainMa: It's not so much that the misspelling is hiding bugs, as that it is correlated with not being reviewed. People who are familiar with the subject matter will know the correct spellings. At a minimum, they will be a severe distraction from the main goal of inspecting the logic. (Aside: Did you mean 10 / 3, which is 3 in C#? The expression you showed definitely will calculate a non-integer part, although that could be discarded by type coercion)
Jun
13
comment Fixing a spelling mistake in a method name
One improvement -- don't rely on grep to find users of the old name, also log inside the forwarder.
Jun
13
comment Fixing a spelling mistake in a method name
If you find this in code intended for safety-critical uses, the software is of insufficient quality for its intended use. Safety-critical development processes are meant to find and fix problems in the code. If something so obvious as a misspelling has gotten through, the quality system is sorely deficient. Either reviews haven't taken place, or the reviewers are inadequately skilled.
May
16
comment Why do we put private member functions in headers?
"implementation choices shouldn't affect the language" is almost the exact opposite of the C++ mantra. The specification doesn't mandate any particular implementation, but there are a lot of rules specifically crafted to serve the requirements of a particularly efficient implementation choice.
May
16
comment Why do we put private member functions in headers?
All functions defined inside the class body are automatically marked inline, there's no reason to use the keyword there.
Apr
4
comment Does functional programming add complexity in code?
@Andres: It is true... to a point. Well written code will separate the business logic from the implementation details, and the business logic should be readable, because most of what it is doing is making straightforward calls to well-named helper functions. Those helpers may use all kinds of language features, of course, and require heavy experience with the language and libraries to understand.
Mar
30
comment Why do higher level languages have neither xor nor nand short-circuit operators?
First one isn't XOR, it's parity function. They get conflated because for 2 inputs they are the same.
Mar
30
comment Why do higher level languages have neither xor nor nand short-circuit operators?
@sth: The parity operator needs all its arguments. Not n-ary XOR. With XOR, as soon as you find a second TRUE input, you're done, the output is false.
Mar
24
comment GPL code allowing non-GPL local copies of nondistributed code
An interesting point is whether sample code showing how to communicate with SaaS-deployed GPL-derivative code would fall under GPL and require release of source code corresponding to the the undistributed GPL-derivative binaries.
Mar
24
comment GPL code allowing non-GPL local copies of nondistributed code
Like copyright, the right to publicly perform a work is also restricted.
Feb
28
comment Programs that claim they are not “multi-core” friendly
I think that @Bart is really close. However, s/work/ appear to work / and it will be closer to the mark.
Jan
31
comment Why should passwords be encrypted if they are being stored in a secure database?
No, the application doesn't have a salt value either. There should be a different, strongly random, salt value for each stored hash. (You store the salt alongside that hash.) That's what protects against statistical attacks. If you used the same hash for the entire application, then the same plaintext hashes to the same value. That's far worse than using the username as the hash.
Dec
3
awarded  Good Answer
Nov
16
awarded  Yearling
Oct
28
comment How are generics implemented?
@greenoldman: Java performs type erasure in the source->bytecode translation step. Which makes it impossible for the verifier to verify generic code. C# does it in the bytecode->machine code step.
Oct
28
comment Should certain math classes be required for a Computer Science degree?
This question isn't about physics or scientific computing. Neither of which are tasks you'd normally hire a CS major for.
Oct
28
comment How are generics implemented?
@greenoldman: Can we avoid value types for a minute, because they actually are handled specially? If you have List<string> and List<Form>, then since List<T> internally has a member of type T[] and there are no constraints on T, then what you'll actually get is machine code that manipulates an object[]. However, since only T instances are put into the array, everything coming out can be returned as a T without an additional type check. On the other hand, if you had ControlCollection<T> where T : Control, then the internal array T[] would become Control[].
Oct
28
comment How are generics implemented?
@KChaloux: At the MSIL level, there's one description of the generic. When the JIT runs, it creates separate machine code for each value type used as a generic parameters, and one more set of machine code that covers all the reference types. Preserving the generic description in MSIL is really nice because it allows you to create new instances at runtime.