Naming conventions in For... each

H

Herfried K. Wagner [MVP]

* "Jay B. Harlow said:
Yes that is the one downside!

However! if the compiler did not allow calling class members on variables,
then you could tell as the variable is camelCased while the class is
ProperCased.
ACK.

Unfortunately VS.NET 'fixes' the names for you so they are all cased for the
variable...

IMO it _fortunately_ fixes them.

;-)
 
H

Herfried K. Wagner [MVP]

* "Fergus Cooney said:
That camel casing makes me shudder is perhaps a small factor there, lol

ACK. Camel case stands against every aesthetical and typographical principle.
 
F

Fergus Cooney

Hi anyone,

|| What do you do when you
|| want a Shared member of Foo?

Doh!. Forget that one.

Fergus
 
F

Fergus Cooney

Hi Jay, Herfried,

What do you mean 'fixes' the variables. Have I missed something handy? Is
it an option that I have switched off? Is it a VS2003 feature?

Regards,
Fergus
 
F

Fergus Cooney

Hi Herfried,

But it's an officially recommended convention.

SCNR. ;-))

Regards,
Fergus
 
F

Fergus Cooney

Hi Robert,

The day I discovered that it had been labelled 'Hungarian' notation I was
really pissed off. I was using that style for years before then. And they had
so many 'wrong' characters in the 'official' version, moan, moan.

I agree with Jay's suggestion - go your own way but be consistent.

(ish) lol.

Regards,
Fergus
 
H

Herfried K. Wagner [MVP]

* "Fergus Cooney said:
But it's an officially recommended convention.

ACK. But it doesn't matter if you don't use it. Using non-convention
compliant characters to markup quoted text, other people will have
problems reading the text.
 
H

Herfried K. Wagner [MVP]

* "Fergus Cooney said:
What do you mean 'fixes' the variables. Have I missed something handy? Is
it an option that I have switched off? Is it a VS2003 feature?

\\\
Dim foo As Foo
foo.Goo() ' foo is lower case!
..
..
..
Public Class Foo
Public Shared Sub Goo()
...
End Sub
End Class
///
 
F

Fergus Cooney

Hi Herfried,

Sorry, I haven't a clue what you're telling me there.

For me, what I type is what I get. Is this 'fixed' anything to do with
that?

Regards,
Fergus
 
F

Fergus Cooney

Hi Herfried,

Lol. NACK, I think that other people won't (because they have human
intelligence) but apparently some newsreaders are so stupid and inflexibly
written that they <will>. ;-)

BTW. I went to gnus.org. How in the "F" & Path.InvalidPathChars & "k" am I
supposed to download and install it when they won't tell me what I need and
where to get it? It appears that the website is as cleverly designed as the
newsreader.

Regards,
Fergus
 
H

Herfried K. Wagner [MVP]

* "Fergus Cooney said:
Sorry, I haven't a clue what you're telling me there.

For me, what I type is what I get. Is this 'fixed' anything to do with
that?

If you name the method 'Foo' and the class' name is 'Foo', you will
not be able to distinct between a call to a class method and a call to
an instance variable.

Jay said that he names the variable lowercase ('foo'). He would expect
this code:

\\\
Dim foo As New Foo()
foo.InstanceMethod()
Foo.ClassMethod()
///

VS.NET changes the code to:

\\\
Dim foo As New Foo()
foo.InstanceMethod()
foo.ClassMethod()
///
 
H

Herfried K. Wagner [MVP]

* "Fergus Cooney said:
Lol. NACK, I think that other people won't (because they have human
intelligence) but apparently some newsreaders are so stupid and inflexibly
written that they <will>. ;-)

It's impossible to write a better newsreader.
BTW. I went to gnus.org. How in the "F" & Path.InvalidPathChars & "k" am I
supposed to download and install it when they won't tell me what I need and
where to get it? It appears that the website is as cleverly designed as the
newsreader.

It took me some hours to set this newsreader up but it works like a
charm.

;-)
 
F

Fergus Cooney

Hi Herfried,

VS.NET changes the code

Thanks, now I understand what you're talking about. :)

So now the question becomes How? It doesn't happen for me. Is this one of
these prettify options?

Regards,
Fergus
 
F

Fergus Cooney

Hi Herfreid,

Apparently it renders || as some sort of smiley. One of their users has
reported that he doesn't like that, but doesn't know how to change it.

Well, you recommended that I check it out but they put large hurdles in
the way, and you seem keen to be in the conspiracy of silent wizardry, so I'll
have to give it a miss.

Impossible to improve? I'll never know.

Regards,
Fergus
 
H

Herfried K. Wagner [MVP]

* "Fergus Cooney said:
Apparently it renders || as some sort of smiley. One of their users has
reported that he doesn't like that, but doesn't know how to change it.

Well, you recommended that I check it out but they put large hurdles in
the way, and you seem keen to be in the conspiracy of silent wizardry, so I'll
have to give it a miss.

If you don't have some days time now, don't try to get gnus to run.

;-)
 
H

Herfried K. Wagner [MVP]

* "Fergus Cooney said:
VS.NET changes the code

Thanks, now I understand what you're talking about. :)

So now the question becomes How? It doesn't happen for me. Is this one of
these prettify options?

Which options are turned on in your IDE?
 
F

Fergus Cooney

Hi Herfried,

ROFL - You want the whole list?

Assuming you mean the TextEditor/Basic

I've got
Messify listing (reformatting) of code.
switched off.

That's the only one that refers to the actual code. The rest are tabs and
outlining, etc.

Regards,
Fergus
 
J

Jay B. Harlow [MVP - Outlook]

Herfried,
IMO it _fortunately_ fixes them.
Just remember that, the statement was in the context of naming fields the
same as the type.

Otherwise I totally agree, it is good that it changes them so they match.

Jay
 
F

Fergus Cooney

Hi Herfried,

Blimey, you're up late.

The time isn't the problem. The problem is that there is no information
about how to <get> the thing. A web site for a product that doesn't want
people to <have> the product!!

Regards,
Fergus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top