Member-only story

10 Awful Code Comments I’ve Seen in Swift

Oh Dear!

Steven Curtis
3 min readMar 11, 2023
Photo by Artur Shamsutdinov on Unsplash

Here are 10 comments that I’ve seen in Swift code: Not one of the following examples passed their code review, but I think we can all learn something from the following comments.

Also, please remember this is just a bit of fun for a weekend, don’t take this fun article too seriously!

The Comment

// Comment this code

Well done for that. You’re recursively using a comment like a TODO:

The TODO

// TODO: Write TODO: Here

I know, you didn’t know what JIRA ticket number you were going to need. But, you know, you could write the ticket?

Remind yourself

import UIKit
// import UIKit

It’s probably to do with reflection or something.

Remember to add documentation

// undocumented

That’s not quite what I meant

Comment to make things clear to the other developers in the team

// do nothing

You wrote an else statement for that?

The apology

--

--

Responses (1)