Rantings of a skinny man..

Actually, the 3 letter prefix is a modern isation of Hungarian notation, which originally defined single character prefixes. The change came about as the range of object and control types grew. There are only 26 letters in the Alphabet after all. I use the original single character notation for variables but the modern 3 character one for controls.

I personally hate using underscores in code. I just find them really awkward to type quickly. For member variables I just prefix "m". So a private string variable becomes:

msVariableName
 
I use single-letter prefixes for common types:

iInteger
sString
pIntPtr


and double-letter prefixes for structures, classes and uncommon types:

scMain (instance of Subclass)
dtTime (instance of DateTime class)


I mean come on... do you really need 3 letters?
 
Well, I can accept different coding styles and naming conventions. I just personally hate Hungarian. :p

Anyway, my rant was more or less towards the usage of legacy VB6 compatability namespaces to use methods such as UBound() etc. To make it worse, the namespace is imported by default. *mumbles* I so need to write a little add-on that automatically sets Option Strict to On and removes the import to Microsoft.VisualBasic when you create a new application.

I probably should of worded my original post better, but when some of you actually said you still use Hungarian for certain things (or a minor form of it) it just came as a shock to me. I still refuse to believe.. :D
 
While I agree with you on the Microsoft.VisualBasic issue for the most part, it needs to be said that some of the functions located there are fine to use. Thats not to say that many of them are fine to use however. Functions such as FileOpen, Val and StrReverse should just be shot though. Also, while you can remove the Imports Microsoft.VisualBasic statement, that assembly will still need to be referenced nomatter what. The compiler will re-reference it for you if you remove it.

Option Strict: Absolutely. Turn it on, no excuses.
Imports MS.VB: Use with partial prejudice.
 
Posted this in the wrong thread yesterday.. LOL. Anyway..

Funny enough I was browsing through gotdotnet.com forums and came upon these links from the MSDN library;

Main Link:
http://msdn.microsoft.com/library/d...ef/html/cpconnetframeworkdesignguidelines.asp

Naming Guideline Links:
http://msdn.microsoft.com/library/d...en-us/cpgenref/html/cpconnamingguidelines.asp
http://msdn.microsoft.com/library/d...enref/html/cpconclassmemberusageguidlines.asp
http://msdn.microsoft.com/library/d...us/cpgenref/html/cpcontypeusageguidelines.asp

I know theyre guidelines etc and of course everyone has their own set of guidelines in the work place. I just figured since we were talking about it so much some of you might find these links interesting at the very least.
 
Not really. Structured exception handling is built in to the framework, there really isnt an alternative if you want to trap errors.
 
I think the performance hit is only when you actually throw an error. I wouldnt see why catching one would cause any slow down.. Unless of course youre comparing On Error GoTo to Try.. Catch, in which case thatd be interesting to see benchmarks on.
 
For sure when you Throw, you are taxing your system.

I ment for the occasions when all goes well and there are no exceptions, its just because I use it a great deal, thats all.
 
Oh, and On Error has left my vocabulary.
and On Error Resume Next I almost never used in VB6.

btw wyrd, for the short amount of time youve been in VB6/.NET,
I find that youre quite advanced. Good job.
 
btw wyrd, for the short amount of time youve been in VB6/.NET,
I find that youre quite advanced. Good job.

Thanks. :D

Heck, since you brought it up.. how long have all of you been working with .NET for? Only about a month for me.
 
its just because I use it a great deal
Try to keep them to a minimum. Most errors can be caught in code, and dont really need exception handling at all. Ive been known to go error handling crazy myself, so I know where youre coming from.
 
Originally posted by wyrd
Heck, since you brought it up.. how long have all of you been working with .NET for? Only about a month for me. [/B]

About two and a half years. Ive seen jobs posted which ask for 2 years professional C# experience.
 
About a month for me too. Its surprisingly easy to pick up. Took me
about 25 minutes to grasp the basic concepts. My first program
scanned directories and subdirectories and made thumbnail images
of any GIF images it found. :)
 
Originally posted by Derek Stone
...
Option Strict: Absolutely. Turn it on, no excuses.
...
While I agree with this statement, I wonder about all the
examples I have seen (even in professional books) using late
binding (which Option Strict will refuse to compile). Also, many
examples dont even seem to be consistantly using explicit casts.
Has anyone here who normally uses it found they had to turn it
off to accomplish something unusual?
 
Originally posted by Thinker
Has anyone here who normally uses it found they had to turn it
off to accomplish something unusual?

I always use Option Strict On, the one time I did not was for this;

I had a dozen RadioButtons, and I wanted to get the Tag value of the clicked item, so I added all of the handles into one click event and did this....

x = sender.Tag

BTW, I started .NET 7 months ago, and last week I finished a 3 month contract using it.
 
Back
Top