Reputation
1,343
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
10 20
Newest
 Nice Answer
Impact
~64k people reached

  • 0 posts edited
  • 0 helpful flags
  • 262 votes cast
Jan
27
awarded  Nice Answer
Jan
23
awarded  Yearling
Sep
16
awarded  Nice Question
Sep
4
answered What's the use of .Any() in a C# List<>?
Jun
17
awarded  Popular Question
May
20
comment How do you avoid getters and setters?
I don't really think properties are really good. Sure, you save the prefix and the parentheses, i.e., 5 chars per call, but 1. they look like fields, which is confusing. 2. they're an additional thing for which you need support in reflection. No big deal, but no big advantage either (when compared to Java+Lombok; pure Java is at clear loss).
May
20
comment How do you avoid getters and setters?
The advantage of [gs]etters is that you can do the things you usually don't (check values, notify observers), simulate non-existing fields etc., and mainly that you can change it later. With Lombok, the boilerplate is gone: @Getter @Setter class MutablePoint3D {private int x, y, z;}.
May
11
comment Intentional misspellings to avoid reserved words
@GoloRoden According to Merriam-Webster it's not a verb, but see this answer.
Apr
21
comment Why does the TRACE level exists, and when should I use it rather than DEBUG?
All my TRACE logs were born as DEBUG, but grew too numerous. Instead of deleting them, I downgraded them.
Apr
6
comment Enums in java switch-statements and completeness
Actually, adding a return statement after the switch statement is my preferred way as it gives me a warning when the enum gets extended.
Apr
6
comment Internal class variables convention
@MichaelT Sure, I wasn't serious about it. It also had a good justification in those times when there were just a few types to work with. Nowadays, I find the m or m_ variant just terrible, as you can simply write this.x = x instead of m_x = x.
Apr
6
comment OOP (possibly Java-specific): Comprehensive Set of Method Categories
@sadakatsu One problem is that there're no really useful categories. As already said, separating getters from setters is no good idea, but at the same time, separating modifying methods from non-modifying might be. Othertimes, separating by visibility may be more important. I spent quite some time thinking about it and just gave up. I try to organize methods by call chain, but I try only very lightly as the gain is pretty limited. Moving methods around to conform better to any rules is a terrible idea because of VCS, so I just don't care. By using project Lombok I can keep classes very small..
Apr
6
comment Should I always call super in Java?
The linked question is about syntax and coding conventions (when to use a keyword) while this one is about overriding and calling super method from this method. Not a great question, but completely unrelated to the "duplicate".
Apr
6
comment Internal class variables convention
It's a sort of Hungarian notation, most probably called so because it's equally easy to read.
Mar
6
awarded  Popular Question
Feb
2
awarded  Popular Question
Jan
23
awarded  Yearling
Nov
27
comment Can we replace XML with JSON entirely?
@trVoldemort No, several p-tags would like <p>par1</p><p>par2</p> would look like [{"p": "par1}, {"p": "par2"}]. Actually, I'm only using a hash key to distinguish the tag from the body. Mimicking SXML would be probably clearer. While I might agree that XML may be better than JSON for markup, it's a real mess for anything else. Especially configuration and object serialization.
Nov
18
comment Why didn't == operator string value comparison make it to Java?
Let us continue this discussion in chat.
Nov
18
comment Why didn't == operator string value comparison make it to Java?
If there's no good solution for the primitive to object comparison, then I'd simply forbid it. It'd be a special rule, but one which could bite nobody. +++ Claiming that int to float is not lossy is one of big Java mistakes (rarely anybody runs into this, but if so, it's pretty hard to find). If they didn't want to special case 1 + 2.0f to return double, then they should simply forbid it; similarly for 16777217==16777216.0f. +++ Also lL + 2.0 should be forbidden, as there's no type to which both operands could converted to without real narrowing.