-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|519|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Link Home -> Help/Tutorials


 
HoboBen
Created : 01 August 2007
 

Hungarian Notation

Makes Code Neater

https://www.codehead.co.uk/hungarian_notation.html
Came across this way for labelling variables and it sounds like a good idea.

 

Comments


Thursday, 02 August 2007, 00:53
power mousey
nice notatation and interesting.

But hobo,

I'm rather hungry and rather have
some Hungarian ghoulash.
My mom makes some of the best ghoulash this
western side of Hungary. And thats the real meal
worth noting!

cheers bro
power mousey
Thursday, 02 August 2007, 04:05
Jayenkai
Good idea, maybe, but without an underscore between "Type" and "Variable Name" that just looks nasty!
Thursday, 02 August 2007, 07:53
Nolan
lpszTitle


No. Just no.
Thursday, 02 August 2007, 10:01
Scherererer
This has been around for a long while, and even today I try my hardest to avoid using it. It's only really practical for procedural languages, and is often applied to C++ aswell; but once you get into languages like Java, C#, Ruby, etc. it looses its appeal very quickly. I think it was mainly just for team projects so that people can read your code after you wrote it.
Thursday, 02 August 2007, 13:24
JL235
Using good accurate names is far more useful. There is a nice example in Instinct's link about writing good unmaintainable code of Hungarian Notation: a_crszkvc30LastNameCol. Try deciphering that.

I used to use something similar with Blitz, like putting p before variables which were to do with the player. It works well if you use it within reason, but I agree with Instinct. Since I've started writing in other languages doing that just looks wrong. If you just wrap all those p variables into a Player class you no longer need the notation.

With Ruby the type of data your holding isn't so important, but more what it represents. For example it doesn't matter if 'width' is a Fixnum, Float or Bignum. They can all be used in the same way. What's important is that it represents the width of an Image (for example). So using notation for stating the type of the variable isn't so important.

Most (if not all) modern IDE's also remember types of variables for you. Again rendering this kind of notation a little redundant.
Thursday, 02 August 2007, 15:07
Nolan
I use lowerCamelCasing for pretty much every language I use.
Thursday, 02 August 2007, 15:51
blanko1324
I'll have to try that sometime. I like what Nolan pointed out though:

"lpszTitle"

Sheesh...
Thursday, 02 August 2007, 17:06
Phoenix
I agree with Instinct, but you never really see something like a_crszkvc30LastNameCol. I've seen lpsz countless times though, but didn't know what it meant, until now.