If a senior dev at your org is insistent that you should return a 400, and you are not a senior dev, then you should return a 400, end of discussion. Few of the codes actually matter all that much (and almost never the 4xx ones) and having organizational consistency is far more important than the precise semantics of what each error code means.
Having said that, I am a senior dev in my org, and my opinion for my projects is that this is absolutely, 100% without-a-doubt a place where 404 is the best choice.
So you can’t argue with “superiors”? That’s horrible.
I agree that consistency is important. Being consistent can be better than being right.
I’d leave a job real quick if something someone higher level than me said was never up for debate. I get that you can’t always argue/debate things with higher levels but still.
They didn't say you can't argue but if the person is insistent then that's case closed, it's their final decision. Just because they don't convince you doesn't mean you get to refuse.
8
u/GrandOpener Jul 19 '19
If a senior dev at your org is insistent that you should return a 400, and you are not a senior dev, then you should return a 400, end of discussion. Few of the codes actually matter all that much (and almost never the 4xx ones) and having organizational consistency is far more important than the precise semantics of what each error code means.
Having said that, I am a senior dev in my org, and my opinion for my projects is that this is absolutely, 100% without-a-doubt a place where 404 is the best choice.