Swiftでプログラミングをしていると、引数なしのFunctionを使うかComputed Propertyを使うかで迷う時があります。 その判断基準がKotlinのコーディング規約にあったので引用します。 Kotlin: Coding Conventions Functions vs properties In some cases functions with no arguments might be interchangeable with read-only properties. Although the semantics are similar, there are some stylistic conventions on when to prefer one to another. Prefer a property over a function when the u
![[Swift] FunctionとComputed Propertyの使い分けの基準 - Qiita](https://cdn-ak-scissors.b.st-hatena.com/image/square/f3b66d49bad9e6a03cf393fe24af42e76770fe93/height=288;version=1;width=512/https%3A%2F%2Fqiita-user-contents.imgix.net%2Fhttps%253A%252F%252Fcdn.qiita.com%252Fassets%252Fpublic%252Farticle-ogp-background-9f5428127621718a910c8b63951390ad.png%3Fixlib%3Drb-4.0.0%26w%3D1200%26mark64%3DaHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZ3PTkxNiZoPTMzNiZ0eHQ9JTVCU3dpZnQlNUQlMjBGdW5jdGlvbiVFMyU4MSVBOENvbXB1dGVkJTIwUHJvcGVydHklRTMlODElQUUlRTQlQkQlQkYlRTMlODElODQlRTUlODglODYlRTMlODElOTElRTMlODElQUUlRTUlOUYlQkElRTYlQkElOTYmdHh0LWNvbG9yPSUyMzIxMjEyMSZ0eHQtZm9udD1IaXJhZ2lubyUyMFNhbnMlMjBXNiZ0eHQtc2l6ZT01NiZ0eHQtY2xpcD1lbGxpcHNpcyZ0eHQtYWxpZ249bGVmdCUyQ3RvcCZzPTBlZjA2MGYxODMyYTVlYmI0OTc0MmMxOTEyYmY4ZDc5%26mark-x%3D142%26mark-y%3D112%26blend64%3DaHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZ3PTYxNiZ0eHQ9JTQway15YW1hZGEtZ2l0aHViJnR4dC1jb2xvcj0lMjMyMTIxMjEmdHh0LWZvbnQ9SGlyYWdpbm8lMjBTYW5zJTIwVzYmdHh0LXNpemU9MzYmdHh0LWFsaWduPWxlZnQlMkN0b3Amcz1hNjNhODJlYTRlYzczOTNlNDEzNTI3M2UxYzA4MmVhOA%26blend-x%3D142%26blend-y%3D491%26blend-mode%3Dnormal%26s%3Db46c8ab8b33fadb4974940964b119dc6)