When you refactor, do you have unit tests covering you? …If not, why not? If so, how do you know? To me, it seems that the state of refactoring has gotten worse across the industry. Both managers and programmers and managers say the word “refactoring” more than ever. But they almost always mean, “I’m going to

Read More

Does your code have comments? Sometimes they’re helpful. But most of the time… Disclosure: The book links below are affiliate links. If you buy anything, I earn a commission, at no extra cost to you.As Jeff Atwood explains, code tells you how, but comments tell you why. A well-placed code comment is a level above the

Read More

It’s time for a quick exercise in code smells!How many code smells do you see below?override func viewDidLoad() {     super.viewDidLoad()     if viewModel.isAlternateStyle {         // Alternate style needs different placeholder text.         textField1.placeholder = strings.field1Hint         textField2.placeholder = strings.field2Hint setUpAlternateView()    

Read More

The “Single Responsibility Principle” (SRP) sounds so noble. But I’m afraid it’s misunderstood and misapplied. Ask your teammates: “What is the Single Responsibility Principle?” Go ahead, ask them. Then ask if the SRP is a good thing or a bad thing. I’d bet many of them will say something like this: “In principle, it’s a

Read More

Refactoring. It’s a word I hear quite a bit. Usually, in the context of conversations with management, it means, “Rewriting that thing. Hopefully without introducing bugs.” Often, among developers, it means, “One of the options in the Refactoring menu in my IDE.” Table of Contents Tools vs. DisciplineRefactoring Demo ScreencastDo You Have the Refactoring Book?

Read More