At first, I thought this was a sign of a Microsoft programmer with too much time on their hands, but then I realized that of course, in Australia, where they are upside down, they need the selection to move upwards when pressing enter!
And left/right is for places where everything is politicized… “No communist/fascist selections in my home!”
Let me explain. I’m creating a unit test where I need to do some calculations in order to create an expected value (i.e. do the same computation as the function I’m testing but differently… or usually more manually…)
So this is my test (high lighted was marked as “pointless”):
final MinMaxAverage mma = new MinMaxAverage();
final double min = mma.min();
final double max = mma.max();
final double sum = mma.sum();
final double average = mma.average();
final int count = mma.count();
assertEquals(1d*1d + 2d*2d + 4d*4d, sum);
assertEquals((1d*1d + 2d*2d + 4d*4d) / (1d + 2d + 4d), average);
Sure, this test could have used another weight, but I wanted to test with a weight of 1. And regardless… is this pointless arithmetic in a test? Or for that matter in a complex program that might actually benefit from more simple code?
Programming isn’t just coding and numbers… it’s also communicating with other programmers and yourself in a year. Some IDE simplifications aren’t necessarily simplifications at all. Sure, you can make the code look lean and nice, but you probably should think twice about that if it’s a fringe case, something you use very seldom, or in this case the attempt to make the inner workings of a function in a test more transparent.
Ah well, regardless… I fear I’m expecting the IDE to understand my thoughts and feelings… I guess our relationship is in choppy waters then? 😀
A: This is a picture of a fish, it clearly have fins! B: Giraffes don’t have fins! A: It’s a picture of a fish! B: What’s fishes got to do with anything? A: They have fins. B: Giraffes don’t. A: We’re talking about fish. B: Giraffes don’t have fins! A: Right Giraffes don’t have fins. B: See, I’m right… A: Yes with regards to giraffes… B: …fishes don’t have fins. A: I give up. B: I’m so cool! I’m so right! I’m so hot! I’m so bright! I’m so yeah oh yeah!
If you double click something in the user interface, the interface redraws and rearranges controls at the exact same moment causing your double click to end up on something else, then you know you’re dealing with a miserable excuse for a user interface… (Apple? Microsoft? If you’re interested… No? Why am I not surprised?)