Ostrich algorithm python package

Was taking a break from the serious programming stuff, so I created this python package.

Here goes!

The Ostrich Algorithm is a term in programming where developers deliberately ignore certain problems in their code (like an ostrich “burying its hea…


This content originally appeared on DEV Community and was authored by Sour durian

Was taking a break from the serious programming stuff, so I created this python package.

Here goes!

The Ostrich Algorithm is a term in programming where developers deliberately ignore certain problems in their code (like an ostrich "burying its head in the sand"). While it sounds like a joke, it's actually a legitimate strategy when:
The problem is super unlikely to occur (or at least we hope so)
Fixing it would cost more than ignoring it
You're dealing with legacy code that works (don't touch it ever!)
Your deadline was yesterday
So ... I created a package that does just that! Except that mine is more of a joke. To use it,

from ostrich import ostrich, Priority

@ostrich(Priority.HIGH, "PERF-123", lines={
    8: "This query makes the DB cry",})
def calculate_user_metrics():
    query = "SELECT * FROM users WHERE..."  
    for metric in all_metrics:             
        results.append(calculate_metric(user, metric))
    return results

`# The output will look like:
# [OSTRICH HIGH][PERF-123] watching from line 3
# Marked lines in this function:
# Line 15 -> This query makes the DB cry
#     query = "SELECT * FROM users WHERE..."`

It will watch from whichever line has the ostrich decorator. And it will highlight that part so that you can just ignore it (or prioritise it).

Any comments/hate/feedback/criticism welcomed.

Link to the github: [(https://github.com/duriantaco/ostrich)]


This content originally appeared on DEV Community and was authored by Sour durian


Print Share Comment Cite Upload Translate Updates
APA

Sour durian | Sciencx (2025-01-24T08:05:01+00:00) Ostrich algorithm python package. Retrieved from https://www.scien.cx/2025/01/24/ostrich-algorithm-python-package/

MLA
" » Ostrich algorithm python package." Sour durian | Sciencx - Friday January 24, 2025, https://www.scien.cx/2025/01/24/ostrich-algorithm-python-package/
HARVARD
Sour durian | Sciencx Friday January 24, 2025 » Ostrich algorithm python package., viewed ,<https://www.scien.cx/2025/01/24/ostrich-algorithm-python-package/>
VANCOUVER
Sour durian | Sciencx - » Ostrich algorithm python package. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/01/24/ostrich-algorithm-python-package/
CHICAGO
" » Ostrich algorithm python package." Sour durian | Sciencx - Accessed . https://www.scien.cx/2025/01/24/ostrich-algorithm-python-package/
IEEE
" » Ostrich algorithm python package." Sour durian | Sciencx [Online]. Available: https://www.scien.cx/2025/01/24/ostrich-algorithm-python-package/. [Accessed: ]
rf:citation
» Ostrich algorithm python package | Sour durian | Sciencx | https://www.scien.cx/2025/01/24/ostrich-algorithm-python-package/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.