Reputation
55,025
Next tag badge:
226/100 score
19/20 answers
Badges
10 156 241
Impact
~1.7m people reached

Jan
17
comment What is the point of the string.Empty property
@Steven: Yes, you can do that.
Jan
17
comment What happened to Borland Delphi?
In case you weren't aware, Borland is gone and Delphi is under new management now, run by folks who actually care about product quality. You ought to give it another look. The recent releases are light-years better than the bad days.
Jan
17
comment What is the point of the string.Empty property
Because otherwise, you couldn't do evil things like typeof(string).GetField("Empty").SetValue(null, " "); ;)
Jan
13
comment How would Functional Programming proponents answer this statement in Code Complete?
@Dan: Interesting. I've seen a lot of the opposite, actually: Problems stem from over-use of abstraction, making it difficult to both understand and, when necessary, to fix the details of what's actually going on.
Jan
12
comment How would Functional Programming proponents answer this statement in Code Complete?
Yes, I've heard the "macros are awesome" talk many times before. But I've never seen an actual example of a Lisp macro doing something that 1) is practical and something you would actually care to do in real-world code and 2) cannot be accomplished just as easily in any language that supports functions.
Jan
12
comment How would Functional Programming proponents answer this statement in Code Complete?
Yeah, gotta love eval. "Hey, look at me! I don't need to write my own security holes; I've got an arbitrary code execution vulnerability built right into the programming language!" Conflating data with code is the root cause of one of the two most popular classes of security vulnerabilities of all time. Anytime you see someone get hacked because of a SQL injection attack (among many other things) it's because some programmer out there doesn't know how to properly separate data from code.
Jan
12
comment How would Functional Programming proponents answer this statement in Code Complete?
@sepp2k: If immutable strings work so great, why do StringBuilder/StringBuffer style classes keep showing up all over? It's just another example of an abstraction inversion getting in your way.
Jan
12
comment How would Functional Programming proponents answer this statement in Code Complete?
I would think a game is one of the worst possible examples to demonstrate the supposed "benefits" of enforced immutability. Things are constantly moving around in a game, which means you've got to be rebuilding your game state all the time. And if everything is immutable, that means that you have to not only rebuild the game state, but everything in the graph that holds a reference to it, or that holds a reference to that, and so on recursively until you're recycling the entire program at 30+ FPS, with tons of GC churn to boot! There's no way you get good performance out of that...
Jan
12
comment How would Functional Programming proponents answer this statement in Code Complete?
@sepp2k: Get used to it. FP advocates are always throwing around bizarre, contrived examples that have nothing to do with real-world coding. It's the only way to make core FP concepts like enforced immutability look good.
Jan
12
comment What are the complexities of memory-unmanaged programming?
Just off the top of my head, Delphi and C++ have both been quite successful as OOP languages without any GC. All you need to prevent "out of control references" is a bit of discipline. If you understand the Single Ownership Principle, (see my answer,) the problems you're talking about here become total non-issues.
Jan
12
comment What are the complexities of memory-unmanaged programming?
@SK-logic: So a recursive "add 1 to this" function and a simple linked list? They both look trivial to me. What is there in either one that you can't do with Delphi's closures? (And why in the world would anyone want to use Church numerals in real code in the first place? Do you have any practical examples?)
Jan
11
answered Is it bad interview practice to have candidates write a linked-list implementation?
Jan
11
comment What are the complexities of memory-unmanaged programming?
@David: Reference counting is an example of the single-ownership principle, and it's the appropriate way to deal with the situation you describe, as the linked article explains.
Jan
11
comment What are the complexities of memory-unmanaged programming?
In a moderately complex program, it's also trivial to find your overlooked Free call with the use of a debugging memory manager.
Jan
11
answered How to react to wrong/not answered questions during interview?
Jan
11
comment What are the complexities of memory-unmanaged programming?
@SK-Logic: ...and do you have an example of something that can be done with simple-untyped-lambda-closures that Delphi's closures cannot accomplish?
Jan
11
comment What are the complexities of memory-unmanaged programming?
@SK-Logic: OK, we have a terminology problem. What's your definition of "real closure," and what can they do that Delphi's closures can't? (And including anything about memory management in your definition is moving the goal posts. Let's talk about behavior, not implementation details.)
Jan
11
comment What are the complexities of memory-unmanaged programming?
@SK-logic: Well, I haven't used C++'s very limited closures. I've use Delphi's though, and I assure you, they're real, generally usable lexical closures, made possible without a garbage collector and without memory leaks because unlike C++, Delphi is a very well-designed language.
Jan
11
comment What are the complexities of memory-unmanaged programming?
Funny. Delphi managed to implement lexical closures a couple years back with no GC...
Jan
11
answered What are the complexities of memory-unmanaged programming?