47,311 reputation
8125209
bio website tech.turbu-rpg.com
location Seattle, WA
age 32
visits member for 4 years, 3 months
seen 2 hours ago
A lifelong programmer who's been coding in Delphi since its initial release and currently makes a living at it.

Aug
27
comment Why does the .NET framework have no concept of classes as first-class types?
@Bobson: Yes, TClass understands the class inheritance heirarchy. But it's something fundamentally different because a class of MyClass is not an object of type MyClass; it's a reference to the class itself. (Specifically, to the VMT of the class, which also holds a bunch of metadata on it, but that's an implementation detail.)
Aug
27
comment Why does the .NET framework have no concept of classes as first-class types?
@Bobson: It's not an interface or an inheritance mechanism; it's something fundamentally different that does not exist anywhere in .NET or Java. TClass is not an object; it's its own primitive type that represents a class and allows access to class-scoped members, including class-scoped virtual methods and virtual constructors, without any need for reflection.
Aug
27
comment Is it a good practice to declare instance variables as None in a class in Python?
@delnan: Ouch! How do you get anything done like that? o_0
Aug
25
comment Why does the .NET framework have no concept of classes as first-class types?
@RobertHarvey: As for DFM being proprietary, sure. If I had to implement something like that today, I'd use JSON, obviously. But Delphi and the DFM format came out in 1995, predating both XML (1996) and JSON (2002). What else could they have done?
Aug
25
comment Why does the .NET framework have no concept of classes as first-class types?
@RobertHarvey: TClass is a fundamental language feature that requires compiler support. You can't "write your own" without writing your own language, and for .NET even that would not be sufficient because the object model is defined by the CLR, not by individual languages. It's something that literally needs to be part of the .NET framework itself, or it can't exist.
Aug
25
comment protect purchased games to be downloaded on other pc
@emodendroket: And if that's all you look at, sure, it looks great. If the bagel man put his bagels in a vending machine, though, first off he would need to buy/build a vending machine, which directly cuts into his profit margin, and second, it would not only reduce theft, it would also reduce sales. Both points apply equally well to software. Copy protection is a losing game and always has been.
Aug
25
comment Why does the .NET framework have no concept of classes as first-class types?
@RobertHarvey: Edited to give a few examples, explaining how a virtual constructor is far more powerful than a static factory method, and how class references can provide customizability that generics can't.
Aug
25
comment protect purchased games to be downloaded on other pc
@emodendroket: If you're going to make a claim that directly contradicts empirical data, you'll have to back it up with something a little bit stronger than "yes, but surely people will behave this way."
Aug
25
comment protect purchased games to be downloaded on other pc
@emodendroket: That's where my point about copy protection being worthless in the age of the Internet comes into play. That used to be enough; most users didn't know how to crack software. But today, the rules are different. You don't need to know how to crack software; you just need to know how to find cracked software to achieve the same effect. Which means the author's real task is not to prevent "most users" from cracking it, but to prevent every user everywhere forever from cracking it, because as soon as the first person anywhere uploads a crack to the Web, the game's over.
Aug
25
comment protect purchased games to be downloaded on other pc
@emodendroket: Considering that something like 80% of people are honest anyway,‌​, what that's actually saying is that the same old basic, well-known copy protection routines do nothing at all to deter the dishonest ones, which is the point I was making. ;)
Aug
20
comment Why does Linq to Entity Sum return null when the result set is empty?
So then the question is why does SQL return null? An empty set is not "an unknown value," it's a set containing zero elements, and the proper sum of this is zero. This is well-understood, clearly-defined math. What's the rationale for the DBMS returning a mathematically incorrect result in this case?
Aug
13
comment Java's Object.wait method with nanoseconds: Is this a joke or am I missing something
You can use the new method now. When the computers get faster and the JVM is able to deal with sub-millisecond times, your program will follow. ...and then your program's timing will change, and a zillion things will break in subtle ways.
Jul
17
comment What is the point of the string.Empty property
@newfal: Really? What happens now?
Jul
16
comment When does a Monad become a hammer?
@AndresF.: Again, please stop putting words in my mouth. I never said that John Hughes said that. I never said anything remotely resembling that.
Jul
16
comment When does a Monad become a hammer?
@Doval: Still relatively new? Lisp has been around longer than anything except Fortran, and other functional languages appeared not long after. And I'm not missing his point at all; his point is that dogmatic immutability (note: not immutability in general) is stupid, and the true benefits of functional programming lie elsewhere. And he's right.
Jul
16
comment When does a Monad become a hammer?
"The functional programmer sounds rather like a medieval monk, denying himself the pleasures of life in the hope that it will make him virtuous. To those more interested in material benefits, these “advantages” are not very convincing. Functional programmers argue that there are great material benefits ... [but] this is plainly ridiculous. If omitting assignment statements brought such enormous benefits then [imperative] programmers would have been doing it for twenty years. -- John Hughes, Why Functional Programming Matters (Emphasis added.)
Jul
16
comment When does a Monad become a hammer?
@Doval: If there's no cheating and no tricks involved, how do you read input as a pure function?
Jul
16
comment When does a Monad become a hammer?
@AndresF.: I didn't say that's the only thing they're used for; I said that's why they're used so commonly and talked about so commonly. Please don't put words in my mouth.
Jul
16
comment When does a Monad become a hammer?
@Doval: By cheating, using tricks like State monads to pretend impure operations are being done purely. For example: "Here we have a fake variable that we pretend represents 'the state of the entire outside world', and a fake pure function that takes the fake 'entire world' variable as an input and returns a modified world." It's all incredibly silly what's going on if you look under the hood.
Jul
15
comment When does a Monad become a hammer?
When does it become "a hammer"? When it's all you have. "Pure functional" languages are crippled when it comes to mutable state (which, as scary as hard-line FP proponents try to make it sound, is essential to any non-trivial program,) so you end up seeing monads everywhere.