Jump to content

  • Log In with Google      Sign In   
  • Create Account

Unmaintainable code

  • You cannot reply to this topic
61 replies to this topic

#41   Members   

2993
Like
1Likes
Like

Posted 21 November 2013 - 07:05 PM

At first I thought my computer was being so slow it wasn't loading at all... then after a minute or so I decided to scroll for some reason. Oh god, what's with all that indentation O_O


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.

#42   Members   

24990
Like
9Likes
Like

Posted 21 November 2013 - 07:12 PM

*
POPULAR

According to the copyright he worked on this for 7 years.

How do you…

 

 

Words fail.

 

 

L. Spiro



#43   Members   

234
Like
12Likes
Like

Posted 15 January 2014 - 09:12 AM

*
POPULAR

A timelapse video of the development cycle:

 

Bloody_typing_by_Rai_hime1995.gif


Edited by gfxCahd, 15 January 2014 - 09:13 AM.


#44   Members   

5849
Like
1Likes
Like

Posted 15 January 2014 - 03:29 PM

According to the copyright he worked on this for 7 years.

How do you…

 

 

Words fail.

 

 

L. Spiro

 

I always did wonder why the game was in development for so long.  Not anymore =)



#45   Members   

517
Like
1Likes
Like

Posted 08 February 2014 - 12:02 AM

Yeesh, and I thought my code formatting was bad!

This code is what the results of taking a .cpp file and sticking it into a blender would look like. 

Bad bad bad bad bad!


My website! yodamanjer.com
My development blog!

Follow me on Twitter! @jwg1991
 


#46   Members   

13125
Like
2Likes
Like

Posted 09 February 2014 - 02:04 AM

Yeesh, and I thought my code formatting was bad!

This code is what the results of taking a .cpp file and sticking it into a blender would look like. 

Bad bad bad bad bad!

 

It looks more like C with classes than C++ to be honest. I mean, he's using raw arrays, raw pointers, etc.. pretty much using classes only for polymorphism (if even), hardly ever using the standard library. Instead of initializing a hash map - or even just using a switch statement - the code runs through an entire array every time it needs to convert between a character and its enum value (check out WinInput.cpp). It's a nightmare and one wonders how it even works together at all.


“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”


#47   Members   

532
Like
1Likes
Like

Posted 28 February 2014 - 09:55 AM

This is utterly incredible. I'm actually flabbergasted that this could ever conceivably have become a product that someone could actually sell.



#48   Members   

7603
Like
5Likes
Like

Posted 28 February 2014 - 01:04 PM

*
POPULAR

 

This program looks like it might have been developed using the following rule: you can only add new code, you can never delete or change existing code.Actually, that gives me an idea...


I like this new paradigm, I think the first two years of college should strictly enforce this, just to drive into the minds of students how vital it is to think ahead, before you begin writing anything.

Is their any formal name for this scheme, or should it be called the rip-off programming paradigm.

 

 

write-only programming ?


I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

#49   GDNet+   

2409
Like
1Likes
Like

Posted 28 February 2014 - 02:24 PM

I also thought for sure that this was generated code...

#50   Members   

1410
Like
1Likes
Like

Posted 28 February 2014 - 09:05 PM

write-only programming ?

That is a new one, but strangely familiar.

We used to have (20y+ ago) some custom engineered computers available in school, worked well. Except the floppy drive (which was not custom made, probably just whatever was the cheapest around) - its ability to read what it wrote was kind of hit-and-miss. So, everyone called their floppies write-only storage.

Yeah. The only time "The **** ate my programming homework." was actually accepted by teachers (i swear, i am not making this up).

Oh, good old days.

#51   Members   

2743
Like
2Likes
Like

Posted 04 March 2014 - 07:11 AM

I refuse to believe this is how it was programmed.

 

He's got to be screwing with us. Obfuscation, perhaps?


"I would try to find halo source code by bungie best fps engine ever created, u see why call of duty loses speed due to its detail." -- GettingNifty


#52   Members   

9105
Like
2Likes
Like

Posted 04 March 2014 - 08:40 AM

I refuse to believe this is how it was programmed.

 

He's got to be screwing with us. Obfuscation, perhaps?

Ohhh that would be quite the entertaining possibility :D


"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

 

My journals: dustArtemis ECS framework and Making a Terrain Generator


#53   Members   

111
Like
1Likes
Like

Posted 29 March 2014 - 11:01 AM

When I opened that link, for some reason it dropped me 2/3 of the way down the page. There was code on the far right side of my screen... none of it looked remotely intelligible...

I scrolled up a few lines, and noticed there were comments that were equally unintelligible...

I thought to myself, "I bet they have a whole bunch of uncommented global variables with less-than-perfectly descriptive names." I wasn't disappointed. Then I realized I was, in fact, *very* disappointed.

 

At least comparing my code to theirs makes me feel a little better about myself as a programmer.



#54   Members   

2025
Like
1Likes
Like

Posted 26 April 2014 - 06:08 PM

According to the copyright he worked on this for 7 years.

How do you…

 

 

Words fail.

 

 

L. Spiro

mouhouhaha, I love.



#55   Members   

244
Like
1Likes
Like

Posted 27 April 2014 - 02:21 AM

Wow theres one hell of an if statement in there:

 

if(((((findLengthfast(&rotatetarget)>150&&(i!=0&&k!=0))||(findLengthfast(&rotatetarget)>50&&player[0].rabbitkickragdoll/*currentanimation==rabbitkickanim*/&&(i==0||k==0)))&&normaldotproduct(rotatetarget,player[k].coords-player[i].coords)>0)&&((i==0||k==0)||((player[i].skeleton.oldfree==1&&k!=0&&animation[player[k].currentanimation].attack==neutral)||(player[k].skeleton.oldfree==1&&i!=0&&animation[player[i].currentanimation].attack==neutral)||(player[i].isFlip()&&!player[i].skeleton.oldfree&&(i==0||k==0))||(player[k].isFlip()&&!player[k].skeleton.oldfree&&(i==0||k==0))||(i==0||k==0))))||((player[i].targetanimation==jumpupanim||player[i].targetanimation==jumpdownanim||player[i].isFlip())&&(player[k].targetanimation==jumpupanim||player[k].targetanimation==jumpdownanim||player[k].isFlip())&&(i==0||k==0)&&(!player[i].skeleton.oldfree&&!player[k].skeleton.oldfree)))


#56   Members   

2025
Like
2Likes
Like

Posted 27 April 2014 - 05:25 AM

Wow theres one hell of an if statement in there:

You can see a lot of hard coded value in this hell too, this file is a joke from A to Z.

Imagine the scene : "We have to change the jump height value"
Programmer of this file : "WHAT ?!"


Edited by Alundra, 27 April 2014 - 05:25 AM.


#57   Members   

4863
Like
2Likes
Like

Posted 09 November 2016 - 08:54 AM

This needs a bump to show what not to do when writing code.


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


#58   Members   

7665
Like
1Likes
Like

Posted 11 November 2016 - 01:03 AM

<!-- Build website. -->
<exec dir="${src-dir}"
 executable="make"
 failonerror="true"
 searchpath="true"
>
    <arg value="html-no-deps"/>
</exec>

Like using xml to write a "make html-no-deps" command-line?

 

Oh no, that's normal practice.



#59   Members   

710
Like
1Likes
Like

Posted 19 November 2016 - 04:01 PM

I nearly choked when I saw the number of externs he had. Dose this even run?



#60   Members   

4450
Like
1Likes
Like

Posted 04 December 2016 - 05:10 PM

My favourite line (7201): http://hg.icculus.org/icculus/lugaru/file/97b303e79826/Source/GameTick.cpp#l7201

 																										if(((((findLengthfast(&rotatetarget)>150&&(i!=0&&k!=0))||(findLengthfast(&rotatetarget)>50&&player[0].rabbitkickragdoll/*currentanimation==rabbitkickanim*/&&(i==0||k==0)))&&normaldotproduct(rotatetarget,player[k].coords-player[i].coords)>0)&&((i==0||k==0)||((player[i].skeleton.oldfree==1&&k!=0&&animation[player[k].currentanimation].attack==neutral)||(player[k].skeleton.oldfree==1&&i!=0&&animation[player[i].currentanimation].attack==neutral)||(player[i].isFlip()&&!player[i].skeleton.oldfree&&(i==0||k==0))||(player[k].isFlip()&&!player[k].skeleton.oldfree&&(i==0||k==0))||(i==0||k==0))))||((player[i].targetanimation==jumpupanim||player[i].targetanimation==jumpdownanim||player[i].isFlip())&&(player[k].targetanimation==jumpupanim||player[k].targetanimation==jumpdownanim||player[k].isFlip())&&(i==0||k==0)&&(!player[i].skeleton.oldfree&&!player[k].skeleton.oldfree))){

Edited by Alessio1989, 04 December 2016 - 05:12 PM.

"Recursion is the first step towards madness." - "Skeggǫld, Skálmǫld, Skildir ro Klofnir!"
Direct3D 12 quick reference: https://github.com/alessiot89/D3D12QuickRef/