2,671 reputation
2718
bio website github.com/CodesInChaos
location Frankfurt, Germany
age
visits member for 4 years
seen 1 hour ago

Feb
10
comment Is just using an email address for login a good idea?
@JeffO That requires the browser to have persistent state. I for one like a browser without - except for a short white list of websites I log in all the time.
Feb
10
comment Is just using an email address for login a good idea?
IMO your idea is like OpenID, except much more annoying to use.
Feb
10
comment Is just using an email address for login a good idea?
Same question was already asked on security: If I include a Forgot Password service, then what's the point of using a password?
Feb
7
comment Difference between a pointer and a reference?
These words aren't universal terminology. So that question can't be answered in general, only in the context of a particular language. To me reference emphasizes the concept, pointer the implementation. So it seems natural to use reference in higher level languages, because we don't care how it's actually implemented at the CPU level.
Feb
4
comment How do I better engage the users who starred my project on GitHub?
It's the kind of project many will consider cool, but won't actually use it themselves.
Feb
4
comment What are the advantages of next-iterator over this-iterator?
Each virtual call is costly. Your example has three calls, .net only two. Personally I'd prefer reducing it to one call.
Feb
4
comment Declaring a field name starting with underscore
1) This is unrelated to OOP. 2) If this is legal depends on the language. In Java, C# it's legal. In some other languages it might not be. 3) If it's a good idea depends on language conventions and personal preference.
Feb
3
comment When to store Date/DateTime?
If it's an event/a point in time user DateTime (in UTC). Thanks to timezones there is no good mapping between points in time and dates, so I'd avoid dates whenever possible.
Feb
3
comment Security through obscurity and storing unencrypted passwords
@trejder One person who knows how to do decrypt the file writes a program to automate it. After that anybody can do it simply by using that program.
Feb
3
comment Why is it hard to make a Java program 'appear native'?
There are many many details to take care of. For example the way auto-completition works in a file open dialog is one point where a native looking java application broke down.
Feb
3
comment Is it bad practice to follow up a call to a terminating function with exit()?
IMO it's already bad practice that do_logon calls exit. It implies that your code has bad structure.
Jan
31
comment Why should passwords be encrypted if they are being stored in a secure database?
In the context of password hashing MD5 has no known vulnerabilities beyond being fast, and that applies to SHA-2 as well. Using a slow, iterated construction is far more important than choosing SHA-2 over MD5.
Jan
31
comment What rationale is used when programming language designers decide what sign the result of modulo operation takes?
@BleedingFingers Programming often uses integer division that goes towards zero, e.g. (-3)/2 == -1. This definition can be useful. When you want % to be consistent with this division fulfilling x == (x/y)*y + x % y you end up with the definition of % used in C#.
Jan
30
comment What rationale is used when programming language designers decide what sign the result of modulo operation takes?
One related question is which of these operations directly map to CPU instructions. In c it's implementation defined, which fits with the c philosophy of directly mapping to the hardware on as many platforms as possible. So it doesn't specify stuff that might differ between CPUs.
Jan
30
comment What rationale is used when programming language designers decide what sign the result of modulo operation takes?
Related What's the difference? Remainder vs Modulus - Eric Lippert’s Blog (by one of the C# designers, but I believe he joined team after this decision was made)
Jan
30
comment What rationale is used when programming language designers decide what sign the result of modulo operation takes?
In my code I almost always need modulo not the remainder. No idea why remainder is so popular.
Jan
30
comment How to convey your approach is faster than the built-in, alternative approaches?
@JeffO If you claim that, it better be true. Else I'd mark the product down due to lying marketing. Exponential speedups are rare, since it implies that the original algorithm had exponential cost in the first place.
Jan
30
comment Why should passwords be encrypted if they are being stored in a secure database?
In general it's preferred to use a random salt instead of the username.
Jan
29
comment Unit testing methods with logical dependencies on other classes
That you're using QueryBuilder is an implementation detail. You can produce equally valid implementations that don't use it. So I wouldn't mock it, even if it increases the size of the system under test.
Jan
29
comment How to unit test a missing case in a switch statement where all cases are true
Duplicate on stackoverflow: How to test or exclude private unreachable code from code coverage