StringVar.s contra StringVar$

Just starting out? Need help? Post your questions and find answers here.
User avatar
Mijikai
Addict
Addict
Posts: 1520
Joined: Sun Sep 11, 2016 2:17 pm

Re: StringVar.s contra StringVar$

Post by Mijikai »

skywalk wrote: Sat Jul 01, 2023 10:02 pm ...
Next you .s people will demand we drop the * from all our *Pointers?!?
...
No the $ is the only problem it has no future anyway :mrgreen:
User avatar
Demivec
Addict
Addict
Posts: 4270
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: StringVar.s contra StringVar$

Post by Demivec »

I like the option to use $ to indicate a string variable. I also use .s for string variables. I vary which depending on my coding needs and the readability I need in the code. Sometimes it helps the readability of either a global variable, parameter or protected variable. I don't think it has as much usefulness in structures.

'$' is definitely a distinctive character like '*' is fir pointers and this makes its ability to communicate something more direct and easier. I know if it was changed from its current use for indicating a string type it would quickly be utilized to designate some other feature people are clamoring for that just needs an available and unused symbol. I'll pause a moment to give everyone a chance to reflect on one or more favorite 'feature requests' they've seen our made in the past.

I am not a 'my way or the highway' type of person and think there are many ways to use this option both wisely and to good effect and also times when not to use it.

I like it also for nostalgic reasons. It is easy and quick to write simple code and know that undeclared variables without $ are integers and those with $ are strings. And yes, I also know about EnableExplicit and often write code with everything declared with enumerated constants and well thought out descriptive variables names with plenty of useful comments. :wink: It's nice to code either way according to your needs.

+1 for keeping it the way it is.
BarryG
Addict
Addict
Posts: 4178
Joined: Thu Apr 18, 2019 8:17 am

Re: StringVar.s contra StringVar$

Post by BarryG »

Demivec wrote: Sun Jul 02, 2023 5:43 am+1 for keeping it the way it is.
Fred has said before he's not dropping the "$", so don't worry. It's being kept.
Post Reply