![]() |
| | #46 | |
| Banned Join Date: Aug 2001 Location: Visalia, CA, USA
Posts: 3,699
| Quote:
| |
| master5001 is offline |
| | #47 |
| +++ OK NO CARRIER Join Date: Oct 2001
Posts: 10,262
| For an accurate test, you really should use identical loops. Furthermore, you need to make sure in each case you end up testing for the same exact thing. Without it, the test is hardly accurate. IE: Just because you write code to use the word 'continue' doesn't mean you're using the same number of checks. [edit] To reply to the above post, no, it wasn't directly specificly at you. It was more of an "in general" observation of these types of threads. They in the just end up as threads where one person argues their point, another argues theirs, and neither one will ever convince the other because in some situations, there is no real "right way". That's mainly what that comment was about. [/edit] Quzah.
__________________ Hundreds of thousands of dipshits can't be wrong. Are you up for the suck? Last edited by quzah; 12-09-2002 at 04:24 PM. |
| quzah is offline |
| | #48 | |
| +++ OK NO CARRIER Join Date: Oct 2001
Posts: 10,262
| Quote:
As for the comment regarding checks, if you look at the provided code, you'll notice that the "for" loops are different on two or three of the checks. Additionally, they end up checking for different values. If you're trying to compare one method versus another, your tests should be as near identical as possible. That's the point. (Look at the attached .c file, you'll see what I'm talking about.) It's unfair to compare tests if the tests themselves do not have the same standards or criteria. Quzah.
__________________ Hundreds of thousands of dipshits can't be wrong. Are you up for the suck? | |
| quzah is offline |
| | #49 |
| Banned Join Date: Aug 2001 Location: Visalia, CA, USA
Posts: 3,699
| Preach on Quzah! And that is the bottom line. My tests merely show that using continue is faster sometimes, but a program doesn't always call for it. Also, there are a number of other optimizations that can be made before using break or continue. My point was not to show that you need to use break to make a fast loop, rather, my point was to show an example of where a break statement is best. |
| master5001 is offline |
| | #50 | |
| ~- Y u n a -~ Join Date: Dec 2001
Posts: 291
| Quote:
__________________ [ S ] Digital Design : Superiority "design" Style | |
| beely is offline |
| | #51 | |
| ~- Y u n a -~ Join Date: Dec 2001
Posts: 291
| Quote:
&& shouldn't hardly disturb on the exe time. i just add a variable to control it. am i right ?
__________________ [ S ] Digital Design : Superiority "design" Style | |
| beely is offline |
| | #52 |
| ~- Y u n a -~ Join Date: Dec 2001
Posts: 291
| another point is... :: a good structure on program that made by the programmer usually follow on flowchart. most of the book, said that "break, goto, continue " is not recommended to place it on the program -- it's bad structure, you may find the the prove from : - -- c how to program (deitel) -- approch using c structure -- how to design in c i'm not argue that "break, goto, continue" is can't used it among others. everybody have freedom to choose which one is better. but i would prefer for my own design by adding another variable and control to loop, that's all. hope you dont mind on my comment.
__________________ [ S ] Digital Design : Superiority "design" Style |
| beely is offline |
| | #53 |
| Visionary Philosopher Join Date: Aug 2002
Posts: 212
| Actually, "continue" is convenient to use, for example, in a for:next loop, when you want the loop to iterate again without executing some additional code within the loop. As for 'goto', the primary reason to use goto is for peformance. In many cases you can eliminate a test entirely or have an algorithm be much tighter and more direct by judicious use of a goto. There is nothing wrong with either one. To say you should never use either one is like telling someone they should never pick their nose because it looks uncouth. Well I'm sorry, but there _is_ an appropriate time to pick your nose. Period. End of Discussion. [rant = on] I just wish a portion of people on this board would spend a little more time actually getting concepts and understanding what is going on in the machine, as opposed to getting hung up on truly pointless hyperbole. I watch too many people get "lost" on syntactic, grammatic, and "purist" issues, and they never actually get to concentrate on what's important: implementing _logic_. Because that's what development is really about-- implementing logic in software.
__________________ It is not the spoon that bends, it is you who bends around the spoon. |
| Sayeh is offline |
| | #54 |
| ~- Y u n a -~ Join Date: Dec 2001
Posts: 291
| well... sayeh, depend on it. what you prefer on is depend on situation. i did tell this URL to my friends, you know one of my friend (expert in c program) did say ? " .... depend on situation what type of program, i would rather choose your way (that's mean he agree on my program with adding && and variable) than using "break' because that kind of program is bad structure...." 2 of c program lecture did say... " .... break's bad structure, avoid using it .... " ok there guys, that's all about end of thread , and thanks for getting this challenging posted. wishing this thread will closed anyway. :: depend on what you prefer to use, may use own style ::
__________________ [ S ] Digital Design : Superiority "design" Style |
| beely is offline |
| | #55 |
| Registered User Join Date: Oct 2002
Posts: 46
| No point in arguing any more... Some people drank the cool-aid and some people didn't. |
| rafe is offline |
| | #56 |
| ~- Y u n a -~ Join Date: Dec 2001
Posts: 291
| yeah, every ppl have diff mind and ideals , right no wonder there's will conflict with other co-worker on their project programming. LOL
__________________ [ S ] Digital Design : Superiority "design" Style |
| beely is offline |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Wiki FAQ | dwks | General Discussions | 192 | 04-29-2008 01:17 PM |
| Help with FAQ | JoshG | Game Programming | 19 | 10-29-2002 07:31 PM |
| FAQ Check/Lock | RoD | A Brief History of Cprogramming.com | 2 | 10-15-2002 11:21 AM |