It's duplicated, too lazy to fix.
-
'i've added that, although duplication of process (because im loading stuff)
' lets see
Select Case ListIT
Case 1: nList = oArti.List1
Case 2: nList = oArti.List2
Case 3: nList = oArti.List3
Case 4: nList = oArti.List4
Case 5: nList = oArti.List5
Case 6: nList = oArti.List6
Case 7: nList = oArti.List7
Case 8: nList = oArti.List8
Case 9: nList = oArti.List9
Case Else
'in theory, it should never came here
nList = 1
End SelectI think, array is a vulgar word for someone. Funny thing, I didn't understood what in the name of lord does that (variables were not descriptive about content they have) Also, funny comments! :laugh: (code was originally written in spanish)
-
'i've added that, although duplication of process (because im loading stuff)
' lets see
Select Case ListIT
Case 1: nList = oArti.List1
Case 2: nList = oArti.List2
Case 3: nList = oArti.List3
Case 4: nList = oArti.List4
Case 5: nList = oArti.List5
Case 6: nList = oArti.List6
Case 7: nList = oArti.List7
Case 8: nList = oArti.List8
Case 9: nList = oArti.List9
Case Else
'in theory, it should never came here
nList = 1
End SelectI think, array is a vulgar word for someone. Funny thing, I didn't understood what in the name of lord does that (variables were not descriptive about content they have) Also, funny comments! :laugh: (code was originally written in spanish)
CocusArg wrote:
'in theory, it should never came here
I've learned that placing such a comment will make your code go to any lengths (apparently even changing variable values out-of-the-blue) to take that path... Also, speaking of funny comments, my colleague found this little gem in a PHP script:
//Do this the old-fashioned way, i don't trust PHP's 'i++'
$i = $i + 1;Full-fledged Java/.NET lover, full-fledged PHP hater. Full-fledged Google/Microsoft lover, full-fledged Apple hater. Full-fledged Skype lover, full-fledged YM hater.
-
CocusArg wrote:
'in theory, it should never came here
I've learned that placing such a comment will make your code go to any lengths (apparently even changing variable values out-of-the-blue) to take that path... Also, speaking of funny comments, my colleague found this little gem in a PHP script:
//Do this the old-fashioned way, i don't trust PHP's 'i++'
$i = $i + 1;Full-fledged Java/.NET lover, full-fledged PHP hater. Full-fledged Google/Microsoft lover, full-fledged Apple hater. Full-fledged Skype lover, full-fledged YM hater.
-
What do you have against PHP? It's soooo easy to learn and it has been used for soooo many big projects.
At least artificial intelligence already is superior to natural stupidity
Yes, and at the same time, it makes it awwwwwwfully easy to code badly. You can code badly in absolutely any language, but bad code written in PHP just.has.that.special.flavor. [rant start] Now, assume we have some code (PHP) along the lines of:
$invoice_no = 1;
//some code
//Then someone comes who does not read docs, or has no idea that invoice_no should be an int, and does something with the following effect:
$invoice_no = $invoice_no . 'INV_123#';//Some other code
return $invoice_no;Now, try to do this in Java for instance:
int invoice_no = 1;
invoice_no = invoice_no + "INV_123#";
return invoice_no;The compiler would be all over the place, screaming like a newborn baby. And that's just off the top of my head. And speaking of compiler and autocomplete, how about contructs like:
$invoice_no = 'Whatever';
//Code
return $invoiceno; //first occurrence of $invoiceno, the IDE doesn't complain about it, is undefined, but you sucker will only know at runtime, from a !!!Notice!!!
Or that you can't really enforce a type parameter on a method (of course, there's get_class, but you'll only know about it at runtime). Or autocomplete. I'a big fan of autocomplete. Now, I've done PHP with both Eclipse and Netbeans. Try to get autocomplete for something like:
$db = DatabaseService::getInstance();
$line = $db->getPoLineById($line_id);
$product = $db->searchProduct('id', $line->getProductId()); //This is where the magic ends. No autocomplete for 'line->'Or debugging. var_dump, really? Now, I know there's XDebug, but try using that in a 4GB PHP project (I'm talking about a Magento website). Good luck with that. [rant end] Now, I do believe your remark was sarcastic. For being sarcastically funny, have a 5! :laugh:
Full-fledged Java/.NET lover, full-fledged PHP hater. Full-fledged Google/Microsoft lover, full-fledged Apple hater. Full-fledged Skype lover, full-fledged YM hater.
-
Yes, and at the same time, it makes it awwwwwwfully easy to code badly. You can code badly in absolutely any language, but bad code written in PHP just.has.that.special.flavor. [rant start] Now, assume we have some code (PHP) along the lines of:
$invoice_no = 1;
//some code
//Then someone comes who does not read docs, or has no idea that invoice_no should be an int, and does something with the following effect:
$invoice_no = $invoice_no . 'INV_123#';//Some other code
return $invoice_no;Now, try to do this in Java for instance:
int invoice_no = 1;
invoice_no = invoice_no + "INV_123#";
return invoice_no;The compiler would be all over the place, screaming like a newborn baby. And that's just off the top of my head. And speaking of compiler and autocomplete, how about contructs like:
$invoice_no = 'Whatever';
//Code
return $invoiceno; //first occurrence of $invoiceno, the IDE doesn't complain about it, is undefined, but you sucker will only know at runtime, from a !!!Notice!!!
Or that you can't really enforce a type parameter on a method (of course, there's get_class, but you'll only know about it at runtime). Or autocomplete. I'a big fan of autocomplete. Now, I've done PHP with both Eclipse and Netbeans. Try to get autocomplete for something like:
$db = DatabaseService::getInstance();
$line = $db->getPoLineById($line_id);
$product = $db->searchProduct('id', $line->getProductId()); //This is where the magic ends. No autocomplete for 'line->'Or debugging. var_dump, really? Now, I know there's XDebug, but try using that in a 4GB PHP project (I'm talking about a Magento website). Good luck with that. [rant end] Now, I do believe your remark was sarcastic. For being sarcastically funny, have a 5! :laugh:
Full-fledged Java/.NET lover, full-fledged PHP hater. Full-fledged Google/Microsoft lover, full-fledged Apple hater. Full-fledged Skype lover, full-fledged YM hater.
Andrei Straut wrote:
Now, I do believe your remark was sarcastic
Thanks. Indeed I don't jump off bridges just because it's especially easy on this particular bridge or many people have done so before. Not even the lemmings really do that. :) I have started to ignore languages which are interpreted or are advertised as being especially noob-friendly on 8 bit machines. Especially the 'noob-unfriendly' things (like type safety) usually are supposed to help you and I have no interest in learning how to bypass them or constantly discussing why it's a bad idea to bypass them.
At least artificial intelligence already is superior to natural stupidity
-
Andrei Straut wrote:
Now, I do believe your remark was sarcastic
Thanks. Indeed I don't jump off bridges just because it's especially easy on this particular bridge or many people have done so before. Not even the lemmings really do that. :) I have started to ignore languages which are interpreted or are advertised as being especially noob-friendly on 8 bit machines. Especially the 'noob-unfriendly' things (like type safety) usually are supposed to help you and I have no interest in learning how to bypass them or constantly discussing why it's a bad idea to bypass them.
At least artificial intelligence already is superior to natural stupidity
CDP1802 wrote:
Especially the 'noob-unfriendly' things (like type safety) usually are supposed to help you and I have no interest in learning how to bypass them
So true. Now, please do go and convince everyone of this. :laugh:
Full-fledged Java/.NET lover, full-fledged PHP hater. Full-fledged Google/Microsoft lover, full-fledged Apple hater. Full-fledged Skype lover, full-fledged YM hater.
-
CDP1802 wrote:
Especially the 'noob-unfriendly' things (like type safety) usually are supposed to help you and I have no interest in learning how to bypass them
So true. Now, please do go and convince everyone of this. :laugh:
Full-fledged Java/.NET lover, full-fledged PHP hater. Full-fledged Google/Microsoft lover, full-fledged Apple hater. Full-fledged Skype lover, full-fledged YM hater.