[Gambas-user] usage of too much GOTO can be bad pracitce or make influence in the code?

PICCORO McKAY Lenz mckaygerhard at ...626...
Thu Jun 22 16:10:21 CEST 2017


2017-06-22 10:00 GMT-04:00 Jussi Lahtinen <jussi.lahtinen at ...626...>:

> Usually the problem with goto is that it can render the code hard to debug
> or read.
>
AH OK, so in large complex dependences must be avoid..

i only use to avoid a similar to this:

if isnull(value ) then
   ' amount of 4000 lines of code

else
   ' amount of other lot of lines
endif

so i put

if not isnull()
  goto codepiecelabel1
endif
  ' amount of lines

codepiecelabel1:
' here the 4000 lines


i cannot use a sub procedures due manage some variables


>
>
> Jussi
>
> On Thu, Jun 22, 2017 at 4:21 PM, PICCORO McKAY Lenz <
> mckaygerhard at ...626...>
> wrote:
>
> > i have some GOTO to avoit large IF-ELSE code blocks and make readable the
> > code..
> >
> > the usage of many GOTO instructions can be bad pracitce or make influence
> > in the code?
> >
> > i remenber that in BASIC always tell me "dont use too much"
> >
> > of course GAMBAS IS NOT BASIC (umm that sound familiarr... ;-)
> >
> >
> > Lenz McKAY Gerardo (PICCORO)
> > http://qgqlochekone.blogspot.com
> > ------------------------------------------------------------
> > ------------------
> > 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
> > Gambas-user at lists.sourceforge.net
> > 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
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list