[Gambas-user] Better use of prefixes

Jussi Lahtinen jussi.lahtinen at gmail.com
Sun Mar 17 16:41:58 CET 2019


> You can't rely on your source code being viewed in an IDE.  For instance,
> when you post it to a site, email it to someone, etc.
>
...

> The same is true for syntax coloring, nice, but you shouldn't rely on it
> for readability.
>

Of course you should rely on that. There is absolutely no good reason to
separate any RAD language from its IDE (or compatible IDE).
Only very trivial code is ever viewed outside of IDE. And even then the
source code should be posted as archive, if it is meant to be executed.


This FMain.class is a test cradle for the objects.  Set up to show that you
> can make many of the objects, but you only need one to test if it works.
>

Very bad programming habit. These should be in separated unit tests or they
shouldn't exist at all.



> I explained in my lengthy reply where the prefixes came from.
>

Exactly.



> ... it also makes your code more similar to natural language.  You can't
> see a benefit in that?
>

I don't see the benefit in your convention. However long descriptive
variable names generally do that, but sometimes it is not beneficial for
the readability (in complex lines).
Programming is fundamentally different from natural languages and thus the
similarity on surface doesn't always convey benefits.



> For a form control, I would much rather see TemperatureScrollBar than
> scbTemp.


scbTemp has the same information, but in much more concise way. So, if
there are long lines I would strongly prefer "scbTemp", otherwise I don't
mind at all.


Jussi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190317/79acc033/attachment.html>


More information about the User mailing list