Skip to main content
Post Closed as "Opinion-based" by gnat, Bart van Ingen Schenau, Kilian Foth, CommunityBot
edited tags
Link
gnat
  • 20.5k
  • 29
  • 117
  • 309
Source Link
user114310
  • 125
  • 1
  • 6

Why do we use hungarian notations on local variable but not on function or global variable?

That doesn't seem to make sense.

In local variable, we sort of know the type anyway. It's local. We're working on it.

Yet in function name or global variable, the definition is very far away on other files. It seems that hungarian notations make far more sense there.

For example, in objective-c I used this

+(CGFloat) fHeightOfNavigationController

So when I want to know the height of navigation controller, I will need to press a button that specify the function.

What's the button? What's the name of the function. Is it heightOfNavigationController? Is it NavigationControllerHeight? Is it navHeight?

I don't know which letter I should type first to activate the autocomplete. But I know the function is float.

So I just type f...

Tada... I got fHeightOfNavigationController in autocomplete.

Yet I don't think this is how most people use hungarian notation.

Why?