1,184 reputation
815
bio website
location
age
visits member for 3 years, 9 months
seen Oct 13 at 21:33

Jun
15
revised Do dependency injection frameworks pose a dependency risk?
added 160 characters in body
Jun
15
comment Do dependency injection frameworks pose a dependency risk?
What the? These are my stats per class: 0.5 annotation, 0.1 configuration line. So what complexity do you mean???
Jun
15
comment Do dependency injection frameworks pose a dependency risk?
I agree that small projects do not require it, but 95+% of projects can profit from it.
Jun
15
answered Do dependency injection frameworks pose a dependency risk?
Jun
11
comment How to name a method that both performs a task and returns a boolean as a status?
Most of the time, I'd call it "broken" as returning a boolean instead of wrapping or passing the exception is nearly always wrong.
Jun
3
comment When do rounding problems become a real problem? Is the least significant digit being one off really a big deal?
@supercat I do nothing but final rounding when producing the output. In your example there's 1e16 and the total amount of money in the worlds is just a few trillions, i.e., such a huge precision loss never occurs. If it did, then I'd be out of luck. When both the number of decimal places and the rounding mode are prescribed, then I'd have to switch to BigDecimal, but only for this computation. The nice thing is that all the slight imprecise doubles I'm having everywhere get exact again, when converted to BigDecimal by rounding.
May
23
comment What is wrong with Java's generics?
Nice rant. However, there are many libraries/frameworks which could exists without generics, e.g., Guice, Gson, Hibernate. And generics are not that hard once you get used to it. Typing and reading the type arguments is a real PITA; here val helps if you can use.
Apr
15
comment Can we replace XML with JSON entirely?
@MattR: Right, translating attributes into JSON makes it look bad. However, I'd say that the very existence of attributes is bad. Imagine you need some details on wheels. So you get <car><wheels><wheel size=big/><wheel size=big/><wheel size=small/></wheels></car> which looks terrible itself and you have to support the now obsolete attribute wheels. And a possible inconsistency when both the attribute and details are present.
Apr
15
comment Can we replace XML with JSON entirely?
@MartinWickman: I don't understand your JSON... and I don't see how to find out that "fine" should be in the middle. What about {"p": ["A ", {"b": "fine"}, " mess we're in!"]}?
Apr
15
comment Why must directories be empty before being deleted?
The last paragraph is rather false. Windows asks things like "blah.exe is an application, are you sure?", "blah is whatever, are you sure?" again and again and you need something like TeraCopy to get rid of it.
Apr
4
comment When do rounding problems become a real problem? Is the least significant digit being one off really a big deal?
I see, this is sort of home made 64-bit mantissa extended. I actually agree that sometimes double doesn't suffice and that often using a more expensive type is the easiest and sometimes the only way. It's just that often double with some more thinking do the job.
Apr
4
comment When do rounding problems become a real problem? Is the least significant digit being one off really a big deal?
Pair of ints? Are you using rational numbers? How do you ensure they don't overflow? This happens pretty fast when adding a couple of fractions.
Apr
4
comment When do rounding problems become a real problem? Is the least significant digit being one off really a big deal?
In this case you can fight the round-off error by rounding twice, first to three decimal places, then to two. For this computation you need an exact representation but all previous results can be computed and stored as doubles. This saves quite some memory and time.
Feb
19
answered Indirection: Readability vs Performance
Feb
19
awarded  Citizen Patrol
Feb
15
comment Is java.util.prefs.Preferences appropriate for accessing changes in state that need to be immediately accessed during runtime?
1. "passing this object to many different constructors" - use Dependency Injection. 2. I would not use Preferences (or any other an existing class) for something like this. Use your own, even if it only delegates to Preferences. This gives you the flexibility you may need one day (e.g., your data grows too big for Preferences) and also allows you to use a much better suited interface (e.g., getWhateverObjectYouWorkWith and getAnotherOne instead of getSomePredefinedThing).
Feb
7
comment Communicate to a junior developer about bad style
@AaronHall: I'd strongly suggest to use this "craziness", especially if it can not only check but also fix the formatting. This can save a few minutes every time anything about the style is unclear. And this holds for each new programmer to come.
Jan
25
comment How should I pronounce the :: and -> in PHP?
@FrustratedWithFormsDesigner: That sounds much better in languages using "double dot" as the name for "colon" (e.g. German "Doppelpunkt").
Jan
23
awarded  Yearling
Jan
18
comment What is the main difference between Scripting Languages and Programming Languages?
@Ted: IMHO, there's no such thing like "compiled" language - it's all matter of implementation. IIRC there's a C interpreter, what does it mean? That said, I don't like the other definitions either.