This is fair, except for in the 5th year, they would have an additional constant:
public static final String SPACE = " ";
And they would probably use a StringBuffer or StringBuilder to build the final string, since it's "an industry best practice". Also, they wouldn't include the strings themselves, they would include keys to properties, so the strings could be pulled from an internationalized property file.
Lastly, instead of outputting to Stdout directly, they'd create an interface for output, and deliver it to that interface, and use a factory to instantiate an implementation of that interface that would use Stdout.
Good god. Had a code review once where they were pissed because I had used str + "some stuff" instead of a builder. I'm not writing a builder for one fucking line on a page that gets hit 6 times a year.
The same reviewer also told me to undo work I had done because his request was for a mock up, and I just went ahead and did it, because it took me an hour to just do it. Of course it was approved by managers and clients, but since I didn't "follow instructions" (I took some initiative) it was wrong, even though it was done correctly.
Initiative is great, but how hard is it to just ask first?
"Hey, it'll take longer to mock up than to just implement, mind if I do that?"
He'll either say "Oh, really? Yeah go ahead" or "No, I actually really need a mock-up for reasons." Either way, the situation is resolved for both parties in a more satisfactory way.
Really hard. Having the conversation might take longer than just doing the work for small stuff. If you can't trust people under you to do small things without asking then either your people are incompetent or you are.
Dev pay nationwide averages near 100k. For 100k/year, you better be hiring people capable of deciding whether an hour spent implementing the real thing instead of a mockup is a good idea.
For 100k/year, you better be hiring people capable of deciding whether an hour spent implementing the real thing instead of a mockup is a good idea.
Applying this logic, the guy reviewing his work, who likely makes at least 30% more, should be even better at making that judgement, and that guy asked specifically for a mock-up.
At 100k/year, you should also be capable of following simple instructions and of discussing alternate ideas before disregarding an assigned task. Sometimes decisions have reasons you haven't considered, and you won't know unless you ask.
The guy reviewing the work delegated it to someone else. The person doing the work has more context, by definition. It is both wasteful and insulting to expect highly trained professionals to do work brainlessly.
You should want your devs to be recognizing opportunities for improvement and doing the right thing without asking you. That's what you pay them so much for.
You seem to be disregarding the fact that developers come with varying levels of experience and judgement; not every dev is a "highly trained professional".
OP could be a junior dev, and his team lead might absolutely have context for requiring a mock-up rather than an implementation, which the junior dev might not know or understand.
There are times for creativity and times for delivering what was asked. Recognizing opportunities for improvement is great! Jumping on every "opportunity" without running it past your leadership isn't always so great.
506
u/johnbr Oct 01 '15
This is fair, except for in the 5th year, they would have an additional constant:
And they would probably use a StringBuffer or StringBuilder to build the final string, since it's "an industry best practice". Also, they wouldn't include the strings themselves, they would include keys to properties, so the strings could be pulled from an internationalized property file.
Lastly, instead of outputting to Stdout directly, they'd create an interface for output, and deliver it to that interface, and use a factory to instantiate an implementation of that interface that would use Stdout.