Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.

python_code/write_mapping_file.py #633

Open
adamrp opened this issue Feb 20, 2014 · 3 comments
Open

python_code/write_mapping_file.py #633

adamrp opened this issue Feb 20, 2014 · 3 comments
Labels

Comments

@adamrp
Copy link
Member

adamrp commented Feb 20, 2014

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.

@adamrp adamrp added the wontfix label Feb 20, 2014
@rob-knight
Copy link
Member

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

On Feb 20, 2014, at 12:37 PM, adamrp <[email protected]mailto:[email protected]> 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//issues/633.

@adamrp
Copy link
Member Author

adamrp commented Feb 20, 2014

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
Copy link
Member

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants