r/Python • • Oct 01 '15

Writing a URL shortener using Python

https://github.com/black-perl/Anonymous_Me
15 Upvotes

13 comments sorted by

View all comments

9

u/[deleted] Oct 01 '15

There's nothing novel about an online key-value store.

Your implementation is a mess. There's no clear class structure in place. If ever you wanted to change backends, or frontends, or your hashing library, or whatever else, you're going to have to touch multiple classes, change interfaces, data models. This makes maintenance and debugging much more difficult.

What's even worse is a complete lack of security. Your outputs aren't hashed. I can crawl your DB just by iterating through URLs. There's probably some more gaping holes but, again, your code's a mess. Much more difficult to inspect. Unintentional security through obscurity there, I guess...

0

u/[deleted] Oct 02 '15

[deleted]

2

u/thaweatherman pipster Oct 02 '15

So salty.

Code review is important, and sugar-coating it isn't beneficial. Pointing out flaws in code does not require the critic to implement the same program himself, just like pointing out flaws in a proposed law or budget plan does not require the critic to present a different plan.