I keep hearing this myth about how Java pre-5 used to be a pristine language, until it was touched by annotations and generics - and I doubt it, because I was there.
Before annotations, Java libraries were basically using gigantic XML files to configure things like dependency injection and routing. I don't like the way Java libraries use exceptions at all, but you can't seriously say you want to get to the early J2EE days. Look at the mess that was required to create an Employee entity:
https://docs.oracle.com/cd/A97688_16/generic.903/a97677/ejb1...
Before generics, foreach and autoboxing Java was code was littered with ugly code like this:
List incrementIntList(List input) {
List result = new ArrayList();
for (int i = 0; i < input.size(); i++) {
Object obj = input.get(i);
if (obj instance of Integer) {
Integer int = (Integer)obj;
int i = int.intValue() + 1;
obj = new Integer(i);
}
result.add(obj);
}
return result;
}
While in Java 5 you could finally write:
List<Integer> incrementIntList(List<Integer> input) {
List result = new ArrayList<Integer>();
for (Integer i : input) {
result.add(i + 1);
}
return result;
}
with Java 8, we even got arguably better:
List<Integer> incrementIntList(List<Integer> input) {
return list.stream().map(i -> i + 1);
}
I fail to see how the first version is more readable. Yes, the Java compiler had to become more complex to accommodate this, but every other Java codebase in existence became considerably simpler. I can't see how this is not a win.
The forces pushing for the same kind of ergonomic improvements in Go are not outside forces, but very much the Go designers themselves. This draft your written by Ian Lance Taylor and Robert Griesemer and it looks like a complete overhaul of the contract mechanism proposed by Russ Cox. These people are part of the Go core team.