你的位置: 码友网首页 / 资讯源列表 / Stop using trivial Guard Clauses! Try this instead

关于[Stop using trivial Guard Clauses! Try this instead]的摘要:

Guard clauses, on the surface, sound like a great idea. They can reduce conditional complexity by exiting a method or function early. However, I find guard clauses used in the real world to be of little value. Often polluting application-level code for trivial preconditions. I will refactor some code to push those preconditions forcing the edge of your application so your domain focuses on real business concerns.

原文地址: https://codeopinion.com/stop-using-trivial-guard-clauses-try-this-instead/

收录时间: 2022-11-21 浏览量: 791 分类: .NET

| 0 收藏 | 0