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
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
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.
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
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
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.?
Sep
19
comment Should failing unit tests that we're not going to fix be removed?
If you allow your system to contain failing unit tests, how do you know which failing unit tests are okay?
Sep
4
comment Why are the <b> and <i> tags deprecated?
@supercat developer productivity costs more than bandwidth. I suspect the time it takes to send the extra bytes over the network is negligible, especially when considering the overhead of creating the actual output (database calls, network sockets, javascript files, etc.)
Aug
4
comment Decoupling when constructors have non-contractual parameters
While I understand the concepts you're suggesting, and I think they're definitely good ones, I am still unclear about how the PageParser is instantiated.
Jul
30
comment Should the commit history be used to convey critical information to developers?
@Klors I was thinking the same thing, but in my opinion, the unit test should demonstrate the reason for using v2 over v3, that way if the unit test passes with v4, you don't have a unit test that requires v2 for no reason.
Jul
25
comment What are some version control systems based on different concepts than Git, Mercurial etc?
the FTP version control system works very different, every user has the access to the same files and hopefully they don't overwrite each other's work.
Jul
3
comment Redundant function to clarify purpose?
"Now, my user would naturally ask himself what happens if this function is called multiple times." - what does it actually do?
May
20
comment Retried Operation with generic Exception
It will re-throw whatever exception was originally thrown.