248 reputation
24
bio website
location Seattle, WA
age 30
visits member for 3 years, 1 month
seen 15 hours ago

Sep
13
awarded  Yearling
Sep
13
answered Should `setX(Object o)` methods perform deep or shallow copies of objects?
Sep
13
answered How to signal that a method chain should not continue?
Sep
2
comment Beginning a sentence with a function name?
+1. In Mathematical Proofs (Chartrand et al., 2000), whose Chapter 0 is a true fount of good advice for mathematical writing, the very first rule under Using Symbols is "Never start a sentence with a symbol." (The example is a sentence that starts with an equation; the authors suggest prefacing it with "The equation ___".) Although not all mathematical writing advice necessarily applies to writing about source code, I think this is one bit that does.
Aug
24
comment What is referential transparency?
@Giorgio: This is perhaps subjective, but I'd argue that cached results are not really "mutable state" if they're hidden and have no observable effects. Immutability is always an abstraction implemented on top of mutable hardware; frequently it's provided by the language (giving the abstraction of "a value" even if the value can move between registers and memory locations during execution, and can vanish once it's known it will never be used again), but it's no less valid when it's provided by a library or whatnot. (Assuming it's implemented correctly, of course.)
Apr
26
comment Are there numbers that are not representable in base 10 but can be represented in base 2?
@PatrickM: "Aside: is there a word to indicate numbers that do or don't share all common factors?": Any integer is a factor of itself, so if all factors of m are factors of n, then it trivially follows that m is a factor of n. One term for this, as you clearly know, is factor. Another is divisor.
Nov
5
comment What is meant by, “A user shouldn't decide whether it is an Admin or not. The Privileges or Security system should.”
@Phil: user.getRole().isAdmin() implies that a given user has only a single role. That's even worse than user.isAdmin(), which implies only that a given user either is an administrator everywhere or is not an administrator anywhere.
Oct
26
comment What are the safety benefits of a type system?
@BenjaminGruenbaum: Your comments are valuable, and that paper is interesting, but it does not bear out your claim that "it's usually undecidable in static languages like Java too", since it demonstrates that it is decidable in C#, and leaves open the question of whether it's undecidable in Java. (And anyway, IME, when a compiler for a statically-typed language can't decide that something is well-typed, it rejects it (or fails to compile it), so undecidability is an annoyance rather than a hole in the type-safety.)
Oct
17
comment How much freedom should a programmer have in choosing a language and framework?
@brichins: I think one of the big problems with this answer is that it actually doesn't point out what you say it does!
Oct
6
comment Why is quantity in software still written as “1 result(s)”?
@Aaronaught: No, no, you're misunderstanding my comment. I noticed the RTL issues, and saw your comment about them, so I looked past them. I'm talking about the actual translation that Google Translate gives: it's drawing a distinction that does not exist, and that therefore isn't relevant to real localization done by humans.
Oct
5
comment Why is quantity in software still written as “1 result(s)”?
+1, but I think this might say more about Google Translate than about correct localization. For example, for Hebrew it thinks that when you've got one item, you should say matsa prit 1 "found 1 item", and when you've got two, you should say 2 pritim nimts'u "2 items were found". In reality, of course, there's no such distinction: matsa 2 pritim "found 2 items" and prit 1 nimtsa "1 item was found" are both fine. (Still, prit 1 "1 item" vs. 2 pritim "2 items" is genuinely tricky.)
Oct
3
comment Optional semicolons
@MichaelT: I don't think your classifications are correct: Perl arguably belongs to both groups, and JavaScript is actually in the "statement terminators" camp (since implementations are required to infer a semicolon before } or at end-of-file).
Oct
3
comment Optional semicolons
[Highly pedantic note: I should say that technically speaking, per the spec, a JS program containing return followed by a newline is invalid until the semicolon is inserted, because the syntax of a return statement forbids a newline after the keyword. But this amounts to the same thing.]
Oct
3
comment Optional semicolons
@delnan: The reason it's surprising is that JavaScript usually doesn't insert a semicolon at the end of a line, except to fix an otherwise-invalid program. After return is one of only a handful of cases where JavaScript will insert a semicolon even if the program would be valid without it. (But of course, this undermines Mason Wheeler's point. The problem isn't that the semicolons are optional, it's that the rules are inconsistent.)
Aug
3
comment Are bugs part of technical debt?
+1. I think BЈовић's answer is pretty much right, but your answer really hits the nail on the head. (I'm a bit confused by your use of the term de facto, though. I don't think you can be saying that de jure, a bug is technical debt?)
Jul
30
comment How to create better OO code in a relational database driven application where the database is poorly designed
Most of the problems you list . . . aren't. The use of surrogate keys rather than natural keys is actually a pretty standard recommendation nowadays; not "poor design" at all. The lack of constraints and the use of inappropriate column-types is a better example as far as "poor design" goes, but it shouldn't actually affect your application code at all (unless you plan to abuse these problems?).
Jul
27
comment Methods as verbs: is the object the subject?
@leonbloy: In this instance, I disagree; you are asking the OutputStream instance to "write" the specified bytes. You're not writing to the OutputStream instance, you're having the OutputStream instance write to whatever-it's-set-up-to-write-to. (But in general, I agree that the method-name is not always a verb with the instance as subject.)
Jul
27
answered Are closures sufficient to characterize functional programming?
Jul
21
awarded  Teacher
Jul
21
answered Is it necessary to follow the standard , take the C standard for that matter?