BlueRaja - Danny Pflughoeft
Reputation
3,373
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
15 26
Newest
 Yearling
Impact
~218k people reached

9h
comment Encrypted content in games
Everyone keeps saying "Why would you want to do this", but I can think of one obvious application: an ARG. Your idea then boils down to: Encrypt the ARG hint using the puzzle solution as the key. Even if they reverse-engineer the game, they won't be able to find the hint without beating the puzzle. "They will just brute-force the puzzle" is not a valid argument, as there are lots of puzzles that humans are good at but computers are not (eg. the puzzles at pathery.com are strongly NP-hard)
Jan
25
comment Can the “level 256 bug” in the game of Pacman be considered an unhandled segfault?
Segmentation faults are raised by the hardware, to avoid illegal memory access. I'm no expert on Pacman, but the hardware it ran on almost certainly didn't have this safety feature to begin with.
Jan
20
awarded  Yearling
Dec
23
comment At what point is it taboo to have loops within loops?
Linus Torvalds is basically a political pundit, but for programming - he says the most outrageous things possible, to get attention. See eg. Supporting motherboards with UEFI is a "di**-sucking contest"; real programmers don't use debuggers; "SVN is the most pointless project ever started"; "GNOME is a total UX failure"; etc. You should just ignore him.
Dec
7
comment Filtering foreach loops with a where condition vs continue guard clauses
Why would an extremely large data set make a difference? Just because the minuscule cost of the lambdas would eventually add up?
Nov
25
comment Is it better to check `c >= '0'` or `c >= 48`?
I have a Japanese IME installed, and accidentally type in full-width all the tim‌​e.
Nov
13
comment Using compound statements (“{” … “}” blocks) to enforce variable locality
Unnecessary inline blocks? Using Integer.compare to check for inequality? One letter variable-names? Verbose comments? This code is terrible.
Nov
10
comment Two structs with the same members but different naming, is it a good idea?
+1 for the last paragraph, that is the ideal solution. A point is space is an object; the internal representation of that point should not matter. Of course, real-world concerns (performance, rounding errors) might cause it to matter. It all depends on what this is being used for.
Nov
10
comment Using compound statements (“{” … “}” blocks) to enforce variable locality
@Bergi: Small methods do not bloat the class's API if they are private. They only bloat the file size... which large methods will also do.
Nov
4
comment Who should read Exception.Message if at all?
@MainMa: Depends on the software? I'm pretty sure no one who plays games has a system administrator to blame.
Nov
3
comment Who should read Exception.Message if at all?
I disagree with never showing the end-user a detailed error message. It has happened to me many times that I get a cryptic error message preventing me from starting my game/software, but when I google it I find out there's an easy workaround. Without that error message there'd be no way to find the workaround. Maybe it's better to just hide the details under a "more details" button?
Nov
3
comment Why is Math.Sqrt() a static function?
-1 this answer is absurd, what does any of this have to do with being static? You're going going to have decide answers to those same questions either way (and "[with a static function] the implementation is the same" is false, or at least no more true than it would be for instance methods..)
Sep
4
comment What's the use of .Any() in a C# List<>?
The name "any" makes sense when you think of it in terms of LINQ: Any() is really a shortcut for Any(o => true)
Sep
4
comment What's the use of .Any() in a C# List<>?
Any(Func<T>) is O(n)
Sep
4
comment What's the use of .Any() in a C# List<>?
I challenge your claim that Any() is less clear: Any() seems more clear to me, especially with a lambda-condition. Translating code to English in my head, if(MyList.Count(o => o > 10) > 0) becomes "Is the number of items greater than 10 more than 0?" whereas if(MyList.Any(o => o > 10)) becomes "Are there any items greater than 10?"
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
13
awarded  Autobiographer
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