hungarian-notation

Best way to get rid of hungarian notation?

人盡茶涼 提交于 2019-12-19 19:41:11
问题 Let's say you've inherited a C# codebase that uses one class with 200 static methods to provide core functionality (such as database lookups). Of the many nightmares in that class, there's copious use of Hungarian notation (the bad kind). Would you refactor the variable names to remove the Hungarian notation, or would you leave them alone? If you chose to change all the variables to remove Hungarian notation, what would be your method? 回答1: Refactor -- I find Hungarian notation on that scale

The opposite of Hungarian Notation?

北战南征 提交于 2019-12-19 06:05:23
问题 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,

The opposite of Hungarian Notation?

孤街浪徒 提交于 2019-12-19 06:05:06
问题 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,

Getters and Setters in Eclipse for Hungarian Style Members

被刻印的时光 ゝ 提交于 2019-12-12 16:54:47
问题 The project I'm working on dictates hungarian notation for class member variables. Example: String m_foo; Is it possible to make Eclipse strip the hungarian prefix when generating getters and setters? I'm using Helios and it suggests (not surprisingly) getM_foo and setM_foo , but I want getFoo and setFoo . Code Templates doesn't look helpful. 回答1: In the preference page Java>Code Style, in the naming conventions table, select the "Fields" row, press the Edit button, and type "m_" in the

Hungarian in VBA okay?

元气小坏坏 提交于 2019-12-12 08:04:01
问题 I don't use hungarian (str, int) prefixes in .Net, but I still find it useful in VBA, where it is more difficult to see types. Is this bad? Unnecessary? Maybe I'm missing something. I'd really appreciate any feedback. I've been wondering for a while. Thanks everybody. 回答1: I always use one and two letter prefixes in VBA. I'm sure I'm the only one that's going to admit that, but I figured somebody needed to be the contrarian. Of the 18 million lines of VBA code I've written, I've collaborated

What does the “uw” mean at the beginning of variable names in STM32 examples?

喜欢而已 提交于 2019-12-11 16:48:18
问题 As I read STM32 example code I see a fair number of variables that begin with uw . Ex: static __IO uint32_t uwLsiFreq = 0; __IO uint32_t uwCaptureNumber = 0; __IO uint32_t uwPeriodValue = 0; __IO uint32_t uwMeasurementDone = 0; Everything has a meaning or a story behind it. What does uw mean here? Example Source: STM32Cube_FW_F2_V1.7.0/Projects/STM32F207ZG-Nucleo/Examples/IWDG/IWDG_Example/Src/main.c. Download link --> click "Get Software" button next to "STM32CubeF2". 回答1: Alright, I'd like

FreeRTOS Hungarian Notation [duplicate]

北慕城南 提交于 2019-12-11 01:54:14
问题 This question already has answers here : what is v and x means in freeRTOS task creating or used in it? (2 answers) Closed 3 years ago . I'm a complete newbie in RTOS and C programming, and I'm still getting used to the C good practices yet. So I opened a project which uses FreeRTOS, and I notice that the OS files use the Hungarian Notation. I know the notation a little, but faced some new "standards" in the FreeRTOS.h file, which are: #ifndef configASSERT #define configASSERT( x ) #define

An interesting detail about variable name

浪子不回头ぞ 提交于 2019-12-04 08:03:24
I have read tutorials all over the web with different kinds of tutorials specified on game (however, this turns out to be pretty general). Are there any reasons to why many developers name their variables like: mContext For me it is default to just name it "context" or something similar. Are there any reasons why the "m" are before? (I know that this is a matter of style, but I'm just curious what it stands for) The m will be to signify that the object is a member variable of the class in question. It's a common use of Hungarian Notation to prefix the name with clues to the variable's purpose

Where does the k prefix for constants come from?

 ̄綄美尐妖づ 提交于 2019-12-03 06:23:13
问题 it's a pretty common practice that constants are prefixed with k (e.g. k_pi ). But what does the k mean? Is it simply that c already meant char ? 回答1: I haven't seen it that much, but maybe it comes from certain languages' (the germanic ones in particular) spelling of the word constant - konstant . 回答2: It's a historical oddity, still common practice among teams who like to blindly apply coding standards that they don't understand. Long ago, most commercial programming languages were weakly

What does `m_` variable prefix mean?

北城余情 提交于 2019-12-03 00:27:28
问题 This question was migrated from Game Development Stack Exchange because it can be answered on Stack Overflow. Migrated 7 years ago . I often see m_ prefix used for variables ( m_World , m_Sprites ,...) in tutorials, examples and other code mainly related to game development. Why do people add prefix m_ to variables? 回答1: This is typical programming practice for defining variables that are member variables. So when you're using them later, you don't need to see where they're defined to know