[Gambas-user] variable declaration everywhere ???

David Sanromá dsanroma at gmail.com
Tue Dec 11 23:26:35 CET 2018


Hello,


I don't mean to start a war ;) but there are cases where it makes 
perfect sense to declare within code:


For I As Integer=1 To 10

Next


Makes it very easy to move the code around to another function and/or 
re-factor. You just worry abut the piece of code. You take the 
declaration with you


Just an idea ;)

David






El 11/12/18 a las 21:49, Jussi Lahtinen escribió:
> Why?
> It's exactly the same code, but in different place. For me personally, 
> it doesn't matter at all.
>
>
> Jussi
>
> On Tue, Dec 11, 2018 at 7:01 PM Gianluigi <bagonergi at gmail.com 
> <mailto:bagonergi at gmail.com>> wrote:
>
>
>
>     Il giorno mar 11 dic 2018 alle ore 09:34 Fabien Bodard
>     <gambas.fr at gmail.com <mailto:gambas.fr at gmail.com>> ha scritto:
>
>         Allow local variable declaration anywhere in the function. The
>         local
>         symbol still has a function scope, but can be used after its
>         declaration only.
>
>         hum....
>
>         and now ?
>
>         {Integer}MyVar = 1+1 ?
>
>         :-P
>
>
>         -- 
>         Fabien Bodard
>
>
>     It is like in other languages, I personally do not like it because
>     it makes more difficult to understand the code of others. :-(
>
>     Regards
>     Gianluigi
>
>     ----[ Gambas mailing-list is hosted by https://www.hostsharing.net
>     ]----
>
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20181211/39edf521/attachment-0001.html>


More information about the User mailing list