• (cs) in reply to TehShrike
    TehShrike:
    Well, which was it? Many days and nights, or 20 hours?
    20 hours according to the calendar system this guy had rolled himself, which was several days by our system.
  • Alex (unregistered) in reply to Bryan
    Bryan:
    Only cowards use 'new' or 'malloc'.
    Yes, but only heroes use both.
    .. interchangeably
  • (cs) in reply to ted
    ted:
    Ken B.:
    Only cowards use 'new' or 'malloc'.
    Real programmers use butterflies.

    I didn't even click on the link and knew it was some fag linking xkcd. It's not clever. It's not funny. Just the word "butterflies" with a link under it and the short, useless, one sentence post was all I needed to know that you were linking the cartoon where the programmers iteratively one-up each other on how they input a program.

    It was funny to read when it came out. It's even funny when clicking on the Random button on the site and seeing it. It's NOT funny when someone links to it from a one-sentence post and thinks they're so fucking clever to have discovered xkcd.

    You probably still use lmgtfy and think you're so damn clever.

    It means in real life, you're an unoriginal hipster doofus.

    Got anything to do with sanitizing inputs to a SQL database, etc.? Link to Bobby Tables. Got a nerd-project slow-ass turing machine? Like a minecraft logic circuit from redstone? Link to the one where it's some guy alone in the world making a computer out of rocks. Got a story about password security or encryption? Link to the one where they beat the password out of the guy with a wrench.

    Fuck off. You're not clever.

    All I am saying...

  • Johnn (unregistered)
    After many days and nights of this worst-immaginable torment, Paul grimly got it working on the boss's laptop for a demo in less than twenty hours.

    Que? TRWTF; found.

  • Dan (unregistered) in reply to Bryan

    Agree! ...and, as much as possible, cleanup your mess -- use 'delete' or 'free'.

  • db (unregistered) in reply to XXXXX
    XXXXX:
    Actually not commenting code is a widely used form of employee evaluation. Give the employee a hige block of uncommented code and tell him or her to fix it. If he or she cannot determine what it does or how to debug and fix it, then the employee is not really good enough to work on the code in the first place.

    Developers often insert loopy, over-complicated, redundant, and useless red-herring code that breaks on certain specific dates and inputs just to test the new hires.

    Cool! I'll have to remember that excuse next time I have to try to justify some crappy code thrown together in a hurry.

  • anonymous (unregistered) in reply to dargor17
    dargor17:
    "Memory allocation? Only cowards use 'new' or 'malloc'." Does this mean he rewrote his own malloc? Is that even possible?
    #define ENOUGH_FOR_BILL (640*1024)
    
    void *malloc(size_t n) {
    	static char heap[ENOUGH_FOR_BILL], *p={heap};
    	char *ret=p;
    	if (p+n >= &heap[ENOUGH_FOR_BILL]) return NULL;
    	p+=n;
    	return ret;
    }
    
    void free(void *p) {
    	return;
    }
    

    Real programmers write their own malloc.

  • (cs) in reply to Henning Makholm
    Henning Makholm:
    Gunslinger:
    Ok, what is the deal with all these places having only a single author for large code projects?
    Selection bias. Such places/projects are disproportionately likely to be a source of WTFs.

    Also, disproportionately likely to have FNGs who aren't afraid of one of their dozens of tech savvy programmers find their post and use it against them. When there's only one guy who could finger you, it seems a lot safer - especially if that one guy's already flown the coup. Granted, if that one guy's still there, he has a lot more clout than any of the dozens of tech savvy coworkers one might have in a bigger shop, simply because there's so many fewer people to share the IT department clout with...

    But anyone working on a large project in isolation is going to create at least some WTFs.

    Comment before an eval of an unsanitized string in some code I wrote that will never see the light of day (Note: despite the fact this code will never be released, I've still fixed it. It now uses a lookup table to find a code reference and syntax description. If the syntax description parses, it calls the code reference with the described arguments. Otherwise it returns nothing. In either case, it runs faster than the crap that followed this comment.):

    /* Where do they get them from, and why do they send them

    • here? Well, the answer to the second is conditional
    • execution with a complete disregard to the contents, so I
    • guess we'll do that. */

    (I'll admit, TRWTF was actually the code processing the conditionals, that ran on every single active object for every action, to see if that action triggered any of the conditional functions for that object. But, at the time I wrote it, I only had five active objects, so it handled the "need" at the time.)

    dargor17:
    "Memory allocation? Only cowards use 'new' or 'malloc'." Does this mean he rewrote his own malloc? Is that even possible?

    On most systems, malloc doesn't even directly allocate its own memory. Instead, it invokes brk, sbrk, or whatever the actual system interface is for raw memory allocations, to do that. Malloc adds some accounting to that, so that free can work.

  • mrputter (unregistered) in reply to Bryan

    So in other words:

    Only cowards use 'new' xor 'malloc'.

Leave a comment on “Another Project, Another Place”

Log In or post as a guest

Replying to comment #:

« Return to Article