One of the key pillars of good architecture revolves around Interface Design. The reason for this is deceptively simple: software is complex and we want to do everything we can to make it as simple and easy as possible. Part of the entire point of OOP (Object Oriented Programming) is to abstract complicated code into objects and then hide that complexity behind a simplified interface. That way programmers don’t need to know what’s going on behind the scenes, and instead can deal with the abstraction. The interface should be the only thing someone needs to know about that object to use it. The only time someone should even consider the implementation is when they’re modifying it. This is an essential tool in battling the complexity of a codebase.Read More
Before I truly begin this post, I feel the need to run a few qualifies here. I'm going to spend some time ranting about what I consider are some obvious omissions in Swift, but I need to be clear: I actually, really like Swift. I really do. Despite being a "long time" (depending on your perspective) objective-c developer, Swift truly feels like programming in the future. I do things with Swift I never do in objc... good things. Swift helps me abstract like I never could(?) in objc, or just perhaps it encourages me to abstract where objc never did... not sure. But what I do know is I find myself creating better abstractions easier, allowing me to reuse logic in some pretty incredible ways. I really like Swift.
And then, I'm going along and hit a wall at 90 mph. Really!? I can't do that? Why the hell not? What the hell was I creating all this architecture for anyway? Three days later I have a solution but I kind of feel lied to... where was all the power I was promised?Read More
One common opinion I keep hearing is about how the Optional system kind of sucks, and is perhaps better in theory than in practice. I would like to take a brief moment to defend Swift’s optional system and provide some tricks I have found that greatly help to tame the optional system and provide a path out of “if-let nested hell”.Read More
Of those things I sought to avoid, avoiding custom operators has been a complete failure. The problem is this: custom operator are awesome, especially in a functional language like Swift. But even more than being awesome, they're necessary. Don't believe me? Try parsing a deeply nested JSON structure without custom operators. To add insulte to injury, try doing this andrequiring that values x, y and z be present. You'll be so neck deep in if let statemtents not even a backhoe will get you out...Read More
I ran into an interesting problem in my Swift development, namely, that while it's really convenient to pass class functions as arguments to another class function (aka: very functional programming like), you probably should never do it...Read More