Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 too many variables?
Index -> Programming, Turing -> Turing Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Albrecd




PostPosted: Mon Nov 14, 2005 12:47 pm   Post subject: (No subject)

Quote:
yeah but array are more efficient


Unless you don't know about arrays, in which case it would take far less time and effort to stop worrying about arrays and just use the 10 variables.
Sponsor
Sponsor
Sponsor
sponsor
do_pete




PostPosted: Mon Nov 14, 2005 1:01 pm   Post subject: (No subject)

if you don't know how to use arrays you won't get to far in programming
wtd




PostPosted: Mon Nov 14, 2005 1:22 pm   Post subject: (No subject)

Albrecd wrote:
Quote:
yeah but array are more efficient


Unless you don't know about arrays, in which case it would take far less time and effort to stop worrying about arrays and just use the 10 variables.


Programming concepts are like tools in a toolbox.

"It'll take too long to learn how to use this fancy ratcheting wrench. I'll just use a standard wrench."

It doesn't take long before the time saved by learning better ways to do things pays for itself.
codemage




PostPosted: Mon Nov 14, 2005 1:31 pm   Post subject: (No subject)

Even if you have the "tools", there's a fuzzy area (for me, it's usually in the area of 3ish related variables) where using arrays vs. independent variables are worthwhile.

No sense bludgeoning yourself with a bunch of for loops (for stepping through arrays) when you can do without.

For 10 variables though, we're definitely in the area where arrays make the code cleaner & more readable. Use the "tool." It's free.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 19 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: