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

Pages: 1-

Old code

Name: Anonymous 2010-04-07 17:52

Do you ever look at code you wrote years (even months) ago and think, "Fuck me, this is shit"?

Is there a threshold age where anything older than that is guaranteed to suck, or is there a cutoff date after which code is generally up to your current standards?

A threshold age would indicate that you are still learning; any cutoff date will probably be when you finished (and fully understood all the concepts of) SICP.

Name: Anonymous 2010-04-07 18:04

any cutoff date will probably be when you finished

You can't finish learning, think about what it means that you stop regarding your past self as shit then.

Name: Anonymous 2010-04-07 18:09

I have a few fundamental rules for determining whether or not my code is shit:
1. Am I writing it now?
   If so, it is incomplete and therefore shit
2. Did I write it sometime in the past?
   It's shit.

Name: Anonymous 2010-04-07 18:30

This is true if you think about it strongly.

Name: Anonymous 2010-04-07 18:40

>>3
1. Someday I shall write excellent code.
2. On that day, and forever after, that code will be shit.

Name: Anonymous 2010-04-07 18:41

I get the same feeling, but when I look at my old /prog/ posts.

Name: Anonymous 2010-04-07 19:02

>>6
I have written a few posts here that I continue to have good feelings about.

Name: Anonymous 2010-04-07 19:05

>>7
And they all end in ``MY ANUS''.

Name: Anonymous 2010-04-07 19:16

>>7
HAVE GOOD FEELINGS ABOUT MY ANUS

Name: Anonymous 2010-04-07 19:16

>>8
END MY ANUS

No seriously, I was going to point out that they weren't typical /prog/ asshattery, but I figured that would go without saying. Of course it doesn't, I'm a fool.

Name: Anonymous 2010-04-07 19:26

ASSHAT MY ANUS

Name: Anonymous 2010-04-07 20:00

>>10

It doesn't matter, really.

Name: Anonymous 2010-04-07 20:24

More like the opposite. I think I've lost the determination to write huge, complex sequences of code now.

Name: Anonymous 2010-04-07 20:50

When I was doing my projects in C or C++, I often returned to the code I wrote and asked myself, "what was I thinking". Ever since I've found Haskell and started working with it, I don't have this same problem any more. It's really liberated my mind!

Name: Anonymous 2010-04-07 21:08

>>14
Using Haskel is no excuse for not going back to review your old code.

Name: Anonymous 2010-04-07 21:25

This happened to me, but after one day. Wrote some code that was way too complicated 150ish lines in 3 hours, The next day I was like "What the fuck is this shit, why don;t I just do it like this..." wrote 40lines in 30 minutes that did the same thing

Name: Anonymous 2010-04-07 21:36

>>16
I always do a rewrite. The trick is to start the rewrite before finishing the first one, and soon enough to complete it before the first one would have been finished.

Name: Anonymous 2010-04-07 22:22

sometimes ive come back to code, and thought the fuck is this inefficiency, started editting it, then re-realized a problem with that thinking, and then realized why i had done in that  way in the first place

Name: Anonymous 2010-04-07 22:58

>>18
This post strikes me as uncannily different when I compare it to every other post on this page.

Name: Anonymous 2010-04-07 23:00

>>19
Are you suggesting that >>18-1 ZOMG OPTIMIZED are actually the same person?

Name: Anonymous 2010-04-07 23:16

It sounds like you guys would be interested in something called FizzBuzz. Google it. Post results. I wrote a FizzBuzz program and I was able to shorten it quite a bit after I finished writing it.

Name: Anonymous 2010-04-08 1:44


#include <stdio.h>

int
main(){
    int mult = 0;

    for (mult = 1; mult <= 100; mult++){
        if (mult % 5 == 0){
            if (mult % 3 == 0){
                puts("FizzBuzz");
            } else {
                puts("Buzz");
            }
        } else if (mult % 3 == 0){
            puts("Fizz");
        } else {
            printf("%d\n", mult);
        }


    } return 0;
}


Oh yeah! Faster than most comp sci graduates
... Beat by an underage b&!

Name: Anonymous 2010-04-08 6:21

>>22
Nice! If only it were useful. By the way, those modulo operations are terribly inefficient.

Also, back to you know the rest

Name: Anonymous 2010-04-08 9:04

>>23
Do you enjoy doing things prematurely? Like, optimizations?

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