Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

Post your vote for Worst Code Ever and explain why.

OP AdamOutler

1st May 2013, 05:11 AM   |  #1  
I think this should be fun.

Post an example of the worst code you've dealt with and why. Here's mine:


Google ADK2012
The ADK2012 is a cornerstone of home automation and input/output of sensors and data to and from Android devices. The ADK sets the example of how it "should be" done. However, for reasons in the video below, including violation of all Arduino Code Guidelines and adherance to several Unmaintainable Code guidelines, I am nominating the ADK2012 as the Worst Code Ever.



here's the ADK2012 code: http://pastebin.ubuntu.com/5621322/
Last edited by AdamOutler; 2nd May 2013 at 02:28 AM.
The Following 2 Users Say Thank You to AdamOutler For This Useful Post: [ View ]
1st May 2013, 06:19 AM   |  #2  
Member
Thanks Meter: 3
 
54 posts
Join Date:Joined: Jul 2010
Not really pertinent to Android, but as I was first learning to code (C#, unfortunately), one of my programs required a while loop, amd the condition on which to run it needed to be written as "while (true == false)" in order for it to trigger correctly. Using my intended variable for the loop condition caused it to not run, and other attempted fixes caused infinite loops or no action.

To this day I'm unsure if it was other code in the program that caused this or what, but it is fundamentally, the worst code I've ever seen.

Perhaps not quite in the spirit of what was intended by "bad code", but nonetheless, felt the need to share.

Sent from my LG-E970 using xda app-developers app
The Following 3 Users Say Thank You to WTFsandwich For This Useful Post: [ View ]
1st May 2013, 02:54 PM   |  #3  
Rick_1995's Avatar
Recognized Developer
Whoville
Thanks Meter: 3,059
 
1,114 posts
Join Date:Joined: Sep 2009
The linux kernel. Extremely ugly/hacky code but it works.
The Following 3 Users Say Thank You to Rick_1995 For This Useful Post: [ View ]
2nd May 2013, 01:16 AM   |  #4  
Senior Member
Thanks Meter: 36
 
119 posts
Join Date:Joined: Apr 2013
Source Code

terrible movie
2nd May 2013, 03:56 AM   |  #5  
Lifehacker7's Avatar
Recognized Themer
Flag Kolar, karnataka
Thanks Meter: 1,622
 
2,321 posts
Join Date:Joined: Nov 2012
More
Quote:
Originally Posted by Terrorantula

Source Code

terrible movie


FYI, this isn't about movies!
2nd May 2013, 04:20 AM   |  #6  
soad666p's Avatar
Junior Member
Thanks Meter: 2
 
22 posts
Join Date:Joined: Dec 2010
box2d.
i found it to be a big pain in the ass for college
http://box2d.org/
2nd May 2013, 09:35 AM   |  #7  
Senior Member
Thanks Meter: 36
 
119 posts
Join Date:Joined: Apr 2013
Quote:
Originally Posted by Lifehacker7

FYI, this isn't about movies!

Is it about music then? Maybe it's No code by Pearl Jam? Cause no code is truly the worst of all.
2nd May 2013, 09:52 AM   |  #8  
lesmo_sft's Avatar
Member
Flag Mexico
Thanks Meter: 30
 
37 posts
Join Date:Joined: Jun 2010
Donate to Me
More
Quote:
Originally Posted by WTFsandwich

Not really pertinent to Android, but as I was first learning to code (C#, unfortunately), one of my programs required a while loop, amd the condition on which to run it needed to be written as "while (true == false)" in order for it to trigger correctly. Using my intended variable for the loop condition caused it to not run, and other attempted fixes caused infinite loops or no action.

To this day I'm unsure if it was other code in the program that caused this or what, but it is fundamentally, the worst code I've ever seen.

Perhaps not quite in the spirit of what was intended by "bad code", but nonetheless, felt the need to share.

Sent from my LG-E970 using xda app-developers app

What? Like... really? It sound kinda' impossible, or even illogical... maybe a bug (extremely unlikely) on the C# version you were writing?
2nd May 2013, 09:55 AM   |  #9  
Member
Thanks Meter: 3
 
54 posts
Join Date:Joined: Jul 2010
Quote:
Originally Posted by lesmo_sft

What? Like... really? It sound kinda' impossible, or even illogical... maybe a bug (extremely unlikely) on the C# version you were writing?

As I said, I haven't the slightest idea. My professors, the TA's, even one of the CS department heads all had a gander at it and couldn't figure it out.

I may still have the code lying around, if you'd be interested in seeing it.

Sent from my LG-E970 using xda app-developers app
2nd May 2013, 09:57 AM   |  #10  
lesmo_sft's Avatar
Member
Flag Mexico
Thanks Meter: 30
 
37 posts
Join Date:Joined: Jun 2010
Donate to Me
More
Cool
Quote:
Originally Posted by WTFsandwich

As I said, I haven't the slightest idea. My professors, the TA's, even one of the CS department heads all had a gander at it and couldn't figure it out.

I may still have the code lying around, if you'd be interested in seeing it.

Sent from my LG-E970 using xda app-developers app

Yeah, that'd be great! Just the part where you use the true == false should be ok

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes