<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...]




'EllaHOLLAND34' on Sun, 25 Dec 2011 03:10:11 GMT, writes:

It's known that cash makes people free. But what to do when one does not have cash? The one way is to receive the <a href="http://goodfinance-blog.com/topics/credit-loans">credit loans</a> and just consolidation loan.

URL: http://goodfinance-blog.com



'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

Just Wally Just Wally
The Correct Order for a First Time Viewing of The Lord Of The Rings The Correct Order for a First Time Viewing of The Lord Of The Rings
A new era for Android. A new era for Android.
Mind-boggling Demo of New Gaming Genre, aka Folder-Based Hangman, aka Fun with Recursion Mind-boggling Demo of New Gaming Genre, aka Folder-Based Hangman, aka Fun with Recursion
Got CSV in your javascript? Use agnes. Got CSV in your javascript? Use agnes.

Archives Complete secretGeek Archives

TimeSnapper -- Automated Screenshot Journal TimeSnapper: automatic screenshot journal
NimbleText -- World's Simplest Code Generator NimbleText: Code Generator, Text Manipulator, Data Extractor

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
Universal Troubleshooting checklist Universal Troubleshooting Checklist
Top 10 SecretGeek articles Top 10 SecretGeek articles
ShinyPower (help with Powershell) ShinyPower
Now at CodePlex

Realtime CSS Editor, in a browser RealTime Online CSS Editor
Gradient Maker -- a tool for making background images that blend from one colour to another. Forget photoshop, this is the bomb. Gradient Maker


[powered by Google] 


How to be depressed How to be depressed
You are not inadequate.



Recommended Reading


the little schemer


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

Recommended blogs

Jeff Atwood
Joseph Cooney
Phil Haack
Scott Hanselman
Julia Lerman
Rhys Parry
Joel Pobar
Thomas White
OJ Reeves
Eric Sink

Aggregated Links

proggit
dzone
hacker news
dot net kicks

Human Link Machines

interesting finds
a continuous learner's weblog
arjan's world
weekly link post

LinkedIn profile
LogEnvy - event logs made sexy
Computer, Unlocked. A rapid computer customization resource
PhysioTec, Brisbane Specialist Physiotherapy & Pilates
home .: about .: sign up .: sitemap .: secretGeek RSS .: © Leon Bambrick 2003 .: privacy

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