What wonderful variable names have you seen?

There are two major problems that programmers will face in their careers: 1. How to protect hair 2. How to name variables. Sometimes seeing a weird variable name can make you laugh all day.

There is an enumeration called FiveLine. I don’t know what is the meaning of FiveLine. Click in to see the code

enum FiveLine { Gold, Wood, Water, Fire, Earth };

@陈大侠

The variable named FiveLine is the fusion and collision of Chinese culture and Western culture. The multi-phonetic character "xing" reflects the profoundness of Chinese!

Two arrays are named, one is called array and the other is called brray

One picture is called img, the second is jmg, then kmg 

Temporary variables tmp, tmq, tmr, tms

@paladin,@hzwer

If this continues, no more than 26 objects will be instantiated.

Before doing Android development, a colleague named the two buttons on the interface

One is called left and the other is you

@coder

double kill;

@王凯伦

Old league players...

There is a guy who likes to use pinyin abbreviations to name fields, so "performance appraisal" is named with the pinyin abbreviation jxkp. Even more excessive is to mix jxkp, jxkc, jxkh (performance appraisal, performance review, performance appraisal) in different tables/different pages/different rows on the same page

@What to eat for lunch

Usually those who write Java know 

StringBuilder sb 

But one day I found out that someone defined a variable

JsonObject jb 

I'm embarrassed to let her change it, so just stay inside.

@风雨潇潇

It stands to reason that JsonObject should be jo, this colleague should be deliberate, she wants to seek a bit of fun in the tedious code.

JButton JB疼

@和尚

The picture below is the project just taken over...

Reference link: www.zhihu.com/question/55894927

00

text

Seeing these weird variable names can really make people laugh from ear to ear. But variable naming is indeed an annoyance for some programmers, and sometimes it is difficult to think of a name that conforms to the specification.

Today I will introduce a tool to help developers solve the trouble of variable naming: CodeIf, this tool from Github, Bitbucket, Google Code, Codeplex, Sourceforge, Fedora Project, GitLab and other places to discover the names of other people's projects for your reference.

It supports mainstream editors: VS Code, Atom, Sublime Text

01

Installation: very simple

Search codelf in the plugin pane of VS Code and install it.

02

Basic use

Find the variable name you want to modify, right-click and click codeif to start searching.

Can filter language

03

Other functions

Biaoxing library management is currently not available, but the author said that it will Coming Soon, wait and see.

As mentioned earlier, codeif also has several other tutorials, which are not introduced one by one. The author of the project is definitely better than Lao Wang, specifically in his official Repo:

Project address: https://github.com/unbug/codelf

Tool address: https://unbug.github.io/codelf/

Hurry up and try to install it. Finally, those who like this article can forward it and read it. The following platforms have old shoppers. Welcome everyone to follow my account of the same name on other platforms.

           

Recommended reading

1.  Recommend a few fun projects

2.  Recommend several useful items

3.  Recommend several useful tools

Recommend a GitHub project every day that is interesting, fun and you may use.

 

Guess you like

Origin blog.csdn.net/weixin_47080540/article/details/112551575