Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The opposite of Hungarian Notation?

Most programmers know of a thing called 'Hungarian Notation', each variable has a nice prefix to denote its data type, i.e.

bIsExciting = false;    // Boolean
strName = "Gonzo";      // String
iNumber = 10;           // Integer

While this style of notation has fallen out of favor, I am seeing (at work, internet, etc.) a lot of data type indicators added as a 'suffix' to variable names, i.e.

NameStr = "Gonzo";        // String
NumberInt = 10;           // Integer
MyRideBike = new Bike();  // Bicycle

Is there a name for this, when the data type is suffixed to a variable name?

EDIT: To clarify..., is there a distinct name for such a thing? If not, some concise ideas on what to call it would certainly be appreciated.

like image 457
A.R. Avatar asked Sep 30 '11 12:09

A.R.


People also ask

What is Hungarian notation and camel notation?

Camel Notation- In this naming convention first character of all words, except the first word are Upper Case and other characters are lower case. Hungarian Notation - In this naming convention the variable name starts with group of small letter which indicate data type.

Why is it called Hungarian Notation?

Hungarian Notation is a programming language variable naming convention. Since around 1999 when Charles Simonyi, who originated from Hungary, introduced the naming convention, some have tried to adapt it to various new programming languages.

What is Hungarian notation and why do many object oriented programmers feel it is not a valuable style to use?

Hungarian notation strongly reduces the benefits of using feature-rich code editors that support completion on variable names, for the programmer has to input the whole type specifier first. It makes code less readable, by obfuscating the purpose of the variable with needless type and scoping prefixes.

What is Hungarian notation Python?

Hungarian Notation A great way to lie to yourself about the quality of your code is to use Hungarian Notation. This is where you prefix each variable name with a little bit of text to indicate what kind of thing it's supposed to be.


2 Answers

This is not the opposite of Hungarian notation, this is Hungarian notation in a different guise, if we follow Stroustrup's definition of Hungarian notation as "embedding an abbreviated version of a type in a variable name". If you want to call it anything, call it suffix Hungarian. (And please tell your colleagues that it's useless in most cases.)

like image 196
Fred Foo Avatar answered Oct 16 '22 17:10

Fred Foo


I would call this reverse hungarian notation which would be consistent with the difference between polish notation and reverse polish notation.

Additionally billmcc's post on the following link shows real life usage of the term "reverse hungarian notation" What was the strangest coding standard rule that you were forced to follow?

like image 29
Alan Macdonald Avatar answered Oct 16 '22 16:10

Alan Macdonald