This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Bad Comment (https://improvingsoftware.com/2011/06/27/5-best-practices-for-commenting-your-code/) | |
// Loop through all bananas in the bunch | |
foreach(banana b in bunch) { | |
monkey.eat(b); //make the monkey eat one banana | |
} | |
//Good Comment (https://www.freecodecamp.org/news/code-comments-the-good-the-bad-and-the-ugly-be9cc65fbf83/) | |
function addSetEntry(set, value) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Bad White Space | |
func request(_ demand: Subscribers.Demand) { | |
assert(demand > 0) | |
guard let downstream = downstream else { return } | |
self.downstream = nil | |
streamHandler { stream in | |
_ = downstream.receive(stream) | |
if case .complete = stream.event { downstream.receive(completion: .finished) } | |
}.resume() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//clear variables | |
username = "bob.smith" | |
is_authenticated = true | |
//not-so-clear variables | |
u = "kevin.james" | |
auth = true |