Those amazing variable names!

Source: Uncle Mai Programming

Preface

A good variable name can make people who read the code (including those who write it) feel comfortable physically and mentally, but a "weird" variable name may drive a programmer crazy.

Today is the Weird Variable Name Award !

text

(Note: The following materials are collected from the Internet)

The first thing to come up is the door number of a company’s computer room:

80f0c0b193012652bc7cb244d322a778.png

I guess this director may be a Hu Jianren.

The second player is from a major domestic manufacturer - Alibaba:

50e4e4167d6c26514a8937e87af71ed3.png

It is precisely because of this error message UnionPaythat the customer service phone number of UnionPay next door was overwhelmed!

e0a4ff9aaf85dc43b7014d3405be39e3.png

But in fact, what this development wants to express is to merge the error reports when order payment , but due to...

"Combined payment" in English is "combined payment". This problem occurs because Taobao engineers do not understand the word combined.

Variable names with built-in obfuscation function

f45691ffb4676b28a1a38f86e1b93d55.png

What's this? Garbled code?

Announce the correct answer:

1666ad141fbc79fe6c0ea8937a97f714.png

What is this? Recipe ?

public String calculateTomAndJerryHappyTogetherTotalTimeAndReturnToThePreviousLevel(){

}

I thought you had a redundant code:

xxxxxx = "网络操作维护中心(主任室)" # 消息详细信息

I would rather use Chinese variable names

C language contestants:

int deit; //deit -> date
int riqi; //riqi -> 日期

Please, please let me go.

lv = 0x33FF33

This contestant from Python's variable name made me lose at least 100 hairs, and red = 0xFF0033I didn't know lvit meant green until I saw it below!

Please, senior, please stop using pinyin for naming! ! !

I have long heard of the pinyin nomenclature, but it’s nothing more than that!

let JianCeNianDu = ...;
let NongTianChanLiang = ...;
let DiKuaiBinaMa = ...;
let FeiLiaoHanShuiLv = ...;

Is this acceptable~

let jianceniandu = ...;
let nongtianchanliang = ...;
let dikuaibianma = ...;
let feiliaohanshuilv = ...;

When looking at the actual code:

let jcnd = ...;
let ntcl = ...;
let dkbm = ...;
let dkbm = ...;
let flhsl = ...;
9d33a4a4c69335db5bc98b25a69e50d6.png

Chinese character variables are really cool

There used to be a program Yuan who was transferred from the sales department . Perhaps because of her poor English skills, she always used Pinyin nomenclature to declare variables:

class Dingdan {
  private String yuanliaomingcheng;
  private int chanpinshuliang;
  private double chanpinjiage;
  private long chanpinxiaoliang;
  private int shifoushouchu;
}

Later, the development boss couldn't bear it anymore and said that he couldn't understand Pinyin and asked her to use Chinese as variable names in the future.

After that, the program 's code became like this:

class 订单 {
  private String 原料名称;
  private int 产品数量;
  private double 产品价格;
  private long 产品销量;
  private int 是否售出;
}

Doesn’t the pinyin nomenclature lack a tone?

This contestant added Pinyin tones to the variables (1234 respectively represents āáǎà), please read it~

8084fbb5e7a10c138db5ad1c6a904219.png

Most programming languages ​​these days support Unicodeidentifiers, and using Chinese characters is better than using Pinyin or even Pinyin abbreviations.

Nomenclature from Tushita Palace

the_eight_divinatory_sybmol_000
the_eight_divinatory_sybmol_001
the_eight_divinatory_sybmol_010
the_eight_divinatory_sybmol_011
the_eight_divinatory_sybmol_100
the_eight_divinatory_sybmol_101
the_eight_divinatory_sybmol_110
the_eight_divinatory_sybmol_111

Do you know what this means?

Announce the correct answer:

the_eight_divinatory_sybmol_000 = "坤"
the_eight_divinatory_sybmol_001 = "震"
the_eight_divinatory_sybmol_010 = "坎"
the_eight_divinatory_sybmol_011 = "兑"
the_eight_divinatory_sybmol_100 = "艮"
the_eight_divinatory_sybmol_101 = "离"
the_eight_divinatory_sybmol_110 = "巽"
the_eight_divinatory_sybmol_111 = "乾"

Good guy, this is a gossip picture !

d90836984eeae292426dad0dab4dd6fb.png

Code from a game development.

In addition, there is another way to write Bagua diagramtrigram_sun : (Qian), trigram_moon(Kun), trigram_water(Kan), (Li), ( Xun trigram_fire), (Gen ), (Zhen ), (Dui).trigram_windtrigram_mountaintrigram_thundertrigram_marsh

at last

Through today’s article, have you all learned how to declare variables?

What other amazing variable names have you seen ? Share them together so that we can all learn (and have fun).

---END---

Guess you like

Origin blog.csdn.net/Ch97CKd/article/details/132893075