Inspired by One-letter variables
My template for coding full of double-letter defines and functions. Each new addition requires a lot of thought about how to call it.
aa - never use
bb - define begin end (most likely yours "all")
cc - can use for count of c???
dd - dp for down, beside with du, dr and dl
ee - define for single parameter lambda
ff - define for recursive lambda
gg - using for naming function when I spend more then 5 seconds to think about proper name
hh - never
ii - define for create and cin ints (input ints lol) (btw I see it is japanese meta, but I am sure I have started using it first)
jj - same but for arbitrary type
kk - never
ll - using ll = you know
mm - never
nn - never
oo - never but in good old times of icpc my teammate used it for defining infinity
pp - binsearch in template (comes from partition_point)
qq - never but looks like I must use it for something
rr - define for debug printing (comes from cerr)
ss - the only usage: stringstream ss;
tt - counter in program for count some operations (do not believe exec time)
uu - using/used and up, beside with ul, ur and ud
vv - I wanted once to add to template function for create multi-vector and call it vv but failed with design
ww - cant even imagine....
xx - geom??? better x2
yy - in template function to convert bool to yes/no
zz - same as xx
How often you using double-letter naming?









Well, I can just say I hardly use variable names consisting of more than 2 chars! However, I use "1 letter + 1 digit" more often. Below is an example (guess what it does):
I have to say such variable names give this code..."neatness"?
#define y1 Y1 // you know whyI do not know why :(
The reason is that
y1is defined as a function in the<cmath>library. Directly usingy1sometimes causes Compilation Error if the coder uses<bits/stdc++.h>. It is heard that someone once failed a whole problem (in an OI contest) due to this.But seemingly this does not happen in Codeforces?
it was me
The perils of
using namespace std;and global variables.In https://stackoverflow.com/questions/46251041/unable-to-use-y1-as-a-float-variable-in-c if the given code were to be translated to C++ then there will be two name collisions, for
y1and fordistance.y1 actually can be used without std::, or it should be user without it, it is in the C,not std library, so it not the perils of using namespace std;
you can try it yourself.
Sad! Forgot that C lib names are not enclosed in the
stdnamespace. There are other names that are used for Bessel functions too, namely j0, j1, jn, y0, y1, and yn.I can proudly say that I have never used any of these abominations, except
ssforstringstreamand an array of strings.I always use
ssforstringstreamandissforistringstream. It seems I’d always like to split a name into two (or more) words and then put these words' first letters together to be a name for my variables, functions, etc.Like
gdforgenerate_docsandggforget_goals(Maybe? I think if someone sees my code that hasgg, they would think it's referred togood_game).I use
aawhen I'm stressed out while getting wa2 on an implementation heavy problem in a contest and screaming for it to be overlol
qwq
Sometimes I use ii and jj as iterator names after i and j depending on the logic flow of the problem