|
There must be a lot of VB6 code in those darn smoke detectors!
|
|
|
|
|
The developer who made this, should be forced to wear headphones and make his/her program fail constantly for 24 hours...
Seriously, there was a time when computers had an internal speaker, given that this is VB6, i'm not really surprised.
|
|
|
|
|
RafagaX wrote: Seriously, there was a time when computers had an internal speaker
I remember far enough back that the way you made sound on a computer was by controlling the data emitted when saving to cassette (not to be recommended).
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
List<Employee> employees = new List<Employee>();
if (employees != null){
employees = GetEmployees();
}
Previous -> Read "CLR via C#" by Jeffrey Ritcher.
Current -> Exploring WCF thru Apress' "Pro WCF" by Chris Peiris and Dennis Mulder.
Next -> Need to read "The Art of Computer Programming" by Donald E. Knuth.
|
|
|
|
|
Is this inside a single method? I'd be more concerned here with the fact you'd never fill the employees list.
|
|
|
|
|
Quote: Is this inside a single method?
Yes, it is.
Quote: I'd be more concerned here with the fact you'd never fill the employees list.
How??
Previous -> Read "CLR via C#" by Jeffrey Ritcher.
Current -> Exploring WCF thru Apress' "Pro WCF" by Chris Peiris and Dennis Mulder.
Next -> Need to read "The Art of Computer Programming" by Donald E. Knuth.
|
|
|
|
|
Never mind - I've been up for the last 16 hours. I was reading != as == here for some reason.
|
|
|
|
|
Ohh, that's okay...
Previous -> Read "CLR via C#" by Jeffrey Ritcher.
Current -> Exploring WCF thru Apress' "Pro WCF" by Chris Peiris and Dennis Mulder.
Next -> Need to read "The Art of Computer Programming" by Donald E. Knuth.
|
|
|
|
|
Pete O'Hanlon wrote: I was reading != as == here Thanks for the explanation, for a normally sensible person, I was wondering what you were smoking or what I missed with your prior comment too.
|
|
|
|
|
It isn't really filling the list, it's replacing the reference with the result of that method call. I don't think that's what he meant though. A bit pedantic, I'm sorry.
|
|
|
|
|
I think the point was that
List<Employee> employees = GetEmployees();
could just as well have been used to create a null or non-null employees object because the if statement would never be false for a statement that could produce a null result. In fact you might want to execute
if (employees == null) throw...
after executing the above line because now you are in a situation where the if statement could be true or false even if the current coding of the routine would never return null. (speaking of being pedantic...)
|
|
|
|
|
Keeping the runtime on its toes.
|
|
|
|
|
True...
Previous -> Read "CLR via C#" by Jeffrey Ritcher.
Current -> Exploring WCF thru Apress' "Pro WCF" by Chris Peiris and Dennis Mulder.
Next -> Need to read "The Art of Computer Programming" by Donald E. Knuth.
|
|
|
|
|
I hope there's a unit test for that too.
|
|
|
|
|
More like the garbage collector...
|
|
|
|
|
That's a real conundrum for the GC -
"OK, if this object is still around, at this point, I can't GC it until then. But... but what if I ... secretlly GC it before the if?"
|
|
|
|
|
Previous -> Read "CLR via C#" by Jeffrey Ritcher.
Current -> Exploring WCF thru Apress' "Pro WCF" by Chris Peiris and Dennis Mulder.
Next -> Need to read "The Art of Computer Programming" by Donald E. Knuth.
|
|
|
|
|
Guess he don't believe the guys at microsoft!
|
|
|
|
|
Then, he must be a Genius
Previous -> Read "CLR via C#" by Jeffrey Ritcher.
Current -> Exploring WCF thru Apress' "Pro WCF" by Chris Peiris and Dennis Mulder.
Next -> Need to read "The Art of Computer Programming" by Donald E. Knuth.
|
|
|
|
|
Hm. and why even initialize the variable if you're going to assign another value anyway?
|
|
|
|
|
Thanks.
Previous -> Read "CLR via C#" by Jeffrey Ritcher.
Current -> Exploring WCF thru Apress' "Pro WCF" by Chris Peiris and Dennis Mulder.
Next -> Need to read "The Art of Computer Programming" by Donald E. Knuth.
|
|
|
|
|
And what is the " = new List<employee>()" doing there, either? Assign it one value, then if it isn't null, which it can't be, immediately assign it another value and discard the first object? Goofy.
|
|
|
|
|
Thanks for raising this point.
Previous -> Read "CLR via C#" by Jeffrey Ritcher.
Current -> Exploring WCF thru Apress' "Pro WCF" by Chris Peiris and Dennis Mulder.
Next -> Need to read "The Art of Computer Programming" by Donald E. Knuth.
|
|
|
|
|
|