980 reputation
513
bio website
location
age
visits member for 2 years, 5 months
seen yesterday

1d
comment Throw exception or let code fail
Doing the extra check can perhaps add a race condition if _Materials can be modified by more than one thread. I like the suggestion that @MarcvanLeeuwen gives.
Jan
8
comment Why do browsers clamp timeouts and intervals?
The important thing to note that usually things like setTimeout it means the minimum amount of time to wait. In practice, there's no guarantee that your callback will be called in the set amount of time, or at all.
Jan
8
comment Repository pattern without entity framework?
Repositories are a way to abstract what gets saved with how it gets saved. You could make an implementation that saves using EF, nHibernate, Ad-Hoc SQL, Stored Procedures, NoSQL databases, CSV files, binary blobs, In-Memory, etc.
Jan
6
accepted Unit testing a template class after refactoring
Jan
6
comment Unit testing a template class after refactoring
Thanks, this confirms what my presumptions were already. For testing the DoesPasswordMatch method, I would probably go with unsealing the implementation and creating a new derivative.
Jan
6
asked Unit testing a template class after refactoring
Jan
4
comment Two classes that behave identically yet are semantically different
Thanks for this answer, this solves the problem with a minimal amount of re-engineering.
Jan
4
accepted Two classes that behave identically yet are semantically different
Jan
1
asked Two classes that behave identically yet are semantically different
Dec
16
comment How to define “or” logically
You could use the ternary operator return arg1 ? arg1 : arg2;
Oct
31
comment Looking for encryption method
"This database contains some data I don't want the user to tamper with, so the idea is obvious - encrypt the data file", this sounds like you can use message authentication (MAC) instead of encryption, that is you don't care if people can read the data. Encryption doesn't mean that you can't tamper with data, it means you can't read it. If I flip some bits in the encryption data, and try to decrypt, it will likely decrypt but be incorrect.
Oct
31
revised Is this extension method any better than just casting to an int?
added 3 characters in body
Oct
31
answered Is this extension method any better than just casting to an int?
Oct
24
comment Is it a good practice to run unit tests in version control hooks?
I agree, this is what a build server is for. Your source control is for managing source code, not ensuring your application works.
Oct
23
comment Code that converts a value into a different representation, then converts it back to where it started is bad, but how?
decimal myValue = decimal.Parse(dataReader["myColumn"].ToString()) is a pet peeve of mine.
Oct
17
awarded  Notable Question
Oct
10
comment How can DB and UI agree on default values?
Why does the database need default values if it's expected that the UI is still providing them.
Oct
1
comment When should I implement authentication in a database?
It sounds to me that you would want application level users, not database level users. These application users operate on a higher level of abstraction than a DBMS.
Oct
1
comment Add or leave comment for simple race condition logic?
Instead of adding a comment, you could prevent a race condition by using locks, now it's obvious that the developer is working with multi-threaded code.
Oct
1
comment When should I implement authentication in a database?
Depends on your system architecture, are there multiple users, is it a web-app, do end-users have direct access to database, etc.?