Reputation
221
Top tag
Next privilege 250 Rep.
View close votes
Badges
1 5
Newest
 Commentator
Impact
~10k people reached

  • 0 posts edited
  • 0 helpful flags
  • 89 votes cast
Jan
15
comment Is it effective to review code in language I don't know?
Code review is more about logic errors than implementing some (to outside programmers) obscure syntax in a particular language. It's about finding logic bugs, like implementing an algorithm completely incorrectly (like using division when it should be addition). So the code won't be precisely up to specs. That's not important as long as the resultant output is correct. At the least, if you're worried about particular optimizations like this, a team code review would be even better.
Jan
5
comment Refactoring a long method which is based on large number of switch cases
There is an argument for not using a switch statement, of course: 65,534. Namely, the maximum number of bytes your method can compile to. Polymorphism or table-driven lookups can help mitigate that possible eventuality.
Jan
5
comment Refactoring a long method which is based on large number of switch cases
@user61852 locality, here, refers to keeping the logic for calculating the derived value and the symbol definition in the same place; you don't need to visit two separate areas to add/remove/modify a value. perf is simply an abbreviation for performance; the code won't run as fast as a switch statement, although for normal implementations of business logic, this probably won't matter.
Oct
24
comment Does an interpreter produce machine code?
+1 to this answer, but interpreters and compilers are clearly defined. What's not so clearly defined is some languages' use of either interpreter or compiler technology. In many cases, most languages use either one technique or the other, and only rarely both. However, since most languages are described only vaguely, it's hard to tell which term correctly applies to the language. Anything with JIT is ultimately compiled, not interpreted, anything that parses one line at a time is still interpreted, not compiled. More likely, the developers of such a language abuse either word.
Oct
24
comment Does an interpreter produce machine code?
@Leushenko That's stretching the term "compiler" pretty far. Yes, a CPU does a coding process where it determines what to do, but it's still one instruction per thread per core at a time. It's not like it gobbles up an entire memory address range and converts it all to microcode at once for execution, which would be closer to how a compiler functions. It still works one instruction at a time, just with advanced pipeline architecture.
Oct
14
comment Is it normal to spend as much, if not more, time writing tests than actual code?
I've said this elsewhere, but unit testing tends to run far longer, because most code tends to follow a sort of "Pareto Principle" pattern: you can cover about 80% of your logic with about 20% of the code it takes to cover 100% of your logic (i.e. covering all edge cases takes about five times as much unit testing code). Of course, depending on the framework, you can initialize the environment for multiple tests, reducing the overall code needed, but even that takes additional planning. Approaching 100% confidence requires far more time than simply testing main paths.
Sep
25
comment Why are the sizes of programs so large?
Back in the day, 64k intros proved that hardware could be slicker and faster than general mainstream developers would have you believe, and using far less code than a conventional application. Some of those programs were even written in a week or less using pure assembler. Unfortunately, as we all know, pure assembler isn't very portable, nor is it even commonly taught, and even if it were, each developer would have to be a masterful expert to get tasks done in a comparable amount of time as higher languages.
Jul
31
answered Best pattern for manager class that handles syncing objects between client and server
Jul
10
awarded  Commentator
Jul
10
comment Should my sequential collection start at index 0 or index 1?
Actually the zero-based and one-based indexes have to do with how the array is constructed in memory. Zero-based indexes use external memory (external to the array) to determine size, while one-based indexes use internal memory (index 0) to remember the size of the array (usually, anyways). It's not popular for "the size of the object" but usually has to do with how the memory is internally allocated for arrays. Regardless, I wouldn't recommend recklessly leaking bytes here and there "just because." But dictionaries are usually a better idea anyways.
Jun
23
awarded  Critic
Jun
23
answered How safe is it to compile a piece of source code from a random stranger?
Jun
2
comment Time estimating of a complex bug investigation (not a straight-forward one)
Exactly. A team I recently worked on had some agile software, and we tried assigning points (estimated work effort) to defects, and it always came in vastly under or over. Oh, that looks like a 1 point defect. 20 hours later...
May
27
comment Is it good that testers are competing to see who opens more bugs?
Having come from a project more than a year long with meticulous QA, I can say that, while defects about having too much white-space between elements or different colored symbols that mean the same thing might seem unproductive, they ultimately enhance the user experience, often improving productivity, reducing the load on technical support, and giving a more professional look and feel to an application, all desirable traits. And, yes, sometimes software will be delayed because of it, but the price to pay is usually worth it.
May
21
comment What is the maximum number of steps to find a bug using bisecting?
You're right. I meant to say that a simple binary search along a linear history is ask that's required to find bugs. Edited.
May
21
revised What is the maximum number of steps to find a bug using bisecting?
added 7 characters in body; added 27 characters in body
May
21
awarded  Yearling
May
21
awarded  Editor
May
21
revised What is the maximum number of steps to find a bug using bisecting?
added 754 characters in body
May
21
answered What is the maximum number of steps to find a bug using bisecting?