2,681 reputation
2718
bio website github.com/CodesInChaos
location Frankfurt, Germany
age
visits member for 4 years, 2 months
seen 2 hours ago

Feb
12
comment Interfaces vs Base class
One important difference is that you can't add methods to a public interface, but you can add methods to a public abstract base class.
Feb
10
comment What is best software design in creating methods?
Since this class is essentially a policy, it probably deserves its own interface as well.
Feb
10
comment What is best software design in creating methods?
How does a static method manage to retrieve the promo code?
Feb
10
comment What is best software design in creating methods?
@RobertHarvey If you need DB access (no matter if it's through a repository), you'll need to get access to a db related service somehow. Passing it in explicitly is a bit ugly, accessing it implicitly invokes all the singleton badness, so the least bad solution is constructor based DI together with the usual IoC containers.
Feb
10
comment What is best software design in creating methods?
It most likely accesses the database or a configuration file ("which is set in the backend admin system"). So you need to inject the db somehow, or pass it in explicitly. Implicit access the the db is a bad idea.
Feb
10
comment Is Interactive the term for web application that respond quickly to user?
I'd mainly associate "native-like" with following platform UI conventions instead of web conventions.
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.