Design Choices¶
Why Python?¶
Python was a straightforward choice. The ease of string manipulation is perfect for translation module.
Why Flask?¶
Flask as compared to Django is a much lighter weight framework. Since the objective of this service does not need a DB, ORM or an CRM like Admin UI. Many features of Django would have been unnecessary whereas Flask fits perfectly.
Why make API a Post instead of Get?¶
One can argue that we are trying to get translation of text. Therefore API should be a Get. I agree the request is idempotent and has no side-effects(RFC 7231). I slightly leaned towards a POST request for the following reasons:
- the to be translated text may contain non-ASCII characters
- the text maybe large and url encoding in Get will result in very long URLs. This might causes unexpected behaviour in some servers.