|
The same thing I told him when I saw this first time.
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.
|
|
|
|
|
Looks like a newbie whose prof in 101 programming hammered down checking objects before using them. This would be sensible if it were a thousand lines down in the code, but, if it is null where is the property/method to new it up?
|
|
|
|
|
Well, he is 4 yrs exp.....
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.
|
|
|
|
|
Mohammed Hameed wrote: Well, he is 4 yrs exp.... So, he IS inexperienced! (I started coding in '74. Late start, '05 on C#.)
|
|
|
|
|
Ohh, is that?
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.
|
|
|
|
|
it could make sense if it was a code update...
let say it was like:
List<Employee> employees = GetEmployessFromSucursal(sucursalID);
if (employees != null){
employees = GetEmployees();//Get employes from other source
}
then for some reason the code was updated or copy&paste... there is also a proba that the IF used to have some other parameter and an ELSE... so again code that was not finally updated to the best final form.
|
|
|
|
|
Thanks.
My Reading-o-Meter
Previous -> Read "CLR via C#" by Jeffrey Richter.
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.
My blog - My recent article
|
|
|
|
|
Now a smart compiler should probably want about this. Something like when comparing signed and unsigned int's in C and it warns that the statement is always true (or false) due to conversion rules.
Seems like maybe (I know.. "maybe?!?!") a programmer that didn't know what they're doing. That you have to first "create" the list, so you can "fill it in" with the GetEmployees() values or something. Along the same lines as novice programmers that create and assign a local number (or string) variable with a constant value because the function was prototyped with that data type, rather than pass the same constant number inline to the call.
Could be worse.. I've seen this in [employed to write] software:
#define ZERO 0
#define ONE 1
#define TWO 2
|
|
|
|
|
Thanks.
My Reading-o-Meter
Previous -> Read "CLR via C#" by Jeffrey Richter.
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.
My blog - My recent article
|
|
|
|
|
Just noticed a typo I made.. It should have said:
"Now a smart compiler should probably warn about this."
I guess spell check doesn't catch everything.
|
|
|
|
|
Another gem from the VB6 app I'm in the process of replacing. In production code no less.
SQL = "select policyid, policynumber, covdate"
MsgBox SQL
RS.Open SQL, con, adOpenStatic
My guess is this was a diagnostic message someone neglected to remove. The SQL statement is
quite long (involving a few joins).
Must be quite intimidating for users.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
If only WTFs could be used as an energy source - the VB6 and PHP legacy code out there could fuel us until entropy.
|
|
|
|
|
Sadly true!
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
Oh, a sweet quote for sure. Just replace with your topic of choice...
Charlie Gilley
<italic>You're going to tell me what I want to know, or I'm going to beat you to death in your own house.
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
Parameterised and reusable!
|
|
|
|
|
How about the extra points for the numpty who did this in server side code? System hung, grrr, over to data centre, into server room, find the box, see message, scream "E****! You Elephant Seamstress's Child!"
Reality is an illusion caused by a lack of alcohol
"Nagy, you have won the internets." - Keith Barrow
|
|
|
|
|
Luckily, that is not server side.
Unluckily it is VB6.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
You know what? Just read this, then turned the head around. My colleague behind me has a XP box with a VB6 project open.. (true story)
The signature is in building process.. Please wait...
|
|
|
|
|
Don't leap to assumptions - I also have a VB6 project open, but only because I've been tasked with updating it to C#.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
The problem is: we can't update it. First it's a very large project, seondly the end-user machine does not have and never will have (old box) .NET installed. It has to be that machine due to hardware (scanner, other devices)
The signature is in building process.. Please wait...
|
|
|
|
|
We also have some old legacy projects which need maintenance from time to time. However the gain of updating them to .NET would probably never justify the costs involved.
|
|
|
|
|
The project we have basically produces forms (word docs printed), each one of the form has one or more input masks. Actually over 200. These docs are not allowed to be saved, therefore the application.
The signature is in building process.. Please wait...
|
|
|
|
|
Could this sentence be one of those which could be my last:
"Whats wrong with VB6?"
|
|
|
|
|
It was fine for a product of its time, but is flawed compared to modern languages, for a whole variety of reasons.
Wikipedia (VB on Wiki[^] mentions some of its shortcomings, but actually its not as bad as its reputation - it largely suffered from being easy to hack in, so a lot of VB6 programs have appalling design and plenty of moments that make your jaw drop. It really is truly awful at string-handling though - appending to a string would generally reallocate the whole thing, copy, then append. I came a across apps that frequently added 10-20 characters to a 10MB string, which would grind to halt due to this.
It should absolutely not be used for any new projects, and existing code should be ported to alternatives now though - Microsoft dropped support a while ago, it will now only work (the IDE) on an XP machine (or VM), and there is no guarantee that the runtime will run on new versions of Windows.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
Thanks for clarification. I was in false impression that "VB" would be also referring to VB.NET but now I see VB.NET is just another compiler for .Net framework and is far from same thing as VB. Then there is VBA which I often confuse with too.
Although VBA is something I have to use sometimes when some Excel-crazy person begs me do something within excel which seems only possible with VBA, then I get to tackle some hundred-sheet workbook with thousands character long cell functions.
|
|
|
|