FORUMS

Galaxy S6 Weekly Shooting Challenge

Over in our forums this weekend, XDA Forum member DevonSloan has started a thread for talented … more

Which Features from Apple Watch Do You Think Android Wear Will Copy?

The Apple Watch and Android Wear are both growing platforms. Now … more

XDA Picks: Best Apps of the Week (May 15 – 22)

Apps are at the front and center of any smartphone experience, and with over a … more

Android 5.1 for the Nvidia Shield Tablet is Out!

Nvidia is quite good at delivering updates in a timely fashion. The producer of famous … more
Post Reply Subscribe to Thread Email Thread

Post your vote for Worst Code Ever and explain why.

1st May 2013, 04: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 01:28 AM.
The Following 2 Users Say Thank You to AdamOutler For This Useful Post: [ View ]
 
 
1st May 2013, 05:19 AM |#2  
Member
Thanks Meter: 3
 
More
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, 01:54 PM |#3  
Rick_1995's Avatar
Recognized Developer
Whoville
Thanks Meter: 3,060
 
More
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, 12:16 AM |#4  
Senior Member
Thanks Meter: 36
 
More
Source Code

terrible movie
2nd May 2013, 02:56 AM |#5  
Lifehacker7's Avatar
Recognized Themer
Flag Kolar, karnataka
Thanks Meter: 1,625
 
More
Quote:
Originally Posted by Terrorantula

Source Code

terrible movie


FYI, this isn't about movies!
2nd May 2013, 03:20 AM |#6  
soad666p's Avatar
Junior Member
Thanks Meter: 2
 
More
box2d.
i found it to be a big pain in the ass for college
http://box2d.org/
2nd May 2013, 08:35 AM |#7  
Senior Member
Thanks Meter: 36
 
More
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, 08:52 AM |#8  
lesmo_sft's Avatar
Member
Flag Mexico
Thanks Meter: 39
 
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, 08:55 AM |#9  
Member
Thanks Meter: 3
 
More
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, 08:57 AM |#10  
lesmo_sft's Avatar
Member
Flag Mexico
Thanks Meter: 39
 
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