45,577 reputation
8116196
bio website tech.turbu-rpg.com
location Seattle, WA
age 31
visits member for 3 years, 10 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.

Apr
7
comment What are the advantages of recursion compared to iteration?
When solving the maze, the recursive solution is only "perfectly clear" if there are guaranteed to be no cycles in the maze. Otherwise, it gets messy too.
Mar
2
comment Was there ever a serious push for partial classes in java
@CodesInChaos has it right. C# introduced a really bad feature (partial classes) so that they could do UI generation the wrong way. You would think, for a system that got started as a blatant ripoff of Delphi rewritten to look more like Java syntax, that they could at least have copied the basic concept behind Delphi's declarative UI system while they were at it...
Feb
27
comment What exactly is procedural programming? How exactly is it different from OOP? Is it the same as functional programming?
Procedural programming is not the same thing as functional programming; it's actually essentially the same thing as object-oriented programming, minus the objects and classes.
Feb
19
comment “Everything is a Map”, am I doing this right?
@EvanPlaice: Big-O notation can be deceptive. The simple fact is, anything is slow compared to direct access with two or three individual machine code instructions, and on something that happens as often as a function call, that overhead will add up very quickly.
Feb
13
comment What is the benefit of having the assignment operator return a value?
@MarjanVenema: I believe what he means by that is, Pascal's := operator is not only "different from the equality test operator" like C#'s is, but it is also not likely to be confused with it, which is a chronic problem in the C syntax.
Feb
11
comment What methods are there to avoid a stack overflow in a recursive algorithm?
I just tried this, for practice, and I found that the stack overflow exceptions I got weren't legitimate; they were caused by the value getting high enough to overflow MAXINT and wrap around. Changing to 64-bit integers got rid of the stack-breaking.
Feb
5
comment Why is PHP's method of comparing different types bad?
how often do you really need to see which of two strings is lexicographically greater? Umm... every single time you sort a list of strings, just off the top of my head.
Feb
1
comment Does Lisp still have any special feature which has NOT been adopted by other programming languages?
I've never seen a good explanation of multimethods that distinguished them from overloaded methods, a standard feature in nearly every modern imperative language, except by the fact that multimethod dispatch is resolved dynamically at runtime and is therefore much slower than using overloaded methods, which are resolved at compile time.
Jan
26
comment Why does the US government disallow dynamic languages for secure projects?
-1 for factual accuracy problems. Buffer overflow exploits are a problem highly specific to the C language; you never hear about them in languages that don't allow you to allocate a string buffer on the stack. And it's not at all difficult to imagine a hypothetical SQL dialect in which the use of Parameters was not simply allowed but required. SQL injection would be impossible in this language. So yes, a properly-designed language can protect you from several common types of attacks.
Jan
8
comment What are the complexities of memory-unmanaged programming?
@ThomasEding: GC certainly is an optimization; it optimizes for minimal programmer effort, at the expense of performance and various other program quality metrics.
Dec
28
comment What's the difference between a macro and a script?
@Frustrated: Yeah, but from the context it doesn't look like that's what he's asking.
Dec
9
comment Exceptions or Error codes
@JensG: If this is a web service and not a website, the client should be professional enough to email it to you as a bug report.
Dec
8
comment How to best protect from 0 passed to std::string parameters?
Hooray for leaky abstractions! I'm not a C++ developer, but is there any reason why you couldn't check the string object's c_str property?
Nov
12
comment How should I make searching a relational database more efficient?
Second, it's a bit confusing what you're asking for. Can you edit your question to clarify a little about your large object graph and what it has to do with setting up searches? Right now I'm having a lot of trouble visualizing the problem you're trying to solve.
Nov
12
comment How should I make searching a relational database more efficient?
First off, a single string search as part of a web application (or any other system in which the possibility of a hostile user exists) is never a good idea. There are all sorts of little ways that a hostile user can manipulate query strings--even ones that someone is trying hard to sanitize properly--into creating a special query that hacks your database. This whole class of attacks is known as SQL Injection, and the only truly safe way to handle it is with parameterized queries.
Nov
10
comment When there's no TCO, when to worry about blowing the stack?
@Giorgio: Umm... it is a well-known truth, and has been for decades. The complexity of proving correctness of code rises exponentially faster than the complexity of the code itself, making it infeasible to the point of impossibility to produce any proof worthy of the term for non-trivial code. Did you seriously not know that, or are you trolling me?
Nov
9
comment The clock problem - to if or not to if?
Would the downvoter care to comment?
Nov
9
comment When there's no TCO, when to worry about blowing the stack?
@Giorgio: First, how does tail recursion make it easier to track your variables? Second, what does that have to do with modifying the values of variables? (This is something that's always taken as an article of faith by the Cult of Immutability, but never with any comprehensible rationale attached.) Third, "proving the correctness of code" is a bad joke for just about anything more complicated than "Hello world," and everyone knows it, so why are you even bringing that up?
Nov
8
comment When there's no TCO, when to worry about blowing the stack?
It's supposed to be designed to stay out of your way and let you focus on what you want instead of how you want to do it, but in many cases, writing simple code for what you want turns out to be horribly inefficient, and you need a lot more code describing how to do it right. (For some real fun, check out what Paul Graham says about Lisp to a non-Lisp audience. Then check out his book, On Lisp, in which literally the first thing he talks about is how all sorts of naive/intuitive constructs are horribly inefficient, and here is "the right way" to do them, which is about 3x more complicated.)
Nov
8
comment When there's no TCO, when to worry about blowing the stack?
@Giorgio: Oy, where do I even begin? The fundamental model is "let's pretend we're not actually programming a computer." (Not nearly as bad--or as pretentious about it--as Haskell, but still.) The fundamental iteration model isn't iteration, and naive recursion often doesn't work well, so you have to go way out of your way in many cases to transform your intuitive recursion into the special tail-recursive form, which is a lot more complicated and harder to read, so that the compiler can magically turn it into iteration for you! If that's not an abstraction inversion, I don't know what is!