|
|
|
|
|
by roestava
5306 days ago
|
|
With Ruby folks can always try to remove redundancy. :-) I find it amazing that "DRY" has become such a positive pattern when it was touted as one of the driving points of the Ruby on Rails framework. Don't repeat yourself. For instance, Java folks are always ready to throw exceptions instead of letting stuff resolve itself if it doesn't quite work. |
|
If I returned a fake value - the client would get a 200 response on his attempt to delete a non-existent resource, which is clearly the incorrect behavior. I could return nothing - but then the client would see a 204. So, I choose to throw an exception with a response 'NOT_FOUND'
so that the client gets a 404 response.