Reputation
1,025
Next privilege 2,000 Rep.
Edit questions and answers
Badges
8 15
Newest
 Yearling
Impact
~411k people reached

Mar
27
comment What causes floating point rounding errors?
@robert: That's not exactly what I was referring to. The "error" most people encounter with floating point isn't anything to do with floating point per se, it's the base. IEEE-754 floats and doubles use an exponent in base 2, which means that fractional numbers round off to negative powers of two (1/2, 1/16, 1/1024, etc.) rather than negative powers of 10 (1/10, 1/1000, etc.) This leads to unintuitive results like 0.1 rounding to 0.1000001 and similar issues.
Mar
18
comment When is it a good idea to force garbage collection?
@JimmyHoffa: you say "everything that Main() references ... will be rooted until your Main() returns at the end of your process." That's not necessarily true. An object can become eligible for collection during execution of a method on that very object.
Mar
18
comment When is it a good idea to force garbage collection?
If you haven't yet read Raymond Chen's post Everybody thinks about garbage collection the wrong way (and follow-up articles like When does an object become available for garbage collection?) then you really should.
Feb
10
comment Are there any easy-to-follow/reliable methods for simplifying code?
@AgiHammerthief: Some people think that design patterns are things you should do, as if they were a checklist of some kind. Not so. Design patterns are a language you use to communicate to other programmers the ideas you're using to solve your problems. That is, when someone tells me they're using a Factory, or a Builder, or whatever, that's just a way to communicate. Patterns don't themselves make code good or bad -- the code can be that all by itself.
Oct
21
answered Why are floating point numbers used often in Science/Engineering?
Oct
15
awarded  Yearling
Jul
2
comment Why is the finalize method included in Java?
@rwong: Indeed. There are very few environments where (a) native leaks are a serious problem, (b) there is insufficient redundancy to tolerate JVM restarts, (c) there is no practical way to structure or audit the codebase to ensure that close() methods or similar are actually called, and (d) a sometime-later best-effort cleanup process is actually sufficient. In a case where all of those are true, then finalizers are perhaps a good solution. However, I think the advice to Read Effective Java first is sound: unless you fully understand finalizers, you're probably not competent to use them.
Jun
26
comment Why is the finalize method included in Java?
Even in the native peer case, I think PhantomReference is a better solution. Finalizers are a wart left over from the early days of Java, and like Object.clone() and raw types, are a part of the language best forgotten.
Jun
26
comment Why is the finalize method included in Java?
I guess I didn't spell it out well in my answer, but (IMO) the answer to "why does it exist?" is "it shouldn't". For those rare cases where you really need a finalization operation, you probably want to build it yourself with PhantomReference and ReferenceQueue instead.
Jun
26
answered Why is the finalize method included in Java?
Apr
29
awarded  Nice Answer
Oct
15
awarded  Yearling
Sep
13
awarded  Nice Answer
Aug
18
comment Java Heap Allocation Faster than C++
You may find my answer to a similar question over on SO useful/relevant.
Aug
18
answered Is “pass by value” synonymous with “functional programming”
Aug
14
awarded  Nice Answer
Aug
14
revised Why are reference-counting smart pointers so popular?
added link
Aug
14
answered Why are reference-counting smart pointers so popular?
Apr
21
comment How common is it for a team to write everything in-house?
@tp1: I categorically disagree. On the contrary, if it is possible to reuse someone else's work, it is nearly always better to not do it yourself. Reusing the research, analysis, development, and debugging efforts of another team means that you can devote more resources to delivering increased value for your project. To argue otherwise is sheer hubris.
Apr
20
comment How common is it for a team to write everything in-house?
@tp1: I work for Google and I can assure you that Google very much does use third-party libraries when they meet our needs. Many times Google has needs that are unique or at a different scale from many other software companies, so for one reason or another Google will often develop things in house. But Google also uses a large number of open-source libraries, and/or open-sources lots of internal libraries, so not everything is in-house. Most of your points no longer apply for open-source software, since by having the source you ensure that you can always debug it and fix it if necessary.