Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

The /prog/matic programmer

Name: Anonymous 2012-09-27 15:16

ANyways, so... I was reading The Pragmatic Programmer [1] and it occurred to me that we should probably boil these principles down for the novices amongst us. ITT things you want to carve into your colleagues' faces.

* KEEP IT FUCKING SIMPLE, MOTHERFUCKER!
* You're code is not ``clever'', it is autistic.
* Code is /not/ poetry or art. Go away! Fuck your OCD.
* This shit has been solved a thousand times over.
* You do not need to design with the latest and greatest in gang-of-four approved OOP design patterns, using infinitely scalable NoSQL solutions in hip new languages that compile down to JavaScript (srsly WTF?!), just to create a CRUD application.
* Not everyone gets off on code, some of us just want to make a living doing the least amount of effort that is required to deliver a consistent quality for an extended period of time.

I swear by god if I see one more AbstractControllerFactoryInterface

[1] http://pragprog.com/the-pragmatic-programmer, easily found online.

Name: 72 2013-05-13 10:53

Oh, I do not even need the s = 0; in the fall-through switch...

So, last submission:

#include <stdio.h>

void print(unsigned int x)
{
    unsigned int d = 1000000000;
    while (d > 1 && x / d == 0) d /= 10;
    while (d > 1) {
        putchar('0' + x / d % 10);
        d /= 10;
    }
    putchar('0' + x % 10);
    putchar(' ');
}

int main()
{
    unsigned int i = 1;
    int s = 1, c = getchar();
    while (c != EOF) {
        switch (s) {
        case 1:
            print(i++);
        case 0:
            putchar(c);
            s = (c == '\n');
        }
        c = getchar();
    }
    return 0;
}


I hope you enjoyed my suffering. ;__;

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List