339 reputation
38
bio website stoerr.net
location Delaware
age 42
visits member for 3 years, 2 months
seen 2 days ago

Jul
1
revised Is template “metaprogramming” in Java a good idea?
added 60 characters in body
Jul
1
answered Is template “metaprogramming” in Java a good idea?
Jul
1
comment Which hashing algorithm is best for uniqueness and speed?
If you still choose this way of hashing for some reason, you could at least use a better prime like 92821 as a multiplicator. That reduces collisions much. stackoverflow.com/a/2816747/21499
May
25
awarded  Notable Question
Mar
5
comment What should I do when I've already waited too long between commits?
In my experience it is troublesome and fragile to rely on the version control comments to tell a story why the code is there (i.e. reasons 1 and 2). If you are using SVN with a branch, the commit history is lost on merge, anyway (you'll be better off with more modern stuff like git). So those are IMHO best served with comments.
Feb
11
answered Good idea to put bug numbers in a comment in the beginning of the source file?
Dec
2
comment Static factory vs factory as a singleton
How would you unittest classes using Foo, without depending on the implementation of Foo? If you inject a factory in such a class Baz, you could inject a mock for the factory that returns mock objects for Foo or IFoo. But what to do using this pattern?
Jul
16
comment When should we stop work and make tool?
Nice one! :-) But the time saved might also be on other tasks - either since the tool can be used for more than one purpose, or because of the knowledge you got when writing the tool.
Jun
25
revised What's with the aversion to documentation in the industry?
added 17 characters in body
Jun
25
answered What's with the aversion to documentation in the industry?
Jun
25
comment Should we design programs to randomly kill themselves?
If you are doing it right, these random (and not graceful!) crashes would do no lasting harm at all. That's the point: over time you can weed out all edge cases where harm occurs; some of them you will never ever see on testing machines. And if sometimes a real crash occurs you will also have no trouble. I never tried this, but it does seem sensible to me in some circumstances. Of course this is something which needs to be an official feature of the application, not something development sneaks in.
Jun
25
comment Should we design programs to randomly kill themselves?
If you would implement random termination, you certainly would print a log message "now I'm terminating" sucht that you can differentiate deliberate random terminations from bugs. ;-) Also, restarting one of a couple processes once in a while would not need more reduncancy as you should have anyway.
Jun
4
comment Looking for meaningful, strong argument in favor of antivirus software on development machines
You might make the AV less intrusive if you define some directories where only source / compiled code is stored, and have the AV those only scan on writes but not on reads. Thus, you get full protection on normally installed programs but less impact on the development.
Jun
4
answered Is there a reason that tests aren't written inline with the code that they test?
Jun
4
comment Is there a reason that tests aren't written inline with the code that they test?
Another reason for separating tests is that you often use additional or even different libraries for testing than for the actual implementation. If you mix tests and implementation, accidential usage of test libraries in the implementation cannot be caught by the compiler. Also, tests tend to have way more code lines than the implementation parts they test, so you'll have trouble finding the implementation between the tests. :-)
May
31
awarded  Good Question
May
28
comment Is it a bad practice to modify code strictly for testing purposes
An important concern. Usually, I do IDE supported refactorings freely since the chance to break anything there is very low. If the refactoring is more involved I'd do it only when I need to change the code anyway. For changing stuff you need tests to reduce risks, so you even get business value.
May
28
comment Why is it a good idea for “lower” application layers not to be aware of “higher” ones?
Interestingly, this works best - if not at all - when each layer only about the layer directly below it. The OP's question is less strict: it would allow each layer to know about all layers below.
Apr
2
comment Best practices for sharing tiny snippets of code across projects
@sarfeast It would be nice if you could share a link to whatever Nuget server is, and tell a little about it.
Mar
4
answered How to avoid giant glue methods?