|
This one gave me a good laugh:
if (index == 1 || 2)
{
...bla
}
The guy was probably on the phone while writing it.
Company policy : no access to the internet but CP
~RaGE()
|
|
|
|
|
Another reason to like C#
Perhaps also another argument for the fans of
if ( 1 == index ) { ... }
|
|
|
|
|
When I was a noob programmer I would do things like that.
if (index == 1 || index == 2)
...
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
I think that's easier to read, and less ambiguous than this since you don't have to wonder if the equals was intended or a strict less than was actually wanted.
if ((1 <= index) && (index <= 2))
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
am i losing it?
what's wrong with that?
Russell
|
|
|
|
|
You just have to be careful sometimes because some bizarre languages and/or compilers might have different precedence. I'm guessing that's what he means, to be safe I for one always put in the braces just to make sure it's doing what I want and not what it wants.
|
|
|
|
|
My example was the corrected version.
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
hence the full stop at the end of the sentence not a colon. I should check english syntax aswell as code.
Thanks for the response.
Russ
|
|
|
|
|
|
|
I saw this[^] article at thedailywtf.com and it reminded me of something.
I was reproducing a web page's functionality in a web service and in doing so had to see some error messages. One of them was along the lines of "Your request not is having some information that is required, please see a representative".
This is for an official site for an important agency so many people would have seen this throughout the years and all because someone didnt check over a non-native English speaker's work.
I've worked with a few non-native English with some projects and this seems to be an issue on many projects whether it be button names = "cancel Btton" to crazy English errors. This is not necessarily a stab at someone without a perfect grasp of the language but there needs to be better QA processes in place to catch these things.
-- modified at 15:46 Thursday 15th March, 2007
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
I agree entirely. There's not enough proofreading/editing on interfaces of any description (web site, application, etc). Mind you, I am biased since my wife is a proofreader and we offer this service to all of our clients.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
The sad part about this instance is that none of the users ever said anything.
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy) "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
CleaKO wrote: The sad part about this instance is that none of the users ever said anything
Doesn't that just tell you everything you need to know about users?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: CleaKO wrote:
The sad part about this instance is that none of the users ever said anything
Doesn't that just tell you everything you need to know about users?
Pete, CleaKO may i use the above as a sig?
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
Help yourself mate.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
That's fine with me.
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy) "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
Thank you. my CP sigs been overdue for a change and my current email one's probably too incendiary to use outside of the soapbox.
--
CleaKO The sad part about this instance is that none of the users ever said anything [about the problem].
Pete O`Hanlon Doesn't that just tell you everything you need to know about users?
|
|
|
|
|
Like the sig.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
stumbled over this code while maintaining some script for an installer :
if ( SomeCondition ) then
...
else
if ( SomeCondition ) then
...
else
if ( SomeCondition ) then
...
else
if ( SomeCondition ) then
...
else
if ( SomeCondition ) then
...
else
if ( SomeCondition ) then
...
else
if ( SomeCondition ) then
...
else
if ( SomeCondition ) then
...
else
if ( SomeCondition ) then
...
else
if ( SomeCondition ) then
...
endif;
endif;
endif;
endif;
endif;
endif;
endif;
endif;
endif;
endif;
i guess it didn't occur to the fellow who wrote it to use elseif or switch/case
|
|
|
|
|
does the script language support switch/case ?
|
|
|
|
|
yep...in fact I've already replaced it with switch/case ...
|
|
|
|
|
Chris Losinger wrote: does the script language support switch/case ?
Good one!!
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
IIRC there was an early version of InstallShield's scripting language which didn't have else if, so you were lumbered with this kind of thing. No switches either.
But in your case you say the language does support else if, so no excuse. But could this be an old InstallShield script that hasn't been updated as the language features have moved on?
Kevin
|
|
|
|
|
well it was written from scratch on a script version that did support elseif/switch-case, but i guess if the guy/gal was used to working on an old version that didn't support it, could be they thought the new one didn't either...
prolonged InstallShield usage does also have the capability to pretty much kill the any enthusiasm for development inside you...maybe he/she was just fed up!;P
|
|
|
|