3,647 reputation
21932
bio website
location
age
visits member for 4 years, 3 months
seen yesterday

Apr
12
comment Ambiguity of seemingly clear method names in APIs
+1. Regarding your comment: returning the data is ideal, except that it's a huge performance hit to allocate a new buffer every time, so it's not done in practice (as you can tell in Stream).
Apr
12
comment Ambiguity of seemingly clear method names in APIs
@BenAaronson: I guess, but that's neither the real problem here nor can I think of better names. The problem still exists inside the other methods in MyComponent and in derived classes, doesn't it?
Mar
24
comment Do dynamic typed languages deserve all the criticism?
@PaulNathan: You're thinking too hard. The question was asking about dynamically typed languages, and this answer mentions Java as though it's dynamically typed.
Mar
24
comment Do dynamic typed languages deserve all the criticism?
@PaulNathan: Did you read the question?
Mar
24
comment Do dynamic typed languages deserve all the criticism?
I like your answer but Java isn't dynamically typed...
Mar
24
comment Method extraction vs underlying assumptions
+1 One thing that's important to note is that there is a cost to splitting up a big method into smaller chunks: it's typically not useful unless the preconditions and postconditions are more relaxed than they would have been originally, and you can end up having to pay the cost by re-doing checks that you would have otherwise already done. It's not a completely "free" refactoring process.
Mar
24
comment Method extraction vs underlying assumptions
Relevant: Is it always a best practice to write a function for anything that needs to repeat twice?
Mar
21
comment When is it a good idea to force garbage collection?
+1 for that paragraph as well. I find it shocking that people think a computer program written by someone else must necessarily understand the performance characteristics of their program better than themselves.
Mar
16
comment What is the reason of using an interface versus a generically constrained type
Interface methods are indirect calls, whereas type methods can be direct calls. So the latter can be faster than the former, and in the case of ref value type parameters, might actually modify the value type.
Feb
23
comment What about LISP, if anything, makes it easier to implement macro systems?
Macros need to execute though, at that point you're already writing an interpreter for the language.
Feb
3
comment Is a 1 < 10 comparison less expensive than 1 < 1000000?
It could be less expensive if it were in the critical path, but it's almost surely not.
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
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.
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.