Conclusion

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

In the last demo, you updated your code to avoid unexpected input from breaking your code. You learned how using the wrong data type can result in the wrong values and how to protect your code from crashing.

In this lesson, you covered a different angle compared to the other lessons. You started with a basic solution to the puzzle. You learned how to assess your code’s performance and measured the time to run it with large values. Afterward, you optimized your solution to calculate instant results, no matter how large the input is. Finally, you updated your code to not crash or fail with unexpected results.

In this lesson, you covered these learning objectives:

  • Break down coding challenges into small, easy-to-understand steps.
  • Optimize an initial solution through iteration and measure the improvement.
  • Test your code and check for edge cases.

You covered a lot of ground in this module. You learned about creating variables and constants in Swift. You learned how to make your code smarter and take decisions with flow control and loops. You used functions to organize your code and make it reusable, and you finally understood the difference between structs and classes, value types and reference types, and how they work with memory.

Working with Swift is a lot of fun. Your code can be very easy to read and almost read like English rather than code.

You just got started with Swift basics. There’s a lot to cover, but you’re off to a great start.

See forum comments
Download course materials from Github
Previous: Crashing Demo Next: Problem Solving in Swift Quiz