qiime / qiime_web_app

QIIME, EMP and American Gut Web Application
www.microbio.me/qiime
9 stars 10 forks source link

python_code/write_mapping_file.py #633

Open adamrp opened 10 years ago

adamrp commented 10 years ago

MIND = BLOWN

Started innocently enough.... All I wanted to do was strip newlines out of some database fields before they were written to a mapping file, which led me to this code.

I'm not even going to mention the fact that there are two NEARLY identical functions in this file (aside from the names of the functions, which are also nearly identical, I challenge you to spot the differences without using a diff tool). Or the fact that WTF is going on in the first half of each function is almost inscrutable. Instead I would like to highlight lines 383 through 433.

This is no longer an issue I intend to fix (since replacing rather than fixing this code would be a better use of time), I just wanted to invite anyone reading this post to scrutinize these 50 lines of code and count all the crazy.

rob-knight commented 10 years ago

I like not this code. Bring me some other code…

On Feb 20, 2014, at 12:37 PM, adamrp notifications@github.com<mailto:notifications@github.com> wrote:

MIND = BLOWN

[https://github-camo.global.ssl.fastly.net/e83c22e91f0d3f2731c23f0a93b0a36a178a99be/687474703a2f2f69332e6b796d2d63646e2e636f6d2f70686f746f732f696d616765732f6e657773666565642f3030302f3238382f3634382f3737362e676966]https://github-camo.global.ssl.fastly.net/e83c22e91f0d3f2731c23f0a93b0a36a178a99be/687474703a2f2f69332e6b796d2d63646e2e636f6d2f70686f746f732f696d616765732f6e657773666565642f3030302f3238382f3634382f3737362e676966

Started innocently enough.... All I wanted to do was strip newlines out of some database fields before they were written to a mapping file, which led me to this code.

I'm not even going to mention the fact that there are two NEARLY identical functions in this file (aside from the names of the functions, which are also nearly identical, I challenge you to spot the differences without using a diff tool). Or the fact that WTF is going on in the first half of each function is almost inscrutable. Instead I would like to highlight lines 383https://github.com/qiime/qiime_web_app/blob/master/python_code/write_mapping_file.py#L383 through 433.

This is no longer an issue I intend to fix (since replacing rather than fixing this code would be a better use of time), I just wanted to invite anyone reading this post to scrutinize these 50 lines of code and count all the crazy.

— Reply to this email directly or view it on GitHubhttps://github.com/qiime/qiime_web_app/issues/633.

adamrp commented 10 years ago

News! Python is being redefined to make <> the standard not-equals operator, and loops that do nothing will extend your natural life equal to the number of CPU hours wasted!

ElDeveloper commented 10 years ago

:+1: