2,588 reputation
21529
bio website
location
age
visits member for 3 years, 11 months
seen 2 days ago

Dec
18
comment How to define “or” logically
I simplified it down for you. (I also changed true to arg1 to make it work better with non-Boolean types.)
Dec
18
revised How to define “or” logically
deleted 56 characters in body
Dec
18
comment Are all magic numbers created the same?
Mathematical constants can't change, so leave them as-is. Physical constants aren't so constant though (they can be re-measured, they can be redefined, etc.) so they're more magical.
Dec
11
comment Is there ever a reason to use an array when lists are available?
@TheodorosChatzigiannakis: Arrays are faster than lists. Just run a simple benchmark to check.
Nov
11
comment Should I pass in filenames to be opened, or open files?
@JonathanEunice: Not sure what you're disagreeing about since we're talking about different things but ok.
Nov
11
comment Should I pass in filenames to be opened, or open files?
@JonathanEunice: Uh, that's not "counterbalancing with a tradeoff"... when you said that, it implied you were claiming there was some advantage to passing around the file names. But that's not what you're saying, so I don't have anything to say on the topic since it's not relevant to the comparison I was making in my answer.
Nov
11
comment Should I pass in filenames to be opened, or open files?
@JonathanEunice: I don't get it, how does passing around the file names instead of the handles solve this issue in any way? Either way all the readers have to know what part of the file you're reading from.
Nov
11
comment Should I pass in filenames to be opened, or open files?
@JonathanEunice: Coordinate in what sense? All they need to do is set the file position to be wherever they want it to be.
Nov
11
answered Should I pass in filenames to be opened, or open files?
Nov
4
answered Should a getter throw an exception if its object has invalid state?
Oct
25
answered Code that converts a value into a different representation, then converts it back to where it started is bad, but how?
Oct
12
awarded  Popular Question
Sep
19
awarded  Notable Question
Sep
13
awarded  Famous Question
Aug
22
comment Interface design where functions need to be called in a specific sequence
+1 this is the most flexible way to do it.
Aug
18
comment In the days of modern computing, in 'typical business apps' - why does performance matter?
@JanHudec: I don't quite see how you can really say that with a straight face when the very website you're currently on (our dear Stack Exchange) serves 560M page views a month across the world runs on just 25 servers.
Aug
16
comment What does “context-free” mean in the term “context-free grammar”?
Kind of a tangent, bhat happens if you give a PDA one or two extra stacks? Can it recognize an interesting, broader class of languages in that case?
Aug
14
comment Why do people nowadays use factory classes so often?
One thing that never made sense to me is, if you use factories to make new objects then you have to make the factory in the first place. So what exactly does that get you? Is it assumed that someone else will give you the factory instead of you instantiating it on your own, or something else? This should be mentioned in the answer, otherwise it's unclear how factories actually solve any problem.
Jul
25
comment Is immutability very worthwhile when there is no concurrency?
@KChaloux: Your first point is just a language limitation, not a conceptual one. I'm not going to continue farther.
Jul
25
comment Is immutability very worthwhile when there is no concurrency?
@itsbruce: (I'll only respond since this is a clarification rather than a continuation of the debate, so let's leave it at that.) I guess what I've been trying to say is that the type shouldn't be immutable in the first place, unless it's a violation of the type's correctness rather than a maintainability issue. The user should be able to choose to make individual variables mutable or immutable depending on the situation, and if you make your type immutable, then you take that choice away and force the user to pay an unnecessary performance penalty even when it matters. That's all.