<Rant topic='Hungarian'>Damn I get mad about stuff!
secretGeek .:dotnuts about dotnet:.
home .: about .: sign up .: sitemap .: secretGeek RSS

<Rant topic='Hungarian'>Damn I get mad about stuff!

Some things get me really fired up.

Not your typical high school debating issues (abortion, euthenasia, religion, ho hum?) -- but Hungarian naming standards. Now that's a fiercesome topic! Full of emotion! A political minefield!

Oh I've tried to code without Hungarian. I've followed the new standards. But it's a crock! A marketing foible!

Getting rid of Hungarian is just a terrible piece of 'Fashion' that will later be looked back on with regret.

'Well we've got .Net now, so we'd better make all of our code look minimalist, clean and non-technical...'

'Everything's an object, you know, like Java, so let's do what sun does'

[Rant continues, with comparisons...]




'Richard Rodger' on Fri, 27 Aug 2004 12:41:28 GMT, writes:

I go for "lenient" Hungarian - as in, I believe
there's a sweet spot where the benefits equal the problems.

Thus, type indicators (int,dbl,str etc.) are
out - not really helpful in a strongly typed
language - tis what compilers are for, don't ya know.

But I love scope indicators - static, instance, parameter and so on - can't live without 'em.

URL: http://www.ricebridge.com



'secretGeek' on Thu, 27 May 2004 08:19:54 GMT, writes:

Thanks for the excellent response Thomas. These are the best presented arguments I've heard yet.

The only case I can think of that falls through the gaps is when it isn't obvious whether a variable is long/integer, for example. But if that's the only area of confusion, then tooltip text is more than adequate.

I agree that underscores make for sore pinky-fingers!

cheers
lb

URL: http://secretGeek.net



'Thomas Eyde' on Wed, 26 May 2004 05:36:25 GMT, writes:

I used to be a fan of Hungarian some years ago. I remember a heated debate about 1 or 3 letter prefixes I had with a coworker. Later I had a new heated debate on scoping prefixes, with or without underscores.

When I was introduced to extreme programming and, most important to me, unit testing, the parole was: Forget about type, express the variable's intention. You would always know the type of the variable in a given domain as long as the name is descriptive.

A name would be a string, so would socialSecurityNumber. age would usually be an integer, while person and user would be instances of Person and User or some derivative of those.

Most important I came to learn it is all about preferences. I have mine, you have yours, but we can't really question each other's preferences before you have tried mine and I yours. I lost my interest in Hungarian the moment I tried to use descriptive names instead.

I like the '_' prefix for class variables. I programmed a lot in VB6 before C#. Names in VB6 can't start with an '_', so my class variables there was named mySomething.

Also scoping prefixes can be difficult, but thats more a cultural issue. I don't know about English keyboard layouts, but to type 'm_' you have to type 'm' + [shift] + '_'. I think the combination is too clumsy.

These are my experiences. I am perfectly happy wothout Hungarian, and I don't think it is any harder to maintain my code.

I can see there are certain scenarios where Hungarian works very well. Is it so much better than not using it? For me it isn't, but then you may have experienced something which I haven't.



'secretGeek' on Tue, 25 May 2004 21:24:02 GMT, writes:

hi Thomas -- yep, i am serious.
straight up let me qualify that i don't think we need to hungarian prefixes for classes in the FCL or classes of our own.

I recommend them for basic types (integer, string and the like) and user controls (txt, btn and so on). Also, prefixes for scope (except for local), and for constants.

So this isn't Extreme Hungarian. I'm only advocating about thirty to fifty prefixes.

Hungarian is a maintenance issue -- but most .net code is too new for people to realise that maintenance is gonna be an issue. but Oh it will be. big time.

If you still disagree, please say so -- i am fairly interested in opinions about this stuff.

thanks again Thomas

Leon


URL: http://secretGeek.net



'Thomas Eyde' on Tue, 25 May 2004 10:10:42 GMT, writes:

You are not serious, are you?



'Scott' on Mon, 16 Feb 2004 13:11:22 GMT, writes:

I have recently had a newby coder wonder why a change made to a member variable in one procedure was not reflected in a subsequent procedure. The fact that he had declared the member variable as lngDealId, omitting the m prefix, and lngDealId was the name of an existing procedure level variable was found to be the cause of his frustration. He has since been made to read over the basics of Hungarian Notation and use it even during the most basic coding tasks (e.g. Excel macros/functions)

Does FX-Cop require much setting up to enforce HN? Can anyone recommend it from experience?



'Benjimawoo' on Mon, 16 Feb 2004 11:14:37 GMT, writes:

Okay, so hungarian prefixes make it easier to see exactly what you're working with, but what makes it easier still is well named (Okay, they're slightly more verbose/longer) variables in well structured classes.

Just what I think, though. Ignore at will.



'ABO' on Wed, 11 Feb 2004 18:58:42 GMT, writes:

Have fun with 1000 different prefixes! :) I've dropped the Hungarian naming convention and I'm feeling quite fine



'Avonelle Lovhaug' on Wed, 11 Feb 2004 03:53:38 GMT, writes:

Sorry, I have to completely AGREE with you.

Hungarian rules!

URL: http://www.coolbits.nu/



name

comment

(HTML not allowed)

homepage

All viewpoints welcome. But the right to delete any post for any reason is reserved. Don't make me do it. Comments may be republished, emailed to your loved ones or printed and used as toilet paper. Who reads this legal bit anyhow?

Back to <Rant topic='Hungarian'>Damn I get mad about stuff!

Articles

Alan Kay on 'The Camel has Two Humps' Alan Kay on 'The Camel has Two Humps'
is the music inside the piano? is the music inside the piano?
The Bluffer's Guide To Yegge: Business Requirements R Bullsh*t The Bluffer's Guide To Yegge: Business Requirements R Bullsh*t
Prototype Ready for Launch Prototype Ready for Launch
Idea: a poor man's eye-tracking heatmap for win forms Idea: a poor man's eye-tracking heatmap for win forms
'The Register' seems to have plagiarised Mary Jo Foley 'The Register' seems to have plagiarised Mary Jo Foley
A magic goal for software businesses A magic goal for software businesses
A to Z of Software Methodologies A to Z of Software Methodologies
TimeSnapper in Music! TimeSnapper in Music!
Fixing problems can give you a glimpse of something terrible Fixing problems can give you a glimpse of something terrible
Web Tablet: Toward Less Complexity Web Tablet: Toward Less Complexity
Do they store the code for TFS in TFS? Do they store the code for TFS in TFS?
Sudden TimeSnapper Discount! Sudden TimeSnapper Discount!
How Can Microsoft Beat Google? How Can Microsoft Beat Google?
TimeSnapper 3.1: Attack of the the Red/Green Stripes TimeSnapper 3.1: Attack of the the Red/Green Stripes
21 tools used in our MicroISV 21 tools used in our MicroISV
Lost Treasures of the DOS World: tree! Lost Treasures of the DOS World: tree!
The Virtual Machine Machine and the Virtual Virtual Machine The Virtual Machine Machine and the Virtual Virtual Machine
Should Linq To Sql Go Should Linq To Sql Go "Open Source"?
Redux: New Synchronisation Idea Overlooked By Microsoft Redux: New Synchronisation Idea Overlooked By Microsoft
New Synchronisation Idea Overlooked By Microsoft Live team New Synchronisation Idea Overlooked By Microsoft Live team
Visual Studio UX Taskforce, Office UX Taskforce... etc. Visual Studio UX Taskforce, Office UX Taskforce... etc.
How to be Jeff Atwood How to be Jeff Atwood

Archives .: secretGeek :: Complete Archives :.
25 steps for building a Micro-ISV 25 steps for building a Micro-ISV
3 minute guides -- babysteps in new technologies: powershell, JSON, watir, F# 3 Minute Guide Series
Top 10 SecretGeek articles Top 10 SecretGeek articles

Downloads

TimeSnapper -- Automated Screenshot Journal TimeSnapper.com    
Version 3.1: instant productivity profiles

ShinyPower (help with Powershell) ShinyPower
Now at CodePlex

Next Action NextAction
Managing the top of your mind



[powered by Google] 


World's Simplest Code Generator (html edition) World's Simplest Code Generator
Gradient Maker -- a tool for making background images that blend from one colour to another. Forget photoshop, this is the bomb. Gradient Maker
How to be depressed How to be depressed
You are not inadequate.



Recommended Reading

The Best Software Writing I
The Business Of Software (Eric Sink)

Recommended blogs

Jeff Atwood
Reginald Braithwaite
Joseph Cooney
Phil Haack
Scott Hanselman
Julia Lerman
Joel Pobar
Eric Sink
Joel Spolsky
Des Traynor

Aggregated Links

programming.reddit.com
dzone
dot net kicks

Human Link Machines

interesting finds
a continuous learner's weblog
arjan's world
n links today
new and notable
morning coffee
learning .net
weekly link post
(my del.icio.us account)

LinkedIn profile
home .: about .: sign up .: sitemap .: secretGeek RSS .: © Leon Bambrick 2003 .: privacy

home .: about .: sign up .: sitemap .: RSS .: © Leon Bambrick 2003 .: privacy