Reputation
2,459
Top tag
Next privilege 2,500 Rep.
Create tag synonyms
Badges
12 16
Newest
 Nice Answer
Impact
~157k people reached

  • 0 posts edited
  • 1 helpful flag
  • 1,171 votes cast
1d
comment Is overriding Object.finalize() really bad?
And if you leave a file open it might interfere with someone else using it. (Windows 8 XPS viewer, I'm looking at you!)
2d
comment 8 Queens Problem
Not only that, but long ago I wrote a solution for <n>-queens that simply counted up the number of valid solutions without having any structure that held the queens. I tracked which columns and diagonals were threatened by currently placed queens, the only record of where queens were was the loop variable in the recursive search routine. Back when addition was far cheaper than multiplication this blew the socks off traditional approaches.
Jun
20
comment Is blocking an entire web-client due to compatibility a reasonable request?
@user16764 I just got burned by a variation on this--a WebBrowser control in C#. Oops--it defaults to IE7 mode, I was attempting to write for an IE9 feature.
Jun
20
comment Should one use many small configuration files for script or a single large configuration file?
Think about it: If you use a bunch of separate files then you have no ability to search for the setting you're after and have to look in every file to find it.
Jun
18
comment FizzBuzz on Large Scale
The Sieve should not be used in modern environments as it uses too large a chunk of memory--cache misses galore.
Jun
16
comment Are #regions an antipattern or code smell?
One acceptable case for regions I've found--when you have a whole block of data embedded in your code. Who needs to look at that table with all possible permutations of a set of values?
Jun
4
comment Clean Code comments vs class documentation
I can't see any reason to document that it returns a product by ID--the name & return already tell you that. The only thing I see that needs documenting is whether it returns a null or throws if there is no such product. The Try version mentioned in the comments needs no documentation as it clearly returns false if there's no such product.
May
20
comment while(true) and loop-breaking - anti-pattern?
@supercat It's a little cleaner but I still wouldn't call that a really good answer.
May
19
comment Non-licensed source code later becomes licensed
@Brandin The lack of a stated license doesn't mean there's no license. By default it's protected.
May
14
comment What are linkers and loaders? How do they work?
The simplest loaders don't even have any fixup ability. I'm thinking of the old TRS-80. Executable files were simply address/size/data, repeated as needed (size was 1 byte so you normally needed multiple blocks.) You could even make splash screens by specifying a load address in video memory.
May
14
comment Is this a user story or a bug?
He's describing a bug at the design stage rather than the coding stage.
May
8
awarded  Nice Answer
May
8
comment Why Should I Avoid Inline Scripting?
Some pages can be static and yet of value--earlier today I was using a page with a calculator on it. Cacheable, yet useful. I do agree non-trivial Javascript doesn't belong on any dynamic page.
Apr
29
comment Should we always DRY? Any edge case examples of when not to?
Yeah. I find myself disgusted with the level of repetition I keep being forced to make in SQL code and to a lesser degree in code that works with the database.
Apr
17
comment Job Interview Challenges
@SebastianRedl You're assuming there is an xchg instruction in the underlying machine code. While I've never done embedded systems work my impression is that the languages are pretty simple.
Apr
12
comment My boss decided to add a “person to blame” field to every bug report. How can I convince him that it's a bad idea?
"Where's the fun in that?" -- only a sadist would ask a question like that.
Apr
10
answered Are null references really a bad thing?
Apr
6
answered Rethrow the same exception to provide more info
Mar
30
comment Source file shouldn't be more than 100 SLOC
I'm looking at a routine with over 400 lines right now--and I don't have a problem with it. It's a massive switch statement that parses a configuration file. Most of the lines assign a value into a variable, some have to parse out multiple parameters. Sure, I could replace much of it with a big table of parameters and routines but generally I consider such approaches harder to read. Such things are rare but there are no elegant answers to dispatchers.
Mar
12
revised Should one check for null if he does not expect null?
added 100 characters in body