<div dir="ltr"><div>I don't think your code example is representative of the whole issue. What if there are multiple containers, buttons, etc? What if there are long / complex lines?</div><div>Even in your chosen example "myScrollBar" says nothing about its function or identity, only that it is scrollbar. But "scbMain" hints right away how the scrollbar is used (not much but still).<br></div><div>More descriptive the variable name is, longer it becomes and it really adds up in already long lines. So, I chose not to waste space for the type information, when it can easily be shortened.<br></div><div><br></div><div>I don't think $ is used in names of controls. They shouldn't be public anyway.<br></div><div><br></div><div><br></div><div>Jussi<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 16, 2019 at 11:33 PM Cedron Dawg <<a href="mailto:cedron@exede.net">cedron@exede.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I like "suffix" rather than "postfix", but both are entirely understandable as well.<br>
<br>
It's a matter of specificity precedence if I may abuse some language.<br>
<br>
Do you like "perro negro" or "black dog"?<br>
<br>
Jussi Lahtinen or Lahtinen, Jussi<br>
<br>
I can totally understand once you get used to something, it becomes your preference. And preferences are just like opinions everybody..., ummmm, wait a moment, they are opinions.<br>
<br>
Please tell my your opinion on this. Which version do you find more comprehensible? Quick, now.<br>
<br>
<a href="http://gambaswiki.org/wiki/doc/naming" rel="noreferrer" target="_blank">http://gambaswiki.org/wiki/doc/naming</a><br>
<br>
I could not find "ScrollBar" or "Container". Not sure where it is in the source tree either. So I'll guess "scb" and "cnt"<br>
<br>
So my code:<br>
<br>
'=============================================================================<br>
Public Sub MoveVerticalSteps(ArgSteps As Float)<br>
<br>
Dim theNewY As Float<br>
Dim theContainer As Container<br>
<br>
theContainer = myScrollBar.Parent<br>
<br>
theNewY = myScrollBar.Y + ArgSteps * myScrollBar.H<br>
<br>
If theNewY + myScrollBar.H > theContainer.H Then<br>
myScrollBar.Y = theContainer.H - myScrollBar.H<br>
Else If theNewY < 0 Then<br>
myScrollBar.Y = 0<br>
Else<br>
myScrollBar.Y = theNewY<br>
Endif<br>
<br>
End<br>
'=============================================================================<br>
<br>
Becomes:<br>
<br>
Dim fY As Float<br>
Dim cntMain as Container<br>
<br>
cntMain = scbMain.Parent<br>
<br>
fY = $scbMain + fSteps * $scbMain.H<br>
<br>
If fY + $scbMain.H > cntMain.H Then<br>
$scbMain.Y = cntMain.H - $scbMain.H<br>
Else If fY < 0 Then<br>
$scbMain.Y = 0<br>
Else<br>
$scbMain.Y = fY<br>
Endif<br>
<br>
<br>
<br>
<br>
<br>
----- Original Message -----<br>
From: "Jussi Lahtinen" <<a href="mailto:jussi.lahtinen@gmail.com" target="_blank">jussi.lahtinen@gmail.com</a>><br>
To: "user" <<a href="mailto:user@lists.gambas-basic.org" target="_blank">user@lists.gambas-basic.org</a>><br>
Sent: Saturday, March 16, 2019 5:13:55 PM<br>
Subject: Re: [Gambas-user] Better use of prefixes<br>
<br>
I like short variable names and I find prefixes aesthetically more pleasing than postfixes. <br>
Thus I strongly prefer "btnThis" than "ThisButton". But both are fully understandable. <br>
<br>
<br>
Jussi <br>
<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>