Jump to content
  • Advertisement
Sign in to follow this  
Michael Tanczos

New forum - Coding Horrors

This topic is 1953 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm just popping in a new post here for this forum we're kicking off.   The description for this forum is simply this:

 

Discuss software design issues, quirky things you've found, asshat approaches to problems, shitty code your co-workers wrote, shitty code you yourself wrote and wondered what you were thinking, elegant problem solutions (to flip things around), design patterns, "hey look I can write a compiler with one line of code because I'm so clever" type stuff

 

This is a for-fun forum where you can pretty much discuss software design issues including such as:

 

  • Why every programmer should use singletons
  • Why OpenGL is far superior to DirectX
  • Using Goto is perfectly fine
  • Why professional programmers who only code during their day jobs will never be as good as those who code outside of work
  • Why commenting EVERY SINGLE LINE OF CODE is important   // add x to y and store inside of sum

 

 

   ....
   // tCount keeps showing up negative here for some reason..  it should never be negative
 
   tCount = sqrt(tCount*tCount);  // Fixed!
 

 

It is for posting pieces of code that we can all look back on and laugh about.   Code samples are also appreciated.. we love code.   We also love related comics as well.

 

 

computer_problems.png

 

 

 

Glob pattern matcher anyone (*)?

 

main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return*t-42?*s?63==*t|*s==*t&&m(s+1,t+1):!*t:m(s,t+1)||*s&&m(s+1,t);}

 

Share your frustrations.. share your triumphs.. Let the games begin.

Edited by Michael Tanczos

Share this post


Link to post
Share on other sites
Advertisement

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 ?

Edited by Tournicoti

Share this post


Link to post
Share on other sites

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

 

  • Using Goto is perfectly fine

This just popped into my mind:

goto.png

 

Brilliant.  =)    I was trying to find a comic that embodied this idea.. yours is better.   

Share this post


Link to post
Share on other sites

   ....
   // tCount keeps showing up negative here for some reason..  it should never be negative
 
   tCount = sqrt(tCount*tCount);  // Fixed!
 

o god, i laughed far too hard at this one.

Share this post


Link to post
Share on other sites

33 parameters? Yikes. Reminds me of something I did once when I was learning, a long long time ago. I wrote a function that took 25 parameters. It was for a tile engine, and the 25 parameters represented the values of each tile in a block of 5x5 tiles that were used to calculate some sort of classification code. Even worse, I named them all letters of the alphabet, so I had something like int calculateMegaTileCode(char a, char b, char c....). It was... man, it was horrible. I spent hours laboriously writing that function as a HUGE chunk of if (a==0 && b==0) statements. I was actually proud of it and myself when I finished it. I was 14, and I felt like I had just completed the most complicated and awesome piece of code anyone had ever written. Eight years later when I looked at it just for nostalgia's sake I nearly wept.

Share this post


Link to post
Share on other sites

33 parameters? Yikes. Reminds me of something I did once when I was learning, a long long time ago. I wrote a function that took 25 parameters. It was for a tile engine, and the 25 parameters represented the values of each tile in a block of 5x5 tiles that were used to calculate some sort of classification code. Even worse, I named them all letters of the alphabet, so I had something like int calculateMegaTileCode(char a, char b, char c....). It was... man, it was horrible. I spent hours laboriously writing that function as a HUGE chunk of if (a==0 && b==0) statements. I was actually proud of it and myself when I finished it. I was 14, and I felt like I had just completed the most complicated and awesome piece of code anyone had ever written. Eight years later when I looked at it just for nostalgia's sake I nearly wept.

when i was starting out in lua(and in programming in general), i wrote a risk clone(the board game), i hard-coded each country connection by using huge if/else if blocks, the pain of making a small change was....intense... worse yet, i repeated the huge if/else if block at several diffrent points in the program.

 

the game was never finished, and the file was a couple megs big(i didn't even break the game into seperate files cause i didn't know how).

 

it probably stands as the worse most complicated thing i've ever programmed. (and for some reason, i was really proud of what i was doing.)

Share this post


Link to post
Share on other sites

While helping with QA for Lotus Notes, I found my favorite all-time bug.  The symptom was that somehow application processing became gated by mouse interrupts.  So nothing would process at all unless you moved the mouse.  Better, the faster you moved the mouse the faster things got done!  Interrupt processing must have become entangled somehow, but it was really fun to demonstrate!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!