<div dir="ltr"><div dir="ltr"><div dir="ltr"><a href="http://gambaswiki.org/wiki/doc/namingconvention?ht=prefix">http://gambaswiki.org/wiki/doc/namingconvention?ht=prefix</a><br><a href="http://gambaswiki.org/wiki/doc/naming">http://gambaswiki.org/wiki/doc/naming</a><br>I try to follow these conventions and I'm happy if others do, so the code is more readable.<br><br>Regards<br>Gianluigi<br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno sab 16 mar 2019 alle ore 17:54 Cedron Dawg <<a href="mailto:cedron@exede.net">cedron@exede.net</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">As I said in my previous reply, Hungarian isn't as beneficial as it is touted.  What is more important when looking at code is knowing where the variable is defined and thus its scope.<br>
<br>
That's what I use prefixes for.  Here is my current set:<br>
<br>
=========<br>
Property/Variable Prefixes <br>
---------<br>
(none1)     Simple local variables, e.g. i, x, N, etc.<br>
(none2)     Gambas Property Declaration<br>
(none3)     Subroutine Names<br>
<br>
the         Within a Sub<br>
<br>
My          Public - Within a Class<br>
my (or $my) Private Property/Variable<br>
<br>
Arg         Argument in Public Routine<br>
arg         Argument in Private Routine<br>
<br>
Ret         Updatable Argument in Public Routine <br>
ret         Updatable Argument in Private Routine<br>
<br>
Our         Static Public Property/Variable<br>
our ($our)  Static Private Property/Variable<br>
=========<br>
<br>
The only one you guys use is "$", so I included it for kicks though it is redundant with my and thus qualifies as an uglifier.  Though its utility is unquestionable.  Now expand that to this set.<br>
<br>
This prefixing system is way way way more useful than Hungarian.<br>
<br>
Combine with good suffixing indicating the kind of variable which generally implies the type:<br>
<br>
e.g.  myPostCount<br>
<br>
my = private class variable<br>
<br>
Post = the actual thing<br>
<br>
Count = "Count of" implying integer<br>
<br>
e.g. myPostIndex<br>
<br>
e.g. MyLastName<br>
<br>
The additional benefit of this system is that it avoids almost all name collisions with system names and makes global search and replaces a lot less error prone.<br>
<br>
----[ Gambas mailing-list is hosted by <a href="https://www.hostsharing.net" rel="noreferrer" target="_blank">https://www.hostsharing.net</a> ]----<br>
</blockquote></div>