Post your vote for Worst Code Ever and explain why. - General Topics

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/

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 linux kernel. Extremely ugly/hacky code but it works.

Source Code
terrible movie

Terrorantula said:
Source Code
terrible movie
Click to expand...
Click to collapse
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
FYI, this isn't about movies!

box2d.
i found it to be a big pain in the ass for college
http://box2d.org/

Lifehacker7 said:
FYI, this isn't about movies!
Click to expand...
Click to collapse
Is it about music then? Maybe it's No code by Pearl Jam? Cause no code is truly the worst of all.

WTFsandwich said:
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
Click to expand...
Click to collapse
What? Like... really? It sound kinda' impossible, or even illogical... maybe a bug (extremely unlikely) on the C# version you were writing?

lesmo_sft said:
What? Like... really? It sound kinda' impossible, or even illogical... maybe a bug (extremely unlikely) on the C# version you were writing?
Click to expand...
Click to collapse
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

WTFsandwich said:
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
Click to expand...
Click to collapse
Yeah, that'd be great! Just the part where you use the true == false should be ok :laugh:

Nobody will post anything now because nobody can top this story.
Sent from my Nexus 4 using xda premium

Can I post Samsung's Froyo Kernel Source?
Here's why -
It seems that the Nexus 10 much like everything else Samsung gets their dirty fingers on has outdated junk in its kernel. Samsung has a bad habit of making a bits and pieces kernel.
Click to expand...
Click to collapse
by Recognized Developer @hillbeast

so at the office i currently work at we have a huge mixture of asp, and vbscript on both the front and back end and random asp.net pages that seem to do the same as the asp pages but get redirected to when finished with other pages. there are multiple copies of functions all over the place and the database is indexed but has to be re indexed all the time due to changing primary keys. we have been working on trying to fix something and it took us 2 days just to be able to work with a development enviornment. i hate this code and want to beat it to a pulp. also the colors it uses for labeling things are HORRENDOUS and eye burning!

Related

Hiphone Iphone clone

Has anyone on this forum got or seen anything about this Hiphone.
It's suppost to be the closest clone of an iphone yet and was wondering of you xda-devs have came across one in the flesh so to speak.....
http://www.live25.co.uk/content/say-hello-hiphone
Thanks
EWW thats ugly i dont liek it
Coders and developers needed!
NOW!For all you Hiphone Iclone users there is hope come visit and support us at http://hiphonepro.freeforums.org and spread the word so we can get the developers to listen.
This thing has so much potential!
I wonder if the developers here might help us find out the mysterys of this phone and crack it open for development the phone is excelent but the firmware is limited and undeveloped it has alot of potential to surpass the iphone with just about anything the developer wants to add
Hahaha this thing looks so stupid
It looks as if someone build a foamphone like those foamfingers people use in stadiums and what not.
Don't get it, I am sure it has lead in it.
EValP said:
Don't get it, I am sure it has lead in it.
Click to expand...
Click to collapse
The Americans have a big thing about lead used in products at the moment, im talking about trace amounts of lead that don't mean anything but they have blown it all out of proportion, so for example my nokia 6300 has a chromed 4 way navigation button, in the manual it says dont put it next to your skin for prolonged periods due to lead content.
it is basically scaremongering to get the US public to stop buying products imported from china
I know I was being facetious.
I am sure all phones have lead, especially on the boards and chips inside, it was a joke.
EValP said:
I know I was being facetious.
I am sure all phones have lead, especially on the boards and chips inside, it was a joke.
Click to expand...
Click to collapse
lol, I only just realised you are a yank, im a brit and assumed you were too.
ice_coffee said:
lol, I only just realised you are a yank, im a brit and assumed you were too.
Click to expand...
Click to collapse
I may come across that way.
Although I have spent the majority of my life in the states, I have spent a significant amount of time in the UK.
I lived in Southampton for a job until I was made redundant the moved back and still travel there now on business.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Check out the screenshots here about halfway down the page...wonder what the "appliation" button does
I live in China and this kind of Chinglish is everywhere, I love it. There is a second-hand market near my apartment with a huge sign reading "Chicken-hawk Fun Market" with a picture of an old man holding a teenage boy's hand....it's almost like they do it on purpose
duprade said:
Click to expand...
Click to collapse
Hell, that has lead in it too!!
they are flashing firmware in and out of these things over at hiphonepro.com but they need some serious help in the codeing department
adambomb_13 said:
they are flashing firmware in and out of these things over at hiphonepro.com but they need some serious help in the codeing department
Click to expand...
Click to collapse
Why would someone do anything with this phone, don't promote it, there's about as much potential in this phone as the one pictured above.

[App] EvoLight!

Yep, my first ever Android App is now live.
And what do you know - it's a flashlight app! Free version runs on a single LED, $2 nets you dual power modes (soon to be triple), and currently the ability to prevent the screen from shutting off.
In no way messes with the camera, so I find myself using the leds in high-power when taking video.
Anywho, feedback is welcome!
QR Code for the Free version:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
QR Code for the Paid version:
To be added in the (near) future:
a) An on/off Widget, of course.
b) Ability to work on Samsung Moment and HTC Magic (I prefer working on the hardware directly, hence why I only say this works with the Evo currently)
c) Third power mode
d) Strobes! No idea why, I just really want a strobe light on my Evo, heh.
Anyway, if any of you with other phones don't mind, test this out (Android 2.1+ only) and let me know if it works for you or not. I wouldn't mind finding out which other phones this works with. Eventually the code should have 4 different paths to activate Camera LEDs with, so I'd like to get it working on all phones!
If it doesn't work with your phone, just follow the on screen instructions to email me some information about your phone and what caused the failure.
Thanks!
Ummm....,,,,,
Droid light...........
Sent from my PC36100 using XDA App
There are already several flashlight apps for free. My bet is that sales will be tough to get. However, congratulations on your first app and good luck!
EVO 4G Android Development
????????????????????????????
I'm aware there's already a million and one Flashlight apps out there, but I figured anywhere is a place to start.
TBH, I seriously debated even posting here, but eh - thick skin and all that
Ignoring that it's YAFA, give me honest feedback especially if you actually manage to crash the app.
As for the post one up - it says device specific Android Development goes in the sub-areas. AFAIK, this IS Evo Specific, as I have no idea if it works on any other system or not.
Congradulations but this isn't your personal advertisement ground. There are many free flashlights already and many free that uses two.
Besides $2.00 is way too high for a simple function app.
I disapprove this topic, but nice job on your app.
Desire LED is free and it does morse code :]
Congrats
Sent from my PC36100 using XDA App
Nice job congrats on your first build. Don't listen to those guys this is what Amdroid is all about.
Desire LED.
/thread
wow, tough crowd! sounds cool to me if it lets the led stay on during video. wasn't aware of any other apps that do that, but i hadn't really researched it. i say advertise it up! and he's offering a free version as well, so this is kosher in my book.
swcowger said:
Nice job congrats on your first build. Don't listen to those guys this is what Amdroid is all about.
Click to expand...
Click to collapse
Android is all about what? Flashlights? Making money? Flashlight app that cost money ?
Should be free and then have a pro version that does strobe where the leds flash to the beat of a song...
Sent from my PC36100 using XDA App
wrong forum, great job on coding your first app, but someone would have to be an idiot to buy this app. there are tons that are free
Love to see work being done but this forum is a more open type place people NEVER have much luck SELLING anything here other than used phones. IMO but you have to start someplace right? keep that thick skin you'll surely need it
Going to be a tough sell since you couldn't even put this in the right section of the forum.
I would suggest maybe just going FREE and putting up donate link for people to donate to further development.
nice work, is it on the market?
make it sound activated... so when the bass hits it flashes...club lights.
apristel said:
make it sound activated... so when the bass hits it flashes...club lights.
Click to expand...
Click to collapse
That's actually a really cool idea... I'll have to incorporate something like that!
For that matter, I've got control over the other leds on the phone (the green / amber / LCD / buttons) so maybe I can get a whole rave going on the phone
I'm not doing this for the sales - I had to put something up so that I could see how the Marketplace actually worked.
Surprisingly I've had a few sales already, and well, as my 1 comments states - "Works very well. Best FL on the market for the EVO. SQ" - so what's the harm in having more choices?
Yes, donating your time is all well in good in the open-source community, but when you only make $20k a year, you gotta do everything you can to make money, amirite?
Get a job and make this a hobby... amirite?
Sent from my PC36100 using XDA App

Beware- Android CAN get malware\viruses

Just a warning that Android can get malware and viruses. See the story here, http://www.msnbc.msn.com/id/43228750/ns/technology_and_science-security.
I use lookout to defend against them ain't had a problem yet
Sent using my Evo 4g with Cyanogen 7 nighty 87
Thanks for the heads up. All computer users need to practice smart downloading.... as one unfortunate Ubuntu Forums user learned today concerning a "theme" from Gnome-look
kimtyson said:
Just a warning that Android can get malware and viruses. See the story here, http://www.msnbc.msn.com/id/43228750/ns/technology_and_science-security.
Click to expand...
Click to collapse
Yes that is why there are so many antivirus apps on the Market.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
What?...No Really What?
The same simple patch that blocked the last one probably blocks the new one. I don't think that the exploit will work in gingerbread, and its simple to block in froyo. Its in one of my posts in my rom in the captivate forums( or just search for it- should be easy to find if your interested and still on froyo)
So just be careful downloading apps as usual?
Sent from my Desire HD using XDA Premium App
Just like PC, know what you are installing.
/thread
Also superuser is a bad program and having root can cause bricks. /lol
kimtyson said:
Just a warning that Android can get malware and viruses.
Click to expand...
Click to collapse
Duh! (just being a playful [email protected] there) That's why I've been rockin AVG on my Inspire since I got it Feb 27th.
Sent from my Inspire 4G using XDA App
haha not being a wise guy but why would they make a phone that can get virus Iphone does not. I mean I love my inspire so far of everything it does and I can do. Now ? is lets say I side load an app I scan it before installing it in my phone with kaspersky internet security.That will cover me. and If anything why would you need anti-virus if your dl'ings safe apps from the market or 3rd party.
What Anti-Virus would you say that works and had not had any issues and that takes the lease amount of space.
Easy folks. I wasn't trying to be Captain Obvious. My point is that our devices can get viruses. There are a lot of people out there that don't know this. They refuse to get Android antivirus and they get infected.
It probably doesn't matter which antivirus program you use. There are several to choose from. I won't endorse one here so I am not asked if I work for XYZ company. Just use antivirus. That's my point.
Estrong Security Manager
kimtyson said:
Easy folks. I wasn't trying to be Captain Obvious. My point is that our devices can get viruses. There are a lot of people out there that don't know this. They refuse to get Android antivirus and they get infected.
It probably doesn't matter which antivirus program you use. There are several to choose from. I won't endorse one here so I am not asked if I work for XYZ company. Just use antivirus. That's my point.
Click to expand...
Click to collapse
You make a good point, though its kind of sad people need to be told about this. The majority of our computers are running antivirus software so it only makes sense that our phones need it too. It seems as though some smartphone owners forget how much of a computer it really is. Unfortunately, as Android grows so does the amount of people that want to hack and ruin our fun.
RonShallPerish said:
You make a good point, though its kind of sad people need to be told about this. The majority of our computers are running antivirus software so it only makes sense that our phones need it too. It seems as though some smartphone owners forget how much of a computer it really is. Unfortunately, as Android grows so does the amount of people that want to hack and ruin our fun.
Click to expand...
Click to collapse
Unfortunately, you are right. The more a platform becomes standard, so to do the ppl who are gonna hack it. The ones who are gonna feel it, will be the ones who didn't think to put an AntiVirus on their phone. Those who are rockin free or paid AntiVirus apps will be the ones that will avoid MOST problems.
Sent from my Inspire 4G using XDA App

Why apple is bent on suing android.

Really?
http://news.cnet.com/8301-13579_3-20123511-37/steve-jobs-felt-android-was-a-stolen-product/
Let's face it. Without android you wouldn't be where you are either.
Sent from my I897 using Tapatalk
evil to the last dying breath .... shame on him
android was created before iphone
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
He was the same to Adobe with regards to Flash. If it wasn't for Macromedia/Adobe, Apple would have died LOOOOOOOOOOOOOOOOONG ago. If it wasn't for Macromedia's software, graphic design and video editing software, and, of course, Flash, wouldn't have been designed on a Mac and Apple would have died a slow, painful, death. And even before that, MS bailed the c***s outs.
........................greedy
He's a hypocritical ^ asshole. Visionary my arse.
It's because they are jelly Android is catching up
AllGamer said:
evil to the last dying breath .... shame on him
android was created before iphone
Click to expand...
Click to collapse
and it looked like blackberry for the uneducated before they saw the iPhone, this is the stupidest argument to put out.
z33dev33l said:
and it looked like blackberry for the uneducated before they saw the iPhone, this is the stupidest argument to put out.
Click to expand...
Click to collapse
Both Android and iOS look like S60, so if other arguments are stupid, yours isn't any better.
AllGamer said:
evil to the last dying breath .... shame on him
android was created before iphone
Click to expand...
Click to collapse
First Android phone did not come out until 2008.
http://en.wikipedia.org/wiki/Android_version_history
Illicit Hero said:
First Android phone did not come out until 2008.
http://en.wikipedia.org/wiki/Android_version_history
Click to expand...
Click to collapse
oh lord.
You do realize being out in the market and existing or in development arent the same right ?
iPhone STILL looks like it did when it first launched. Bunch of icons on several pages. Apples theft or "borrowing" of design and features is well known and documented. People dont have it out for Jobs they just recognize hypocrites when they see one.
xManMythLegend said:
oh lord.
You do realize being out in the market and existing or in development arent the same right ?
iPhone STILL looks like it did when it first launched. Bunch of icons on several pages. Apples theft or "borrowing" of design and features is well known and documented. People dont have it out for Jobs they just recognize hypocrites when they see one.
Click to expand...
Click to collapse
Same can be said about the iPhone, point?
Not long before microsoft fears android os for pc lol.
sent from my sense on crack MT4G Slide using xda premium
How many options does ios5 "steal" from android or others. Such is the nature of business. If someone buys something, another company is going to produce a similar product with their own twist to appeal to another group of consumers and some of the "original" company's. When one company started building suvs, and another company sees a trend they will too. If one company sees that ppl like rear window wipers others are going to manufacturer them too. Take something, build it to your liking and add in to it. There are few truly genuine and unburrowed ideas in today's business. If you think you have a niche in the market, don't plan on having it long unless you continue to innovate. Heck, apple even spends less on its r&d per revenue then goggle, microsoft, or rim. Because they gave up on innovation and spent more on legal departments and advertising?
Sent from my I897 using Tapatalk
Continue discussion here
http://forum.xda-developers.com/showthread.php?t=1246779

Apple-Samsung Court Case

Looks like our beloved Charge was mentioned as a witness in this case:
http://www.technobuffalo.com/companies/apple/apple-samsung-trial-verdict/
- rubber band patent
- 915 patent (scrolling with one finger)
- 163 patent (double tap to zoom and center content)
- iphone trade dress (Charge was not in violation of this)
what this could mean for the future for the Charge? who knows?
good side: perhaps a software update to the latest OS with valid patents
bad side: a software update reverting these violations
neutral: nothing....
Here's a interesting write up about some sketchiness among the jury and the decision. In this light, it seems almost certain that at appeal is coming, if not outright dismissals on at least some of the violations under a Rule 50(b). With this much alleged impropriety, they may even be able to get a stay on the decision.
I doubt Apple is overly concerned with a low sale volume device like the Charge in the grand scheme of things. I imagine that the most that might happen is stopping production.
http://www.groklaw.net/article.php?story=2012082510525390
Hmm. So is it really copying when they are two totally different programming languages that achieve similar results?
I hate this damn Samsung keyboard .... Maybe if i have some time i can catch up with you guys
Rooted FP5....
Antoneus1231 said:
Hmm. So is it really copying when they are two totally different programming languages that achieve similar results?
I hate this damn Samsung keyboard .... Maybe if i have some time i can catch up with you guys
Rooted FP5....
Click to expand...
Click to collapse
You can install a keyboard without root...
Sent from my SCH-I510 using Tapatalk 2
sales ban
Cnet is reporting that Apple is requesting a ban on sales of the Charge (amongst other phones) in the US.
With appeals and other legal manuvering I have no idea whether this will really happen, but I wonder what it means for customers that have these phones... What would happen if you need a replacement from VZ?
It would be great if they just make them stock android devices with 4.1.1 like the nexus S...The resale value would double lol.
i would not be surprised to see VZW offer us a deep discount on upgrading to another device. probably something like $100 off the 2-year contract price of another device even if you have time left on your current contract. which is really nothing new, but it could easily persuade most out of the charge...
but whatever it is, I want dwith to let me know where he is going first, and I'll follow.... (just don't say iphone....)
jco23 said:
but whatever it is, I want dwith to let me know where he is going first, and I'll follow.... (just don't say iphone....)
Click to expand...
Click to collapse
Definitely. This is a great group I've found here. I don't want to just trade you guys in for the sake of some stupid phone. Unless he says iphone. Which would suck. I don't expect that to happen though.
Rooted FP5....
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This is what I think of apple.
Tweaked 2.2 PBJ and Transparent ICS 5.0 Beta
tmanschuette said:
This is what I think of apple.
Tweaked 2.2 PBJ and Transparent ICS 5.0 Beta
Click to expand...
Click to collapse
Ditto. Except I wouldn't look as happy ingesting such a grotesque thing
Here's some info on the latest.
http://www.groklaw.net/article.php?story=20120827143911783
http://www.groklaw.net/article.php?story=20120828085512779
tldr but I'd like to know a summary
Sent from my SCH-I510 using xda premium
First article is showing how the only device that the judge felt confident in granting a sales injunction for was one of the few devices that didn't get any judgement against it. Literally, the only device the judge thought was a slam dunk got off clean, and others that she considered to be weak cases got slammed by the jury, which when taken with the earlier reports of procedural errors and bias points further toward an incompetent or biased jury. The second article compares this case to previous attempts by Oracle, SCO, and Microsoft attempting (and failing) to shut down other FOSS projects due to fear, and speculates (with good reasoning) that this could very well be a test case for patent reform that makes it all the way to SCOTUS.
This is just getting worse and worse. The jury foreman in an interview said that he determined that prior art didn't apply because "The software on the Apple side could not be placed into the processor on the prior art and vice versa. That means they are not interchangeable. That changed everything right there." Great logic, except that interchangeability isn't part of the definition of prior art. I can just be words on a piece of paper with no actual implementation whatsoever and still be prior art, yet he managed to convince the rest of the jury using that logic. Keep in mind that this is the same guy who has a patent and admitted that was thinking of this case in terms of defending his own patent.
http://www.groklaw.net/article.php?story=20120828225612963
Every time that guy opens his mouth, he strengthens Samsung's appeal and/or Rule 50(b) filing.

Categories

Resources