|
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.
|
|
|
|
|
Before a month ago ,i started a project on umbraco cms...
It's totally new for me ...Worried about how will i complete my task...
But finally it's done..
nothing is impossible in this digital world...
eNJOY c0ding....
|
|
|
|
|
This forum is intended for code examples that make you wince or want to punch the author.
Not for random discussions - try the lounge: http://www.codeproject.com/Lounge.aspx[^]
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|
|
As mentioned, this is the wrong forum. However, since this is one of the few times I've seen somebody post about Umbraco here, you may want to check out my article: Umbrazure: Limitless Websites with Umbraco on Azure. Also, I created a thread in case anybody wants to ask me Umbraco questions.
|
|
|
|
|
While converting old FoxPro project to new .NET solution.. This is what I am putting up with...
IF printer_type = 1 then
* ELECTRIC LABEL
IF ALLTRIM(lin_array(2)) = "ENVIRO" then
DO eleclabv4
ELSE
DO eleclabv1
ENDIF
* label form testlab noconsole TO PRINTER
ELSE
IF printer_type = 2 then
* GAS LABEL
DO gaslabv1
ELSE
IF printer_type = 3 then
SET FILTER TO dpl.dpl_part = "50V136G" && need to trick the label printing routine to see 1 record to print .. enamel chain items don't have any records in the datplate (dpl) file, therefore nothing will print if we don't trick the program
DO echnlabv1
ELSE
IF printer_type = 4 then
DO gaslabv2
ELSE
IF printer_type = 5 then
*Sunpro gas
DO gaslabv3
ELSE
IF printer_type = 6 then
*Sunpro electric
DO gaslabv3
ELSE
IF printer_type = 7 then
* Titan
DO eleclabv2
ELSE
IF printer_type = 8 then
* Centaur
DO eleclabv3
ELSE
IF printer_type = 9 then
* GEneric label
DO genlabelele
ELSE
IF printer_type = 10 then
* GEneric label
DO genlabelgas
ELSE
IF printer_type = 11 then
* Revision D Electric label
DO genlabeleleRevD
ELSE
IF printer_type = 12 then
* Revision D Electric label
DO genlabelgasRevD
ELSE
IF printer_type = 13 then
* Revision D Electric label
DO conergyelec
ELSE
IF printer_type = 15 then
* Therman electric label
DO genlabeleleThermann
ELSE
IF printer_type = 16 then
* Therman electric label
DO genlabeleleChina2
ELSE
IF printer_type = 17 then
* H4047 A version label
DO eleclabv5
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
Zen and the art of software maintenance : rm -rf *
Math is like love : a simple idea but it can get complicated.
|
|
|
|
|
Hey, at least they tabbed it in nicely for you!!
|
|
|
|
|
give me the blue pill!!!
you want something inspirational??
|
|
|
|
|
Apparently he had no idea what DO CASE ENDCASE was, unless I'm not reading it right and it really does need to be nested...
|
|
|
|