logoalt Hacker News

Orphis • today at 5:00 PM • 1 reply • view on HN

And the day you add a way to batch import request through another code path, you may forget the validation.

Having it in the lower layer is correct, a proper optimizing compiler should be able to detect there's a single code path to the function and that the checks have already been done, skipping the second check.


Replies

eithed • today at 6:40 PM

Well - this would be an example of defensive programming and by that logic catering for this "what if" is the way to go. LLMs were correct all along!