kodecocodes/swift-style-guide

What is "Avoid block comments inline with code" mean

SwiftSIQI opened this issue · 2 comments

In Comments Section

Avoid block comments inline with code, as the code should be as self-documenting as possible. Exception: This does not apply to those comments used to generate documentation.

what is "Avoid block comments inline with code" mean, Could you give me an example?

Thank you

As an example:

func doSomething() -> String {
   // This is a normal comment with inline code
   return "This is easy to read"
}

func doSomethingElse() -> String {
   /*
       This is a block comment with inline code. It's usually
       several lines long and is probably unnecessary for
       something this short. Usually if you want to write this
       much, you should use a `// 1` inline comment and then
       explain yourself in the appropriate bullet points in the
       prose for the tutorial/book.
   */
    return "Don't do this plz it's harder to read, esp on the web"
}

Oh, Thank you! @designatednerd
At first I think block comments is a syntax or something else.
but after you explain I realize block comments just means comments like a real block
: ]