Post Reply 
New third party firmware (Not HP'PRIME TEAM)
01-06-2016, 05:28 AM
Post: #31
RE: New third party firmware (Not HP'PRIME TEAM)
Hello

>Abuse of goto should be avoided, but it is sometimes much better to have a
>goto than complicated booleans that are required if goto are avoided.
>This is especially true for "implicit" gotos inside loops like break and continue

I use got every once in a while.

The numerical solver has a bunch of them because it was lifted verbatim from the HP48 code which is full of them, and I was unable to extract a clear structure.

An other use of goto is to exit a function in case of error when you have a number of finalization to do.

But, by far the most frequent use of goto is to exit a double (or more) deep loop. This happens all the time and is VERY frustrating to me.

This is why, in PPL, you can do break n; or continue n; (where n is an integer), which allows to break out of n level of loops. This reduces the number of legitimate goto use by at least 90%!

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: New third party firmware (Not HP'PRIME TEAM) - cyrille de brébisson - 01-06-2016 05:28 AM



User(s) browsing this thread: 1 Guest(s)