Re: usage of too much GOTO can be bad pracitce ?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: usage of too much GOTO can be bad pracitce ?

Nigel Verity
I don't believe the use of GOTO is bad practice in terms of the efficiency and performance of the program, but its convenience often leads to lazy "spaghetti" code design which, in turn, usually leads to bugs.


The use of RETURN is a much tidier way of breaking out of a SUB or FUNCTION, which has the effect of "GOTO END OF SUB/FUNCTION". It will then take you to the next line in the SUB/FUNCTION which made the call.


It is always possible to write and position IF, SWITCH statements or loops in a way to avoid the need for a GOTO statement. The code following the corresponding label could, for example, be contained in a separate SUB or FUNCTION, which makes the code tidier and makes it easily reusable within the program.


I certainly would not say that programmer who uses lots of GOTO statements is a bad programmer (as long as the program works correctly and efficiently) but I believe that few developers would choose to maintain code written by somebody else containing lots of GOTO statements.


It's important to stress that this principle is not unique to Gambas. Nearly all programming languages support the concept of the "GOTO" (even C), and VB actively encourages it in its error handling, which is why Gambas is so superior.


Nige
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: usage of too much GOTO can be bad pracitce ?

PICCORO McKAY Lenz
niger, please when edited the Subject mantain the original suject..

if users want to automatically response in conversatin any mail from
gambas, please disable digest mode and use dary mode..

each mail will coming separatelly this its very usefully for gmail like
inbos where each mail are in-conversation mode...

for separing mails use labels..

Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

2017-06-25 8:43 GMT-04:00 Nigel Verity <[hidden email]>:

> I don't believe the use of GOTO is bad practice in terms of the efficiency
> and performance of the program, but its convenience often leads to lazy
> "spaghetti" code design which, in turn, usually leads to bugs.
>
>
> The use of RETURN is a much tidier way of breaking out of a SUB or
> FUNCTION, which has the effect of "GOTO END OF SUB/FUNCTION". It will then
> take you to the next line in the SUB/FUNCTION which made the call.
>
>
> It is always possible to write and position IF, SWITCH statements or loops
> in a way to avoid the need for a GOTO statement. The code following the
> corresponding label could, for example, be contained in a separate SUB or
> FUNCTION, which makes the code tidier and makes it easily reusable within
> the program.
>
>
> I certainly would not say that programmer who uses lots of GOTO statements
> is a bad programmer (as long as the program works correctly and
> efficiently) but I believe that few developers would choose to maintain
> code written by somebody else containing lots of GOTO statements.
>
>
> It's important to stress that this principle is not unique to Gambas.
> Nearly all programming languages support the concept of the "GOTO" (even
> C), and VB actively encourages it in its error handling, which is why
> Gambas is so superior.
>
>
> Nige
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: usage of too much GOTO can be bad pracitce ?

T Lee Davidson
Lenz McKAY Gerardo,

Please check your spelling before posting a message to the list.

Most email clients have a built-in spell checker. And, it just might help us better understand what you are saying, especially
given that English is obviously not your first language.

Thanks.


--
Lee

On 06/25/2017 09:15 AM, PICCORO McKAY Lenz wrote:

> niger, please when edited the Subject *mantain* the original *suject*..
>
> if users want to automatically response in *conversatin* any mail from
> gambas, please disable digest mode and use *dary* mode..
>
> each mail will coming *separatelly* this its very usefully for gmail like
> *inbos* where each mail are in-conversation mode...
>
> for *separing* mails use labels..
>
> Lenz McKAY Gerardo (PICCORO)
> http://qgqlochekone.blogspot.com
[emphasis added]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: usage of too much GOTO can be bad pracitce ?

PICCORO McKAY Lenz
hi T, as example in my client mail, i cannot understand the "*" in the
words.. only due i alredy know that are markdown similar.. are emphasis---

due i used console program never check the spell, its my faul.. sorry i
always got a Scolding by that--

got corrected but when take me too many time.. prefer send inmmediatelly..
some info sometimes need to have as soon as possible..

Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

2017-06-25 11:53 GMT-04:30 T Lee Davidson <[hidden email]>:

> Lenz McKAY Gerardo,
>
> Please check your spelling before posting a message to the list.
>
> Most email clients have a built-in spell checker. And, it just might help
> us better understand what you are saying, especially given that English is
> obviously not your first language.
>
> Thanks.
>
>
> --
> Lee
>
> On 06/25/2017 09:15 AM, PICCORO McKAY Lenz wrote:
>
>> niger, please when edited the Subject *mantain* the original *suject*..
>>
>> if users want to automatically response in *conversatin* any mail from
>> gambas, please disable digest mode and use *dary* mode..
>>
>> each mail will coming *separatelly* this its very usefully for gmail like
>> *inbos* where each mail are in-conversation mode...
>>
>> for *separing* mails use labels..
>>
>> Lenz McKAY Gerardo (PICCORO)
>> http://qgqlochekone.blogspot.com
>>
> [emphasis added]
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Loading...