BlueRaja - Danny Pflughoeft
Reputation
3,318
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
14 26
Impact
~209k people reached

Jul
18
comment What is the meaning of “doesn't compose”?
Your bullet points for "referential transparency" and "purity" are actually the two requirements for purity. The term "referential transparency" should be avoided because it is not well-defined.
Jul
11
comment Should my (sequential) collection start at index 0 or index 1?
@BrianKnoblauch: No! That is one of reasons Basic was considered such a bad language - the language should pick an indexing scheme and stick to it, not make programmers cognitively have to deal with both!
Jul
5
comment Is it advisable to disable the Microsoft enforced coding standards in VC# 2010?
@Richard: Yes, C# does have formatting guidelines: msdn.microsoft.com/en-us/library/ff926074.aspx However, next-line braces are not explicitly mentioned (but similar issues like 'four-character indents' and 'tabs saved as spaces' are)
Jul
1
comment Is testable code better code?
See also The sacrifices we make to make code testable
Jun
17
comment Introducing a version control branching policy to a small team
@17of26: Actually, when using Git + Github-for-Enterprises (which has become an extremely common combination in large companies lately), branches are the standard mechanism for doing code reviews. Github has tons of features to make doing code reviews and their associated pull requests super-convenient.
Jun
16
comment Introducing a version control branching policy to a small team
"Keep in mind that the only real benefit to a branch is code isolation. That means you need a concrete reason to want to have the code isolated." - How about code review? I think that's a good reason, even with only two devs.
Jun
4
comment Clean Code comments vs class documentation
Even vacuous comments like Returns the id are helpful, because they still convey that "The author of this method didn't feel there were any pitfalls in using it that were worth mentioning", which is good to know. A lack of documentation comment might convey that, but it could also have been an oversight.
May
29
comment Is the use of one-letter variables encouraged?
@Lilienthal: Code should be efficient-to-read, not efficient-to-write. Usually they are the same thing, but not always, as in this case.
May
29
comment Is the use of one-letter variables encouraged?
-1 Using 1-letter variables names is lazy programming. Sometimes it's okay to be lazy, but if you're getting up to k and l in loop indices, that's too far (you shouldn't have that many nested loops to begin with; extract them to functions). Personally, I never use more than one 1-letter variable per function, but I shoot for 0.
Apr
17
comment NoSQL within SQL Server
@MasonWheeler: He makes it sound like they are orders of magnitude slower, and wrote an entire article on how searching within strings work, completely ignoring the fact that any data lookup will go through an index file first (this is true in both relational and XML databases). So basically, everything in that article is irrelevant.
Mar
30
comment NoSQL within SQL Server
Joel Spolsky is known for having strong, controversial opinions. See FogBugz is written in a proprietary language; Dependency injection is too complicated (btw, this was the most controversial answer on Stackoverflow before being closed); XML databases are slow; etc.
Feb
26
comment Why are structs and classes separate concepts in C#?
See also this answer on why Java doesn't have custom value-objects.
Dec
18
comment Are all magic numbers created the same?
if 3.50 is used in only one place, I would define it as a constant on the line above.
Jul
29
comment Should the commit history be used to convey critical information to developers?
-1 emails don't work well as documentation
Jul
9
comment What does it mean for a sorting algorithm to be “stable”?
"Stable" can also apply to data-structures, eg. a "stable heap" is a heap which dequeues items that have the same priority in the same order they were queued. This is very important for efficient path-finding algorithms.
Apr
30
comment What's wrong with circular references?
I wasn't claiming it's a good practice, I was just pointing out it's not impossible as claimed in the answer.
Apr
29
comment What's wrong with circular references?
Dependency injection is not impossible with circular references, even with automatic DI. One will just have to be injected with a property rather than as a constructor parameter.
Dec
30
comment Implementation of algorithm to generate chess positions
Each bishop attacks up to 14 different squares, so this is actually about 444k positions to search (15862*28). We can do significantly better than that - see my answer.
Nov
21
comment Why do most programming languages only support returning a single value from a function?
@David I'm not sure what you mean by the "current convention," all calling conventions use the stack. thiscall (the calling convention used by C++) uses one register for the this pointer, and the rarely-used fastcall stores the first two arguments in registers. Everything is is on the stack. See also
Nov
21
comment Why do most programming languages only support returning a single value from a function?
@David no, cdecl allows for (theoretically) unlimited number of parameters (that is why varargs functions are possible). Though some C-compilers may limit you to several dozen or hundred arguments per function, which I think is still more than reasonable -_-