Val Grind (the wrong kind)
-
I've seen code like x = 0 - y; which, apparently was a workaround for a compiler bug which sometimes generated the wrong code for x = -y; I've also seen lots of legacy code of the type you've described but not in VB. The thing is that the concatenation operator is & so think about why they've used + before you change it. Sometimes there is a reason for using the +. Just make sure the item on the right is a string: it may not always be a string. When it isn't, what is happening and what are they doing?
Member 4608898 wrote:
what is happening and what are they doing?
No one really knows... There's lots of obscure bugs in code like that :) Luckily, one of the other 'magical solutions for all your problems' is the wonderful On Error Resume Next command. Really, if it was allowed people would've used On Error Resume Next + "" :laugh:
It's an OO world.
public class Naerling : Lazy<Person>{
public void DoWork(){ throw new NotImplementedException(); }
} -
...and in my replies above I've already indicated why it is unnecessary to convert long->string->long.
I'm still boggled a bit by the number of people who responded "this is a common idiom" without actually analyzing what was written. It's not that I'm not familiar with why it happens, it's just that so many who reply this way are being paid good money to manage code bases.
"Seize the day" - Horace "It's not what he doesn't know that scares me; it's what he knows for sure that just ain't so!" - Will Rogers, said by him about Herbert Hoover
-
I'm still boggled a bit by the number of people who responded "this is a common idiom" without actually analyzing what was written. It's not that I'm not familiar with why it happens, it's just that so many who reply this way are being paid good money to manage code bases.
"Seize the day" - Horace "It's not what he doesn't know that scares me; it's what he knows for sure that just ain't so!" - Will Rogers, said by him about Herbert Hoover
cpkilekofp wrote:
I'm still boggled a bit by the number of people who responded "this is a common idiom" without actually analyzing what was written.
Good, it's not just me then.