Click here to Skip to main content
Click here to Skip to main content

Hungarian Notation in Microcontroller Code

, 8 Jun 2014
Rate this:
Please Sign up or sign in to vote.
I'm advocating for the use of Hungarian notation in microcontroller code

What happened to Hungarian Notation?

Hungarian notation had fallen out of use in the mainstream programming, compared to late 1990s and early 2000s. In my observation, today the default setting in the majority of the code writers' minds is Hungarian notation: off. What had caused this? Is there really no use for Hungarian notation?

Mainstream IDEs have Evolved

Mainstream Integrated Development Environments (IDE) have been getting increasingly more powerful. Now they provide good on-the-fly reference information about variables. This reduces the need to encode additional meta-information (type, scope) into the name of the variable.

OO Languages vs. Non-OO Languages

OO languages (such as C# and Java) vs. non-OO languages (such as plain C). OO program may use a larger set of data types, which can include a large number of classes. Remembering (and sometimes inventing) a map of Hungarian prefixes becomes more tedious.

Using the prefix p for pointers in C++ is still a good idea. Pointers should be treated with additional care, so it wouldn’t hurt to have this additional bit of labeling. Similarly, fp for function pointers.

Embedded Programming

Code for microcontrollers (especially, the relatively small 8- and 16-bit ones) is often written in plain C. IDEs for microcontrollers often lack Intellisense and other productivity features. As a result, I think that Hungarian notation is still strongly indicated for microcontroller code.


This article, along with any associated source code and files, is licensed under The Creative Commons Attribution-Share Alike 3.0 Unported License

About the Author

Nick Alexeev
Systems Engineer Prolitech
United States United States
doing business as Prolitech
Redwood City, CA

Comments and Discussions

QuestionWhy Hungarian Notation is no longer common. PinpremiumBill_Hallahan9-Jun-14 16:17 
GeneralLanguage more than target system PinmemberJohn Brett9-Jun-14 6:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 9 Jun 2014
Article Copyright 2014 by Nick Alexeev
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid