951 reputation
513
bio website
location
age
visits member for 2 years, 4 months
seen Dec 23 at 20:12

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.
May
8
comment The best way to open source my website
1. Don't bother with this, 2. Contact a lawyer
May
2
comment How to (or should I) have one assert per test with object comparisons?
If you're not using the Equals and GetHashCode in the for production code, then I would not add it specifically for the unit test.
May
1
comment How to enforce implementation of interface to behave a certain way
@EnvisionAndDevelop I am looking for ways to communicate intent. Suppose two people are creating code, one person writing front end stuff that uses an interface, and a back end person that's implementing it, just as a way for the two to communicate through code. I'm not suggesting this is the most practical solution to the problem at all, just a curiosity.
May
1
comment How to enforce implementation of interface to behave a certain way
@Telastyn Maybe I should build a program that beats people with sticks instead.
Apr
30
comment Are random number generators security holes?
If you're using the output from RAND in a cryptographic sense, meaning not predictable, then yes it's a security risk. It depends on how it's intended to be used. If you're using it to display a different banner ad, then no.