So, if I pick up a code later, there is no need to go back to the variable declaration to know if it is a numeric or text variable and fewer possible errors.
The creators of the basic had good ideas from the beginning.

That's why I also prefer $ for string variables.Marc56us wrote:After using for years .s, I now prefer to use $ for text variables.
So, if I pick up a code later, there is no need to go back to the variable declaration to know if it is a numeric or text variable and fewer possible errors.
i dropped using the $ in variables, because i am using a mix of hungary notation and camelcase notation for my variables to determine the variable type on the first sight.Marc56us wrote:After using for years .s, I now prefer to use $ for text variables.
So, if I pick up a code later, there is no need to go back to the variable declaration to know if it is a numeric or text variable and fewer possible errors.
The creators of the basic had good ideas from the beginning.
I totally agreeskywalk wrote:This is what makes PureBasic so helpful when browsing code.
I know immediately I am staring at a string variable x$ or a pointer *ptr.
C drops the pointer(*) after defining and that is a big reason for so many memory bugs.
PureBasic syntax also allows you to retain the .type tail, but I find that too much noise.
For i.i = 0 to nPts.i
x.d + i.i
Next i.i
That's what I do... Been doing it since I read that how to program windows book in the early x0's...kurzer wrote: eg.
iNumOfCars ; integer
sNameOfDriver ; string
fSpeedOfCar ; float
dAmountOfGas ; double
stCars ; structured type
and so on...
Sent via mobile phone
Appending the variable type as prefix to the variable name has the disadvantage that the variable type must first be written for the auto-completion function. Usually, however, you only remember the approximate variable name and not also the variable type of the variable.kurzer wrote:eg.
iNumOfCars ; integer
sNameOfDriver ; string
fSpeedOfCar ; float
dAmountOfGas ; double
stCars ; structured type
and so on...