- Episode #39
- Mar 1, 2020
- 59m
- 59m
Managing Code Quality with Anne Cahalan
Managing Code Quality with Anne Cahalan
In this episode, Leo talks with Anne Cahalan about maintaining good code quality, helping your team, automation, and good code reviews.
Guest
Related Episodes
- Episode 36: Upgrading Your Skills in 2020 with Paul Hudson
- Episode 34: Server-Side Swift with Tim Condon
- Episode 24: Continuous Integration with Kyle Newsome
- Episode 14: iOS App Architecture with René Cacheaux and Josh Berlin
Related Links
Sponsors
- Specialize in helping businesses build apps for iPhone, iPad, Mac and Apple Watch
- 10 years of experience developing for a variety of Apple platform
- Helping dev shops which lack experience with Apple platforms and Swift
Contact me if you need help today.
We have an opening for sponsors
- Do you have a product or service which can target our ever growing community of developers as well as technology and business leaders?
Contact me today if you are interested in sponsoring or go to our Patreon page.
What is Code Quality
- Making Code that's easy to maintain
- Low Cyclomatic Complexity
- Making your code easily testable
- Your code should read like sentences
- Avoid fancy short code for more wordy code
- Messy code is easier to fix then over-engineered code
- While the integration may be complex, keep your code separated into simple parts
Why is Code Quality Important
- Saving Time = Saving Money
- Easy to Maintain and Easy to Update
- Shorter Onramp for New Developers
- Code Rots over Time (Delegation Patters vs Subscriber/Publisher Model)
- Addresses Tech Debt
When should you upgrade your code
- When it makes sense
- Use Interoperability (bridge headers, HostingControllers, ViewRepresentable, etc...) to slowly bridge the gap
- Be careful leaving too much old code behind
Good Swift Code Quality
- Use argument labels and parameter name correctly
- Avoid ternary operators
- Avoid switch statements with too much logic and cases
- Use Generics judiciously
- Extensions are great for separating Protocol implementation
Good Code Reviews and Pull Requests
- Clear your mind
- Use pull requests and templates
- Add context and details to the pull requests
- Use screen shots to show what the result is
- Communicate clearly what is going on
- Let them know what to look at and what is a work-in-progress
What Can Managers Do
- Set a great example
- Provide enough time to the team for quality code
- Have some background and experience with quality code
- Be attentive and open to what your developers say
- Allow time for unit testing
Code Quality Tools
- SwiftLint and SwiftFormat
- Codecov - for code coverage
- CodeFactor and CodeClimate - for code quality
- Having a human look at code is always best
- Be thoughtful and considerate for each decision
- Leo's Swift Package Automated CI Template - WIP
Social Media
Email
leo@brightdigit.com
Twitter
BrightDigit - @brightdigit
Leo - @leogdion
Instagram - @brightdigit
Patreon
Credits
Music from https://filmmusic.io
"Blippy Trance" by Kevin MacLeod (https://incompetech.com)
License: CC BY (http://creativecommons.org/licenses/by/4.0/)