New forum - Coding Horrors

Started by
16 comments, last by Oberon_Command 11 years, 1 month ago

One of the best comments I have found in a code base was "Ow magic numbers, guide us to the light!"

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

Advertisement

I wish this forum would've been around when I posted this!

Your wish is my command.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

That must be like the first time a thread is four years older than the forum it's in.

Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

if (x^2>0) then patato else tomato

is it supid enough for this new forum ? ^^

Sorry =)

This is stupid because the answer is always potatoph34r.png

Of course you can replace patato with tomato. If you prefer tomato. Do you like patato ?

Wrong. Your code is obfuscated way of checking if (x != 0)

I can't find the screenshot any more, but in one of my past companies, we had cool functions like this one:


int GetID()
{
    return 4;
}

and this function would be overloaded for each and every object, with different (well, not always, as I noticed during debugging), typed by hand (sometimes commented // this ID is 4!) value.

Yay!

If only noobs were boobs... the world would be a better place.

post removed because of stupid contents ;)

should wake up before I post...

@Mantistongue.png

Yes, not great wink.png, let me elaborate :

optimistic version :

if (x==0) then rolleyes.gif else angry.png

pessimistic version :

if (x!=0) then angry.png else rolleyes.gif

Now it should make perfectly sense blink.png (cf ZE state of the art in term of conditional branch)

By the way, do you like boats ? (I'm about to create a poll on that)

ineffective_sorts.png

Sleep sort!
#!/bin/bash
function f() {
    sleep "$1"
    echo "$1"
}
while [ -n "$1" ]
do
    f "$1" &
    shift
done
wait
example usage:
./sleepsort.bash 5 3 6 3 6 3 1 4 7
edit: removed link to source since it apparently has NSFW material that I didn't notice before posting.

This topic is closed to new replies.

Advertisement