I had a similar reaction to shooting something slowly. Are you giving it a sporting chance by pulling the trigger slowly? Using slow projectiles? Kill it, slowly, makes sense. Shooting slowly, not so much.

I had a similar reaction to shooting something slowly. Are you giving it a sporting chance by pulling the trigger slowly? Using slow projectiles? Kill it, slowly, makes sense. Shooting slowly, not so much.

Shooting can be things other than firearms. Obviously he meant something like shoot basketballs at them, throwing slowly, until they are beaten to death.

I had a similar reaction to shooting something slowly. Are you giving it a sporting chance by pulling the trigger slowly? Using slow projectiles? Kill it, slowly, makes sense. Shooting slowly, not so much.

Shooting can be things other than firearms. Obviously he meant something like shoot basketballs at them, throwing slowly, until they are beaten to death.

Or it could be with firearms after all. Shooting him in the foot first, then the knee, maybe the shoulder, ya know...?

I had a similar reaction to shooting something slowly. Are you giving it a sporting chance by pulling the trigger slowly? Using slow projectiles? Kill it, slowly, makes sense. Shooting slowly, not so much.

Shooting can be things other than firearms. Obviously he meant something like shoot basketballs at them, throwing slowly, until they are beaten to death.

Or it could be with firearms after all. Shooting him in the foot first, then the knee, maybe the shoulder, ya know...?

I was already criticizing them for some serious coding bugs, so I didn't feel like being nitpicky in addition. Not nearly as bad as OP, but whoever wrote that clearly doesn't understand the language.

1) As it is declared public static final, SOME_SQL_LOOKUP is a compile-time constant. Concatenating literal strings is also done at compile time* so removing all the StringBuffer appends and replacing them with simple literal + concatenations would be better in this case.
2) A StringBuffer instead of a StringBuilder? Uuuugh...
3) This can trivially written in one line anyway, although I'll grant them some aesthetic leeway. But then why clutter it up with those append()s? Oh right, because that's what they were told to do and they don't understand why.

These were also the same guys who used a simplified hungarian notation in Java. To them, this meant that every variable name except for Strings and primitives was prefixed with an o ... because everything is an Object.... yup...

I had a similar reaction to shooting something slowly. Are you giving it a sporting chance by pulling the trigger slowly? Using slow projectiles? Kill it, slowly, makes sense. Shooting slowly, not so much.

Shooting can be things other than firearms. Obviously he meant something like shoot basketballs at them, throwing slowly, until they are beaten to death.

Or it could be with firearms after all. Shooting him in the foot first, then the knee, maybe the shoulder, ya know...?

Or using specially loads, like subsonic rounds.

It seemed I was not wrong after all. ok

Other ways to do this

Use a time bubble where time is slowed

Use a drug that enhance the perception of time

Use a high density medium, like water to make the proyectile slower

Or perhaps I meant that the interval between shooting him/her in different places should be large for maximum psychological effect

These were also the same guys who used a simplified hungarian notation in Java. To them, this meant that every variable name except for Strings and primitives was prefixed with an o ... because everything is an Object.... yup...

I also touch things done like this, hopefully you shot the coworker slowly with basketballs.

Once I saw some SQL concatenation in some coworkers' code base, it looked about like this:

3) This can trivially written in one line anyway, although I'll grant them some aesthetic leeway. But then why clutter it up with those append()s? Oh right, because that's what they were told to do and they don't understand why.

And let's be honest. If string concatenation of a SQL statement is causing a performance hit, you've got bigger problems than that.

In .net, at least, the compiler will take up to 4 +'s and turn them into a single call to String.Concat(). String.Concat(String, String, String, String) is significantly faster than the equivalent stringbuilder.

Now if MS will just teach the compiler to do stringbuilders, we can get rid of yet another piece of apocrypha.

It just so happens that int.TryParse() and int.Parse() behave exactly the same, except TryParse will set outVal to zero and return false if the string fails to parse as a number, while Parse will throw an exception. So that code is equivalent to just calling TryParse and returning outVal.

And while on the subject of exceptions: calling the constructor of an exception inside of a catch block, solely for the side-effect of logging, FTW.

I was already criticizing them for some serious coding bugs, so I didn't feel like being nitpicky in addition. Not nearly as bad as OP, but whoever wrote that clearly doesn't understand the language.

1) As it is declared public static final, SOME_SQL_LOOKUP is a compile-time constant. Concatenating literal strings is also done at compile time* so removing all the StringBuffer appends and replacing them with simple literal + concatenations would be better in this case.
2) A StringBuffer instead of a StringBuilder? Uuuugh...
3) This can trivially written in one line anyway, although I'll grant them some aesthetic leeway. But then why clutter it up with those append()s? Oh right, because that's what they were told to do and they don't understand why.

These were also the same guys who used a simplified hungarian notation in Java. To them, this meant that every variable name except for Strings and primitives was prefixed with an o ... because everything is an Object.... yup...

Possibly the result of maintenance and concept migration.

Probably started as a standard non-static variable built at run-time (a fairly common though inefficient paradigm).

Probably originally written pre-Java 5, when StringBuilder wasn't available.

Yes, the next round of code review the maintenance engineer calmly strips out the appends and makes it all one string, either by using "+" concatenation. Yes it could be written on one line, but I've had DBA's complain that the SQL then isn't formatted neatly on the page in the form it's presented here.

I won't condone Hungarian notation, though. Apart from that, very much the sort of stuff I no longer have to maintain. No big deal.

In .net, at least, the compiler will take up to 4 +'s and turn them into a single call to String.Concat(). String.Concat(String, String, String, String) is significantly faster than the equivalent stringbuilder.

Now if MS will just teach the compiler to do stringbuilders, we can get rid of yet another piece of apocrypha.

TryParse will set outVal to zero and return false if the string fails to parse as a number,

This always bugged me a little. It seems like outVal should have been declared ref instead of out, so it could leave the previous value alone if parsing fails. I understand this means you'd have to initialize the variable before passing it in, but that's cleaner than storing the previous value in a temporary variable, checking for success, and restoring it if it fails.

In the common case, you could just initialize your variable to the default, then TryParse, and not even need to check the return value, if it behaved this way.

In .net, at least, the compiler will take up to 4 +'s and turn them into a single call to String.Concat(). String.Concat(String, String, String, String) is significantly faster than the equivalent stringbuilder.

Now if MS will just teach the compiler to do stringbuilders, we can get rid of yet another piece of apocrypha.