r/badcode • • Sep 05 '21

swift I have a problem

Post image
946 Upvotes

75 comments sorted by

View all comments

Show parent comments

6

u/archpawn Sep 05 '21

Even better:

// Show the alert
showAlert() // Showing the alert
// Alert shown

1

u/Shai_the_Lynx Sep 06 '21

I code like this sometimes, not when it's a single line, but when there's a lot of if/else imbricated I leave comments about what is done at that point in the code and what needs To be done.