Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Case Analysis of CSS General naming rules

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

Most people do not understand the knowledge points of this article "case Analysis of CSS General naming rules", so the editor summarizes the following contents, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "CSS General naming Rule case Analysis" article.

Three general naming rules for CSS normalization

Camel nomenclature:

As its name suggests, it refers to the mixed use of uppercase and lowercase letters to form the names of variables and functions. For example, here is the same function named with camel naming and underscore in CSS canonical naming, respectively:

PrintEmployeePaychecks (); print_employee_paychecks ()

* each logical breakpoint in the function name is marked with an uppercase letter; the second function name is marked with an underscore, and each logical breakpoint in the function name is marked with an underscore.

Camel naming has become more and more popular in recent years, and it is often used appropriately in many new function libraries and environments such as MicrosoftWindows. On the other hand, underlining has become popular since the advent of c, and it is very common in many older programs and environments such as UNIX.

Hungarian nomenclature

It is widely used in environments like MicrosoftWindows. The Hungarian naming convention for variables (including macros) used in Windows programming was proposed by a capable Microsoft programmer, Charles Simone (CharlesSimonyi).

The Hungarian nomenclature in CSS canonical naming identifies the scope and type of the variable by prefixing it with the symbol identification of the corresponding lowercase letters before the variable name. These symbols can be used at the same time, the order is first m _ (member variable), then pointer, then simple data type, and so on.

For example: m_lpszStr represents a long pointer member variable that points to a string that ends with a 0 character.

The key to Hungarian naming is that the name of the identifier begins with one or more lowercase letters as a prefix; the prefix is followed by an uppercase word or combinations of words that indicate the purpose of the variable.

Pascal nomenclature:

Similar to camel nomenclature. However, in CSS normalized naming, camel naming is lowercase, while Pascal naming is capitalized, such as:

DisplayInfo (); stringUserName

Both use Pascal nomenclature. In C #, Pascal nomenclature and camel nomenclature are the majority.

A summary of three CSS normalized naming conventions:

MyData is an example of Pascal naming.

And myData is a camel nomenclature, it * words * letter lowercase, the following word capitalized, looks like a camel.

While iMyData is a Hungarian nomenclature, its lowercase I indicates its type, followed by the same name as Pascal, indicating the purpose of the variable.

The above is the content of this article on "case Analysis of CSS General naming rules". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report