Reputation
8,770
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
2 23 54
Impact
~504k people reached

2h
comment Why is it so difficult to read code?
While you are struggling with other people's code, please stop and ask yourself "What's the smallest change that would make sense of this?" Ideally, you'll work somewhere that has code reviews so you can helpfully suggest such a change. When writing your own code, try to remember everything that made other's code awful and use that knowledge to make your own code better. Perhaps the best things you can do are 1. proofread your own code and 2. leave a comments explaining WHY you did what you did. That way the next person's experience won't be like this: abstrusegoose.com/432
Jul
21
awarded  Popular Question
Jul
21
comment Is there a performance benefit to using the method reference syntax instead of lambda syntax in Java 8?
@LukasEder Oops - thanks! I've fixed that error. I must have been testing with a method that expected a java.util.function.Function instead of a Consumer.
Jul
21
revised Is there a performance benefit to using the method reference syntax instead of lambda syntax in Java 8?
deleted 13 characters in body
Jul
20
revised Is there a performance benefit to using the method reference syntax instead of lambda syntax in Java 8?
added 127 characters in body
Jun
20
awarded  Taxonomist
Jun
8
awarded  Notable Question
Jun
6
accepted In Java, why does (unsorted) Set implement Iterable, but SortedMap does not?
Jun
5
revised In Java, why does (unsorted) Set implement Iterable, but SortedMap does not?
deleted 16 characters in body
Jun
5
revised In Java, why does (unsorted) Set implement Iterable, but SortedMap does not?
added 585 characters in body
Jun
4
comment In Java, why does (unsorted) Set implement Iterable, but SortedMap does not?
Thank you. You raise good points. I've edited my question to put Collection out-of-bounds. It forces List to implement contains() (will be O(n) slow) and Set to implement iterable() and toArray() (order can change). It can only muddy the waters.
Jun
4
revised In Java, why does (unsorted) Set implement Iterable, but SortedMap does not?
Fixed loose use of Iterator vs. Iterable and suggested we put Collection out-of-bounds.
Jun
4
revised In Java, why does (unsorted) Set implement Iterable, but SortedMap does not?
added 163 characters in body
Jun
4
comment Why doesn't Java 8 include immutable collections?
Good points. Two details: 1. Immutable collections require certain method signatures, specifically (using a List as an example): List<T> add(T t) - all "mutator" methods must return a new collection that reflects the change. 2. For better or worse, Interfaces often represent a contract in addition to a signature. Serializable is one such interface. Similarly, Comparable requires that you correctly implement your compareTo() method to work correctly and ideally be compatible with equals() and hashCode().
Jun
4
revised In Java, why does (unsorted) Set implement Iterable, but SortedMap does not?
added 4 characters in body
Jun
4
asked In Java, why does (unsorted) Set implement Iterable, but SortedMap does not?
May
22
awarded  Famous Question
May
21
revised Is it okay to go against all-caps naming for enums to make their String representation simpler?
added 427 characters in body
May
21
comment Is it okay to go against all-caps naming for enums to make their String representation simpler?
@codebreaker toString() is called implicitly when concatenating strings. Overriding toString() on some enums meant that that sometimes I could just <input type='checkbox' value=" + MY_CONST1 + ">, and sometimes I had to remember to call <input type='checkbox' value=" + MY_CONST1.name() + ">, which led to errors.
May
21
revised Is it okay to go against all-caps naming for enums to make their String representation simpler?
deleted 187 characters in body