About Search Archive
Matt Gallagher: Cocoa with Love Matt Gallagher: Cocoa with Love
← Newer 1 2 3 4 5 6 7 8 9 Older →
  • Presenting unanticipated errors to users

    Apr 14, 2016

    In my first truly 'Cocoa' article since restarting Cocoa with Love, I'll talk about presenting errors to the user. In particular, ensuring that errors we didn't expect or plan for are presented in a manner that allows error reporting by users and easier bug fixing.
    Read more...
  • Indent with tabs or spaces? I wish I didn't need to know.

    Apr 1, 2016

    In an ideal world, we would not know if our code was indented with either tabs or spaces. Remember: the moment you become aware of how your code indentation is encoded, you're not programming, you're managing your programming tools.
    Read more...
  • Breaking Swift with reference counted structs

    Mar 27, 2016

    Struct types are not usually heap allocated, reference counted or able to perform work on deallocation. You can coerce them into having these properties but careful if you do: it can be a source of memory leaks, errant behavior and compiler crashes.
    Read more...
  • Errors: unexpected, composite, non-pure, external.

    Mar 17, 2016

    Error handling is a topic I plan to visit periodically but it's difficult since 'error' is such a poorly defined term. In this article, I give a clear definition of an error and further define the most common associated complications. The intent is to establish a foundation for future discussions on the topic.
    Read more...
  • Gathering system information in Swift with sysctl

    Mar 8, 2016

    Another debug analysis post, this time looking at gathering basic system information for attaching to diagnostic reports and other forms of reporting.
    Read more...
  • Tracking tasks with stack traces in Swift

    Feb 28, 2016

    In this tongue-twister titled article, I discuss capturing control flow information with stack traces during ongoing tasks to aid debugging. Also included: a reimplementation of NSThread.callStackReturnAddresses in Swift for faster and more flexible stack traces.
    Read more...
  • Use it or lose it: why safe C is sometimes unsafe Swift

    Feb 16, 2016

    Swift and C have different memory layouts. This means that using Swift to call C functions in a manner that would be valid in C can cause memory safety problems. I'll show how this can occur with a subtle Release build bug inspired by issues that occurred while writing the previous article.
    Read more...
  • Partial functions in Swift, Part 2: Catching precondition failures

    Feb 2, 2016

    Partial functions are risky but if you're going to write one anyway, you should do something completely crazy to test that it is risky in all the right places.
    Read more...
  • Partial functions in Swift, Part 1: Avoidance

    Jan 25, 2016

    Partial functions (functions with preconditions) are a risky design choice. You probably have a few in your program, even if you haven't clearly identified them. Learn how to recognize them, learn about their risks, learn to avoid them and learn why you might choose to use them anyway.
    Read more...
  • A new era for Cocoa with Love

    Jan 25, 2016

    I'm drawing a line between the old Objective-C era posts on Cocoa with Love and the Swift era posts. The aim of the new era will be to make app programming suck less through a broad theme: "maintainable Cocoa apps". If we program with fewer runtime errors and new features are easier to add, we'll have more fun – even if "maintainable" sounds like a dull word.
    Read more...
← Newer 1 2 3 4 5 6 7 8 9 Older →
  • Subscribe: RSS or JSON
  • Mastodon: @cocoawithlove
  • Bluesky: @cocoawithlove
  • Github: mattgallagher

© 2008-2024 Matt Gallagher. All rights reserved.
Code may be used in accordance with license on About page.
If you need to contact me: