You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-39Lines changed: 34 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -221,16 +221,15 @@ Much of the skill in writing unmaintainable code is the art of camouflage, hidin
221
221
Include sections of code that are commented out but at first glance do not appear to be.
222
222
223
223
```js
224
-
for(j=0; j<array_len; j+=8)
225
-
{
226
-
total+= array[j+0 ];
227
-
total+= array[j+1 ];
228
-
total+= array[j+2 ];/* Main body of
229
-
total += array[j+3 ]; * loop is unrolled
230
-
total += array[j+4 ]; * for greater speed.
231
-
total += array[j+5 ];*/
232
-
total+= array[j+6 ];
233
-
total+= array[j+7 ];
224
+
for (j=0; j<array_len; j+=8) {
225
+
total+= array[j+0];
226
+
total+= array[j+1];
227
+
total+= array[j+2];/* Main body of
228
+
total += array[j+3]; * loop is unrolled
229
+
total += array[j+4]; * for greater speed.
230
+
total += array[j+5];*/
231
+
total+= array[j+6];
232
+
total+= array[j+7];
234
233
}
235
234
```
236
235
@@ -242,14 +241,14 @@ Struct/union and typedef struct/union are different name spaces in C (not in C++
242
241
243
242
```c
244
243
typedefstruct {
245
-
char* pTr;
246
-
size_t lEn;
244
+
char* pTr;
245
+
size_t lEn;
247
246
} snafu;
248
247
249
248
struct snafu {
250
-
unsigned cNt
251
-
char* pTr;
252
-
size_t lEn;
249
+
unsigned cNt
250
+
char* pTr;
251
+
size_t lEn;
253
252
} A;
254
253
```
255
254
@@ -441,10 +440,9 @@ Discourage any attempt to use external maintenance contractors by peppering your
441
440
This stuff is too clever for the dullard at Software Services Inc., who would
442
441
probably use 50 times as memory & time using the dumb routines in <math.h>.
443
442
*/
444
-
class clever_SSInc
445
-
{
443
+
class clever_SSInc {
446
444
.. .
447
-
}
445
+
}
448
446
```
449
447
450
448
If possible, put insulting stuff in syntactically significant parts of the code, as well as just the comments so that management will probably break the code if they try to sanitise it before sending it out for maintenance.
@@ -515,10 +513,9 @@ Go wild with encapsulation and oo. For example:
515
513
516
514
```java
517
515
myPanel.add( getMyButton() );
518
-
privateJButton getMyButton()
519
-
{
516
+
privateJButton getMyButton() {
520
517
return myButton;
521
-
}
518
+
}
522
519
```
523
520
524
521
That one probably did not even seem funny. Don't worry. It will some day.
@@ -653,18 +650,17 @@ Always look for the most obscure way to do common tasks. For example, instead of
653
650
654
651
```c
655
652
char *p;
656
-
switch (n)
657
-
{
658
-
case 1:
659
-
p = "one";
660
-
if (0)
661
-
case 2:
662
-
p = "two";
663
-
if (0)
664
-
case 3:
665
-
p = "three";
666
-
printf("%s", p);
667
-
break;
653
+
switch (n) {
654
+
case 1:
655
+
p = "one";
656
+
if (0)
657
+
case 2:
658
+
p = "two";
659
+
if (0)
660
+
case 3:
661
+
p = "three";
662
+
printf("%s", p);
663
+
break;
668
664
}
669
665
```
670
666
@@ -707,12 +703,11 @@ d = c;
707
703
Smuggle octal literals into a list of decimal numbers like this: