Reputation
2,741
Top tag
Next privilege 3,000 Rep.
Cast close & reopen votes
Badges
2 8 19
Newest
 Enthusiast
Impact
~82k people reached

Feb
25
comment An alternative to an array of functions?
Can somebody explain why those non working examples don't work? The answers focus on better solutions, but I don't understand why the original code does not work.
Feb
19
comment How do purely functional programming languages deal with fast changing data?
Many immutable data structures have O(log(n)) cost for operations. But there is no practical difference between O(log(n)) and O(1), constants (which the O notation neglects) are just as important as asymptotic logarithms.
Feb
17
comment Make a change that is ignored by future merges
That's why I said that you should isolate local configuration into a separate config file. All machine specific configuration should be put in that file.
Feb
17
comment Make a change that is ignored by future merges
Create a config file (for example called localconfig) which you include in your .gitignore file so you can't accidentally commit it. Don't mix local configuration with code.
Feb
17
comment Make a change that is ignored by future merges
Don't put it in the versioned code. Put it in a config file which gets ignored by git. A debug flag shouldn't be a property of a branch in the first place.
Feb
13
comment What is the benefit of having the assignment operator return a value?
The only useful case I can remember is while((x = getValue()) != null) {}. Replacements will be uglier since you'll need to either use break or repeat the x = getValue assignment.
Feb
12
comment Extension method naming convention
I don't think this kind of null check is common enough to warrant a helper method beyond the existing string.IsNullOrEmpty. In my experience most null checks take the form if(x==null)throw new ArgumentNullException("x").
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.