1,196 reputation
815
bio website
location
age
visits member for 3 years, 11 months
seen yesterday

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.
Jan
14
comment Intentional misspellings to avoid reserved words
IMHO it's not better, you could call it 'classToBeAccessed` or whatever, but any more descriptive name just shows the obvious. I like long names only if they provide useful information.
Jan
14
comment Intentional misspellings to avoid reserved words
@KonradMorawski: But all object you work with are instances, so classInstance is pretty redundant. Moreover, I could imagine something like class klass; Object classInstance = klass.newInstance;.
Nov
17
awarded  Pundit
Nov
12
awarded  Notable Question
Nov
12
comment In Java, should I use “final” for parameters and locals even when I don't have to?
@Steve Kuo: It just allows me to quickly find all variables. no big gain, but together with preventing accidental assignments it's worth the 6 chars. I'd be much more happy if there was something like var for marking non-final variables. YMMV.
Nov
1
comment Help with design structure choice: Using classes or library of functions
Classes with a single function are no problem (you can nest them in a single file, at least in Java). Using classes gives you more flexibility (imagine the user will define a macro: with classes you simply create a list like (new EdgeDetection(), new SimpleSharpening(4), new Rotation(90)). Classes give you more flexibility (which you mightn't need).
Oct
17
comment Why did memory-managed languages like Java, Javascript, and C# retain the `new` keyword?
+1 for the broken switch (in the hope you repair it :D).
Oct
17
comment Why did memory-managed languages like Java, Javascript, and C# retain the `new` keyword?
I wonder that they don't use "New" instead of "new". Somebody could tell them there are also lowercase letters, which sort of solve this problem.
Oct
12
answered How can I handle clock hands using doubles that suffers at most O(log n) corrupt bits at nth frame of display?
Oct
2
answered New nodes joining distributed genetic algorithm
Sep
27
comment Should ** bind more tightly than !, ~?
@Sean McSomething: Maybe... the problem is that it makes the code longer... and a smaller part of it fits on the screen. But increment/decrement is not very common outside of loop headers, so it's not really bad.
Sep
27
comment Should ** bind more tightly than !, ~?
@Sean McSomething: Or allow them but only on L-values occurring exactly once?
Sep
27
comment Should ** bind more tightly than !, ~?
@amon: I see... but I'd simply ignore it. It's non-commutative monoid, it has no absorbing element, so what? Multiplication of positive integers has none either.
Sep
27
comment Should ** bind more tightly than !, ~?
KISS. A rule like "all unary operators take precedence over all binary ones" is much easier to remember than any super-smart rule allowing to save a few chars from time to time.
Sep
27
comment Should ** bind more tightly than !, ~?
@amon: Sure does concatanation have a neutral element: the empty string. So it's like multiplication, but I don't believe using * wouldn't be any better than +. I fully agree with forbidding things like 1+2+"3"!