Reputation
4,218
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
2 21 38
Impact
~225k people reached

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 should I use a factory class instead of direct object construction?
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.
Jul
24
comment Is immutability very worthwhile when there is no concurrency?
My last comment for now, for future readers (and perhaps for @Doval): Looking over the discussion again, I think there is a confusion I need to clear up. The original question was about making types immutable, not about making individual variables immutable. My argument has been that that making types immutable by default is not a good idea because it prevents you from making mutable variables of that type whenever that's necessary (for performance or other reasons). I'm not claiming, however, that making variables mutable by default is a good idea. So don't confuse the two.
Jul
24
comment Is immutability very worthwhile when there is no concurrency?
@Doval: Yeah, well what about when you do have a performance problem?! The fact that your best rebuttal is "well, if it's not a problem then I'll just ignore it" is my entire point here. Parallelism isn't a magic bullet. One machine only contains so many CPUs (say, 8), so it's not like you actually will necessarily have the parallelism you need. But parallelizing beyond that is freaking hard. And potentially expensive. Functional programming just spits in the face of Computer Science, whose goal is to worry about efficiency. But if you don't want to reply then don't.
Jul
24
comment Is immutability very worthwhile when there is no concurrency?
@Doval: So, any thoughts on the log N factor?
Jul
24
comment Is immutability very worthwhile when there is no concurrency?
@Giorgio: Thanks, 3x is pretty impressive. Not convinced it's close to the same ballpark though. If I had to switch from C++ to assembly, I think it would take me at least an order of magnitude or even two orders more time, not just twice or three times as long.