6/18/2023 0 Comments Purebasic goto![]() ![]() Programming will then be a religion with no other purpose except the endless, pointless and ultimately unattainable search for perfection. I suspect that at some point in the future someone (prob MS) will come up with a design methodology and language that, for the average person, will take more than a useful lifetime to become "proficient" in. OOP is a definate for large projects but I think it has been oversold for small and medium projects. As for specific languages I think it's very much a horse-for-courses thing, each has it's place. Still, I *do* think intentional avoidance of "goto" generally leads to better design methodology (skills, approach, call it what you want) but this does not imply the pathalogical avoidance that some programmers and language designers subscribe to. I would add that if "goto" was such a no-no then CPU's would have already undergone a radical redesign, which they haven't. I even thought I was reading something I wrote. Seriously, I'm in agreement almost 99.99% So close it's scary. Is that an invitation for constructive criticism? Believe what you will, but please stay out of my face. Heck, some purist argue that the only proper way to program is in assembler, and others argue you cannot write a decent program unless you write it with C/C++, and others abhor the reliance on Windows and insist that we will not have a programmer's paradice until Linux or Unix dominates everywhere. If a GoTo will do it, the go for it, and forget the so-call purists that presume to lecture the rest of us on how the job should be done. All I did was stroke my own ego by "upgrading" his code to my level, but that was a waste of my time, and totally unnecessary. It took me years to realize that there was a certain elegance and simplicity to his approach, and that I was not near as good as I had believed I was. I used over 97% of the instruction set, and while I had the presumption of rewriting some of his code to make it more concise, I could not improve on his approaches or algorythms. The best programmer I ever knew used only about 15% of the available commands, but he wrote some fantastic programs that pushed the envelope all over the place. Don't waste your time trying to come up with some other method and convoluting your code in some meaningless or ineffectial manner just to satisfy someone that hasn't the wisdom to reason this out for themselves. Pushing the envelope would not include listening to anyone who repeats "Don't ever use GoTo statements in your programs, it is a bad practice!" If the circumstances warrants using a GoTo, then do it. A great programmer is one that can do it on time, under budget, and push the envelope in the process. A good programmer is one that achieves his or her objectives, no matter the means or method. The observation was flawed, the circumstances are entirely different in a modern compiler, and the determination of what is "good" and "bad" in terms of programming practice is a rediculous on the face of it. It became a mantra that the best programmers would never use a GoTo command. Several people took it as a mission to show how you would write "good" code that avoided the use of the "bad" GoTo command. Jump to the wrong place, in or out of a For/Next loop, and you could misconstrue the contents of the stack and cause a catastrophic failure to your program. One of the problems was that in Interpretive code, some loop structures, particularly the For/Next loop and the associated variable, were carried on the stack. ![]() The problem sometimes arrises of having the code merge again so that you can continue to carry out common processes.Ī dispute arrose some years ago about whether GoTo statements were a good way to bring about this merge effort or not. random number and to call this function again until a uniqueīranching code allows you to create different methods for dealing with variances. the Repeat/Until loop continues to create a new function terminates early, without declaring do_over = 1 If the random number matches a number used already, the ![]() This is where I got my "GOTO" equivalent. Note my use of Repeat commands nestled in the function as a It calls a function that is found at the end of the program. This is the part that creates a random number The ".b" tells the program what type of array it will be - I won't need to type it again. Because I know that I will only be useing 94 numbers, I've used a. Code: Select all Arrays may not be declared on the fly, but must be declared before they are called. ![]()
0 Comments
Leave a Reply. |