1,820 reputation
615
bio website kdgregory.com
location
age
visits member for 3 years, 9 months
seen yesterday

1d
comment What'd be better? To add one more local variable, or to call a method twice in general case?
@Doval - Yes IO is a side-effect. In my original edit I only had two points, but then thought that someone would be sure to call me out on volatile reads. That said, I think that it's important to understand and recognize the difference between what I'll call "active" and "passive" side-effects: the former are caused by your action, the latter are caused by external action. In my experience, most concurrency bugs are a result of the latter, not the former.
1d
comment What'd be better? To add one more local variable, or to call a method twice in general case?
@BartvanIngenSchenau - I always find that profiling leads to more dramatic code restructuring than simply introducing a variable.
1d
answered What'd be better? To add one more local variable, or to call a method twice in general case?
2d
comment Disadvantages of Pointers
For whatever reason, the chat page thinks that I'm not logged in. So to respond to your earlier comment, I've updated the tag wiki to give a better explanation of what a "pointer" is.
2d
revised pointers wiki description
added 6 characters in body
2d
suggested approved edit on pointers tag wiki
2d
awarded  Tag Editor
2d
revised pointers wiki description
greatly expanded, with examples
Dec
22
suggested approved edit on pointers tag wiki
Dec
22
awarded  Nice Answer
Dec
18
comment Why can't the Scala compiler give pattern matching warning for nonsealed classes/traits?
It's unclear what you're asking. Do you want the compiler to emit a warning if the match expression doesn't cover all possible inputs? Perhaps an example would make your question more clear.
Dec
18
revised Calculating physical address given only an offset for my process
add diagram
Dec
18
awarded  Editor
Dec
18
revised Calculating physical address given only an offset for my process
add diagram
Dec
18
answered Calculating physical address given only an offset for my process
Dec
9
comment Using reflection vs creating a new class
Are you able to reflect on the Egg to determine what components it contains?
Dec
8
comment Caching build results
Does sbt do what you want? And if not, why not? You might have to modify your build to create actual JARs for your sub-projects. But yes, the dependency management problem has been solved.
Dec
6
comment Distributing a set of “Jobs” across multiple computers
You would probably find Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions by Gregor Hohpe and Bobby Woolf useful. In their terminology, you use a Splitter to distribute work and an Aggregator to assemble the results. Specific implementations of those patterns, however, are completely dependent on your requirements -- to use maple_shaft's term, it's a data store of some sort.
Nov
8
comment Smart fallback for line endings in code files?
This question is unanswerable without more context. How are the files exchanged between users? Is there a canonical version? How much effort do you want to spend doing conversion?
Nov
8
comment Quickest sorting algorithm for sorting a low number of integers
What were you using before qsort()? If your program runs 10x slower after changing that one thing you should switch back to whatever it was.