Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
if ステートメントはどのように構成していますか? また、どちらが読みやすいと思いますか? 次のように:
if(condition){ //... }
に比べ
if(condition) { //... }
私は最初の方法を使用します。読みやすく、場合によっては {} を省略できます (if ステートメントの後に 1 行が続く場合)。
Visual Studio はこれを自動的に行うように設定できます。また、他のプラットフォームでもコードをフォーマットするように設定できると確信しています。