Why the strange indentation on switch statements?

后端 未结 6 1084
太阳男子
太阳男子 2021-02-04 23:11

Why is the imho missing indentation of the \"case\" - keywords in a switch statement considered good style?

No indentation of the \"case\" keyword seems to be the defaul

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-04 23:39

    There are different indentation styles to choose from. AFAIK, none is considered better style than the others as long as you consistently use an indentation style at all. For me, indenting case labels is more readable, same goes for private, protected and public labels in classes, however, my IDE won't do the indentation my way. My code isn't as readable as I'd like it to be this way. Oh well...

提交回复
热议问题