How to write unmaintainable
code
10 minutes guide
sat·ire
/ˈsaˌtī(ə)r/
noun
the use of humor, irony, exaggeration, or ridicule to expose
and criticize people's stupidity or vices, particularly in the
context of contemporary politics and other topical issues.
synonyms: mockery, ridicule, derision, scorn,
caricature; More
Naming
Use _ and __ as
identifiers. If (_) __._()
Single letter
variable names
$a = 1;
$b = 2;
$c = $a + $b;They’re the best
Use comments // declare variable a
// and assign 1 to it
$a = 1;
Make sure they are redundant
Use comments
// in the following block
// we add two variables:
// named variable a and variable b
// both of them integers
// declare variable a
// and assign integer 1 to it
$a = 1;
// declare variable b
$b = 2;
// sum the two variables a and b
// declared and initialized above
// and assign the result to
// a new variable c
$c = $a + $b;
Never update tham, and also lie
a bit
A.C.R.O.N.Y.M.S.
var AM = new
ApplicationModel();
var PD = new
ProductDepartment();
var TM = new
TransactionManager();
A.C.R.O.N.Y.M.S.
AM.persist(
PD.resolveBy(
TM , 5));
A.C.R.O.N.Y.M.S.
RN
CM
TBR
Also great for module names
Use the wrong
ident
if (a)
if (b) x=y;
else x=z;Also never use {}
Reuse Names
Use scope hell
var text = 'outside';
function logIt(){
console.log(text);
var text = 'inside';
};
logIt();
Code names
must not match
screen names
In code it is name zip
Just straight-up
lie about what
things are/do isValid(x)
Every method does a little bit
more (or less) than its name
suggests.
Converts X to double
Stores X in the database
Sends X to analytics service
Also returns false if configuration
file is wrong
CapiTaliSaTion
Randomly capitalize the first
letter of a syllable in the middle
of a word.
DockAbleModeLessWindow
getTransAction
incRementCustOmerScore
Be abstract
PerformFunction
DoIt
Handle
Do_args_method
execute
Single letter
variable names a=(b+z)/c;
They’re really the best
(take 2 of n)
Names From
Mathematics
openParen =
(slash + asterix)
/equals;
Bedazzling
Names
marypoppins =
(superman+starship)
/god;
function stop() {
//hammer time
}

How to write unmaintainable code