# Just Say mNo to Hungarian Notation

DevFeed: [Just Say mNo to Hungarian Notation](<https://devfeed.tech/articles/just-say-mno-to-hungarian-notation-20944.md>)

Original publisher: [Read original article](<https://jakewharton.com/just-say-no-to-hungarian-notation/>)

Published: 2016-01-21T00:00:00Z

Content type: opinion

Language: en

Sources: [Jake Wharton](<https://devfeed.tech/sources/jake-wharton.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Java](<https://devfeed.tech/topics/java.md>), [Code review](<https://devfeed.tech/topics/code-review.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [code](<https://devfeed.tech/tags/code.md>), [code-review](<https://devfeed.tech/tags/code-review.md>), [java](<https://devfeed.tech/tags/java.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [writing-code](<https://devfeed.tech/tags/writing-code.md>)

## AI overview

An opinion article argues against using Hungarian notation in Java code for Android apps and libraries. It challenges claims that Android guidance, Android samples, or code review justify prefixes such as "m" and "s", and explains that a variable's type is more useful in review than its visibility.

## Source excerpt

Every day new Java code is written for Android apps and libraries which is plagued with an infectious disease: Hungarian notation. The proliferation of Hungarian notation on Android is an accident and its continued justification erroneous. Let's dispel its common means of advocacy: "The Android Java style guide recommends its use" There is no such thing as an Android Java style guide that provides any guidance on how you should write Java code. Most people referencing this non-existent style guide are referring to the style guide for contributions to the Android Open Source Project (AOSP). You are not writing code for AOSP so you do not need to follow their style guide. If you're working on code that might someday live in AOSP you don't even need to follow this style guide. Almost all of the Java libraries imported by AOSP do not follow it, and even some of the ones developed inside of AOSP don't either. "The Android samples use it" These samples started life in the platform inside of AOSP so they adhere to the AOSP style. For those which did not come from AOSP, the author either incorrectly believes the other points of advocation in this post or simply forget to correct their style when writing the sample. "The extra information helps in code review" The 'm' or 's' prefix on name indicates a private/package instance field or private/package static field, respectively, where this would otherwise not be known in code review. This assumes the field isn't visible in the change, since then its visibility would obviously be known regardless. Before I attempt to refute this, let's define Hungarian notation. According to Wikipedia, there are two types of Hungarian notations: System notation encoded the data type of the variable in its name. A user ID that was a long represented in Java would name a variable lUserId to indicate both usage and type information. Apps notation encoded the semantic use of the variable rather than it's logical use or purpose. A variable for stor