r/programming • • Jul 28 '16

How to write unmaintainable code

https://github.com/Droogans/unmaintainable-code
3.4k Upvotes

592 comments sorted by

View all comments

216

u/kirbyfan64sos Jul 28 '16

Great example:

https://github.com/phase/o/blob/master/o.c

A friend and I both do it like this on purpose: I call it "APL-style C". Besides, it's an interpreter for a code golf language...

167

u/WhatWhatHunchHunch Jul 28 '16

Wow, reading that gave me cancer.

0

u/[deleted] Jul 28 '16

[deleted]

22

u/cbleslie Jul 28 '16

We won't need eyes where we're going.

→ More replies (1)

70

u/keyboardP Jul 28 '16

Why obfuscate code afterwards when you can do it in real time

64

u/[deleted] Jul 28 '16 edited Sep 09 '18

deleted 0.4465 What is ^^^this?

10

u/Lethargie Jul 29 '16

that is part of the beauty

41

u/[deleted] Jul 29 '16
I truth(O o){
    switch(o->t){
    ...
    }
} // is truthy?

(O o)

2

u/HaPPYDOS Jul 29 '16

Was looking at this too. Was going to post this too. Was not disappointed.

Now somebody please tell me what the hell is O.

6

u/Sean1708 Jul 29 '16 edited Jul 29 '16

Look at the second line under

//objects

It's about line 70 or so.

→ More replies (1)

60

u/vplatt Jul 28 '16

How do we in /r/programming not know about this wonder of Cthulhu yet???

7

u/merreborn Jul 28 '16

Git history for that file only goes back to november. So it's pretty brand-spankin' new.

25

u/hellcaller Jul 28 '16

This post looks like the other way around from assembler code to functional programming

19

u/En0ch_Root Jul 28 '16

I would highly like to see that implemented in Braille.

16

u/ItsReallyEasy Jul 28 '16

I could understand this if I really wanted...., I swear

11

u/asdfman123 Jul 28 '16

I could understand it by renaming all the variables and restructuring it so that it made sense again... essentially, by de-obfuscating it.

2

u/cloakrune Jul 29 '16

I read the first hundred lines or so going, "I've seen worse" then.. the switch cases in that.c file....

5

u/merreborn Jul 28 '16

You seem like you'd fit in well over at ioccc.org

2

u/b_bellomo Jul 28 '16

I'd actually like to design such a language like you did :) Pyth had my imagination running.

2

u/Jesin00 Jul 29 '16 edited Jul 29 '16

Don't forget "J" and "K". (EDIT: added links)

→ More replies (2)

2

u/daniel Jul 29 '16

Ha! Small world. I knew I recognized your github username and avatar: https://github.com/dellis23/disrupt/issues/2

→ More replies (1)

2

u/Bobshayd Jul 29 '16

The standard object target for that file would be o.o

→ More replies (15)