TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

Setting up

Debugging is the act of removing mistakes from your apps, so in some respects programming is the act of putting bugs into your apps. What’s more, there’s a famous quote that should strike terror into your heart: “Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.”

Of course, the truth is that we’re not able to write code “as cleverly as possible” – we all just muddle through and do our best. Debugging, then, is inevitable: even the best of us writes software with mistakes in, and it’s a hugely important skill to be able to find and fix those mistakes as efficiently as possible.

In this project we’ll be looking at several different debugging techniques, all of which are useful. I’ve arranged them easy to hard, so you can get started immediately and work your way forward as your skills improve.

Remember: there is no learning without struggle. Every time you make a mistake coding, you’ll be forced to debug it, and in doing so your coding skills will improve as will your debugging skills. So: don’t be annoyed when you screw up – it benefits you in the long term!

To follow along, please create a new Single View App project named Project18.

Hacking with Swift is sponsored by Blaze.

SPONSORED Still waiting on your CI build? Speed it up ~3x with Blaze - change one line, pay less, keep your existing GitHub workflows. First 25 HWS readers to use code HACKING at checkout get 50% off the first year. Try it now for free!

Reserve your spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

BUY OUR BOOKS
Buy Pro Swift Buy Pro SwiftUI Buy Swift Design Patterns Buy Testing Swift Buy Hacking with iOS Buy Swift Coding Challenges Buy Swift on Sundays Volume One Buy Server-Side Swift Buy Advanced iOS Volume One Buy Advanced iOS Volume Two Buy Advanced iOS Volume Three Buy Hacking with watchOS Buy Hacking with tvOS Buy Hacking with macOS Buy Dive Into SpriteKit Buy Swift in Sixty Seconds Buy Objective-C for Swift Developers Buy Beyond Code

Was this page useful? Let us know!

Average rating: 5.0/5

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.