[Gambas-user] Is the &= efficient?

Rolf-Werner Eilert rwe-sse at osnanet.de
Thu Mar 7 09:11:18 CET 2019


Am 05.03.19 um 22:03 schrieb Cedron Dawg:
> A little thinking helps.  I'm going with alloc/memory/free, because I have an idea how much space I will need.
> 
> Having +=, -=, *=, etc is a huge plus for me compared to other BASICs.

Oh :) I didn't realize they are there, should have a look in the docs 
more often... Up to now, I have used += and &= only.

> 
> Open question (also asked at forum.gambas.one) to all.
> 
> Do you prefer
> 
> Inc x
> Dec x
> 
> or
> 
> x += 1
> x -= 1
> 
> ?
> 

If it's only "1", I prefer Inc and Dec. But there is no "Inc x, 3" or 
"Inc(3) x" for instance, so I am forced to use +=.

And last but not least, if there are more of these standing 
line-by-line, I would prefer += even for "1" to make it more clearly 
readable (for the reason above).

Regards
Rolf


More information about the User mailing list