770 karma · joined March 21, 2013
timothycrosley.com
> These aren't new, though the approach to them seems quite clean.
This is really the crux of it, nothing is new. That is before Flask etc you could do everything you can do with Flask now, but the approach was bad and not clean. Required a lot of duplication of work. Flask helped fix that. You can do the hug enables through flask now, but the approach isn't clean, they require a lot of duplication of work. Hug fixes that.
The same reasons people started using Flask are the same reasons they should start using hug. It provides a cleaner, faster, and better base for the APIs of the future - just like Flask did when it came along.
The real question should be, why take the time to write Falcon when you can get the same performance and more code-reuse using hug?
Highlights:
- Automatic documentation - Type annotation based validation and transformation of input fields - Directives to inject more data (like request data) into existing functions in a safe and reusable way - It's easily twice as fast at handling requests as Flask, making Flask a rather horrible base for any competitor
Here's the same thing in modern Python: https://news.ycombinator.com/item?id=10221707
while actually allowing you to build RESTful APIs