Reputation
59,359
Next tag badge:
187/100 score
18/20 answers
Badges
12 176 258
Newest
 Enlightened
Impact
~2.0m people reached

Jan
7
comment Given a herd of horses, how do I find the average horn length of all unicorns?
@StephenP: That wouldn't work mathematically for this case; all those 0s would skew the average.
Jan
6
comment Should I avoid using unsigned int in C#?
"Seldom does a real-world numeric range correspond to a number between zero and 2^32-1." In my experience, if you're going to need a number larger than 2^31, you're very likely to end up also needing numbers larger than 2^32, so you might as well just move up to (signed) int64 at that point.
Dec
31
comment Does it make sense to use the term “Space Leak” with regard to Java?
+1 for "You can be equally clear without using this "new" terminology." If it walks like a memory leak and quacks like a memory leak...
Dec
17
comment How do I create my own Objective-C to Swift converter?
@Tiper: The original AST construction takes place in the parser. There are plenty of open-source tools to help with that, called parser generators. Unfortunately, they're likely to be of limited help to you because parser generators often don't do well with context-sensitive grammars. But do some searching around and see if you can find a way to make it work with a parser generation tool like ANTLR. Semantic analysis and code generation are the real meat of the compiler process; you'll have to do that on your own.
Dec
11
comment If you decide that branching is a bad thing, then why use Git over SVN?
@nanny Committing vs. pushing is a distinction without a difference, and artificially creating such a difference in DVCS is not a "benefit"; it's an irritation that does nothing useful in return for making your job more complicated.
Dec
11
comment If you decide that branching is a bad thing, then why use Git over SVN?
@nanny: You keep making that assertion, with nothing to support it. I'm saying that yes, that does by definition make it not a real commit, because a commit is necessarily a non-local thing, moving your work to a remote repository, because if it's not moved to a remote repository then you don't get the benefit of a commit: having your work backed up to a remote repository where you can't easily lose it. If you want to demonstrate a flaw in my logic, demonstrate it, but saying "no, you're wrong and you're soooooo ignorant" is not a demonstration.
Dec
11
comment If you decide that branching is a bad thing, then why use Git over SVN?
@nanny I could just as easily say that your failure to comprehend the distinction shows yours, but I'm trying to argue on facts, not childish insults. If your source code only exists on one machine, then you're at risk of losing everything if you lose that one machine. This is a simple fact, and making another copy of it on that same machine and calling it a "commit" doesn't change that. I'm well aware of how DVCS works; I've been using it for years, including at my current job. It's a major irritation: pushing changes is a 3-step process at minimum, where it's only one step on SVN.
Dec
11
comment If you decide that branching is a bad thing, then why use Git over SVN?
@nanny: Mind clarifying? Everything I said is a simple, self-evident fact. The point of source control is to create an independent repository that keeps a backup with version history of your project. Local commits don't contribute to the repository. Systems that use local commits make real commits more complicated because what would be a one-step process without them is now a multi-step process. There's nothing wrong there, let alone "completely, utterly and laughably" so.
Dec
11
comment If you decide that branching is a bad thing, then why use Git over SVN?
@RyanTaylor: Also, "Git's merging is leaps and bounds better than SVN's." Are people seriously still saying that? That used to be true many years ago, but it's been a long time since that was a valid claim and I doubt anyone's still using a version of SVN that old.
Dec
11
comment If you decide that branching is a bad thing, then why use Git over SVN?
@RyanTaylor "In my experience committing locally with Git is still orders of magnitude faster than committing to SVN." Yeah, that's because it's not a commit; it's a local operation. It's still on your hard drive, and if your hard drive dies you still lose all that work, just as if you hadn't been using source control at all, because you didn't actually commit it. That's the entire point of using source control: getting your work off of your local system and onto a specialized server that's designed to manage it well. "Local commits" just make the process more complicated for no benefit.
Dec
8
comment Does immutability hurt performance in JavaScript?
@RobertHarvey has it right. Immutability inherently hurts performance, in JavaScript or anywhere else. It can be useful for other reasons, though.
Dec
4
comment I understand what a stack pointer is - but what is it used for?
@MichaelT: I said "essentially" impossible for a reason. CPS can theoretically accomplish this, but in practice it becomes ridiculously difficult very quickly to write real-world code of any complexity in CPS, as Eric pointed out in a series of blog posts on the subject.
Dec
4
comment I understand what a stack pointer is - but what is it used for?
@EricLippert: For values of "perfectly sensible" sufficiently nonsensical that they include standing on one's head and turning oneself inside out, perhaps. ;-)
Dec
1
comment How does “repeat x = x:repeat x” return a list in Haskell?
@AndresF. Yeah, that's my point: it's a bit silly to reuse a word that already has a well-defined meaning on your platform (the JVM, in this case) to have a completely different well-defined meaning. (On the CLR side, the award should go to "assembly", which has meant something very different from "library" or "module" for decades!)
Dec
1
comment How does “repeat x = x:repeat x” return a list in Haskell?
@Doval It's not a stretch to think of an input stream as such, but what about an output stream?
Dec
1
comment How does “repeat x = x:repeat x” return a list in Haskell?
@AndresF.: Then what are streams called in Scala? :P
Dec
1
comment How does “repeat x = x:repeat x” return a list in Haskell?
@Giorgio: Who calls lazy lists "streams" in eager-by-default languages? You generally see them called stuff like iterators, generators, or enumerators, but a stream is something very different, an abstraction for (more or less) sequential access to IO.
Nov
25
comment Why '-5<(unsigned)5' is false?
@tyt: Yeah, considering that UINT_MAX is over 4 billion, (assuming 32 bits as the default int size for your system,) that's to be expected.
Nov
25
comment What is wrong with Java's generics?
Fine. But without generics this error would throw a ClassCastException really quick at run time with little time wasted. That really depends on how much run time occurs between program startup and hitting the line of code in question. If a user reports the error and it takes you several minutes (or, worst-case scenario, hours or even days) to reproduce, that compile-time verification starts looking better and better...
Nov
25
comment What is the difference between <? extends Foo> and <Foo>
Wow. The more you learn about Java's generics, the more screwed-uppedness you find.