What is the proper way to format code?

前端 未结 22 2136
没有蜡笔的小新
没有蜡笔的小新 2021-02-18 18:33

When I write code, I try to group lines of similar code together, then leave a blank line and write another block.

I believe this contributes to the neatness and readabi

22条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-18 19:02

    Vertical space is usually at a premium relative to horizontal space, so excessive spacing usually isn't a good idea. I do think it's a good idea to logically separate blocks of code with a single blank line.

    Sounds like your teacher is mostly a jerk. As the saying goes, "those who can, do; those who can't are on StackOverflow teach." ;)

提交回复
热议问题