Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Want an option to error the following

17 views
Skip to first unread message

Martin

unread,
May 4, 2012, 9:08:26 AM5/4/12
to
Any class variables which are not prefixed by Self:

Just spent an hour with a misspelt variable name which was the same name
as a class variable!


AGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

Karl Faller

unread,
May 4, 2012, 10:14:56 AM5/4/12
to
Martin,
<g> - and now imagine, there are folks who find casesensitive varnames
a cool idea like:
Self:MartinsVar, Self:MartInsVar, Self:martinsvarm

happy hunting
Karl
P.S: sorry, but i don't think there's an error for missing selfs...

Harry B.

unread,
May 5, 2012, 7:57:13 AM5/5/12
to
Karl,

> <g> - and now imagine, there are folks who find casesensitive varnames
> a cool idea like:
> Self:MartinsVar, Self:MartInsVar, Self:martinsvarm

I'm one of those folks. But not for using them as different vars in the
same context, but for better reading them. So I like to use allways the
same form of writing a var, and the compiler should help me with that.

Best Regards,
Harry B., who's heart ist beating "schwarz-gelb"!

Karl Faller

unread,
May 5, 2012, 9:42:42 AM5/5/12
to
Harry,
>> <g> - and now imagine, there are folks who find casesensitive varnames
>> a cool idea like:
>> Self:MartinsVar, Self:MartInsVar, Self:martinsvarm
>
>I'm one of those folks. But not for using them as different vars in the
>same context, but for better reading them. So I like to use allways the
>same form of writing a var, and the compiler should help me with that.
IMHO, you confuse here two things:
"Unique casing of a var is a feature i remember from, IIRC, Basic 3.0
<g>, and i totally agree that it's useful.

But that hat NOTHING to do with _distinguishing_ vars only by their
casing.

BTW, congrats to Dortmund ;-) from Bavaria

Karl

Urs Eggmann

unread,
May 5, 2012, 10:26:37 AM5/5/12
to
> Harry B., who's heart ist beating "schwarz-gelb"!

I hope, for football and not politically????

Urs

Harry B.

unread,
May 6, 2012, 6:01:23 AM5/6/12
to
Yes, of course football! Normaly I should had written "schwazzz-gelb" as
it is spoken in that region of germany.

Harry B.

Marc Verkade [Marti]

unread,
May 6, 2012, 2:43:20 PM5/6/12
to
Bummer....
I always prefix class variables witj an underscore and create getters and
setters if needed.
Keeps my code clean and neat...

Class Dog
Hidden _Color As String

Method Init() class Dog
Self:_Color:="Black"
Return self

Access Color Class Dog
Return self;_Color


"Martin" schreef in bericht news:cxQor.216235$_Q.2...@fx01.am4...

D.J.W. van Kooten

unread,
May 6, 2012, 5:09:03 PM5/6/12
to
On Sat, 05 May 2012 13:57:13 +0200, "Harry B." <bongo...@gmail.com>
wrote:

Hello Harry, Karl,
>
>> <g> - and now imagine, there are folks who find casesensitive varnames
>> a cool idea like:
>
>I'm one of those folks. But not for using them as different vars in the
>same context, but for better reading them. So I like to use allways the
>same form of writing a var, and the compiler should help me with that.
>

That would indeed be handy, but as Karl said, only if it forces you to
have the same way of writing the variable names.

E.g. in VO, I define cMyVar
and every time I type e.g. CmYvAR Intellisense will change it to
cMyVar (in SP3 removing the current token doesn't always work
however). But when you type it right the first time, it works handy.

In C#, typing CmYvAR doesn't change anything for you. It just gives a
compiler error and you have to re-enter. I have not checked what
Vulcan is doing but again I consider VO's way to be the preferable
way.

Dick

0 new messages