As part of BitMethod’s iOS Development class through Spindustry Training, I share and discuss our code library. All the code that we’ve developed as part of the iOS apps that we’ve released (including Eat Sleep and 80/35) is made available and the more significant bits are explained.
You’ve probably heard great things about developing for iOS and the code libraries that Apple provides with Cocoa Touch. Even though it is an expansive, solid library, it can’t be everything to everyone. At BitMethod, we’ve had to take over where Cocoa Touch stops to achieve the goals specific to our projects.
When I was getting started with iOS development, I really struggled with making the HTTP requests that allow me to submit and download information from our servers. In my first application, I did all of the complicated setup, concatenation, and parsing of data using a mixture of copy-and-paste and low-level code. Convinced that there must be a better way, I discovered the ASIHTTPRequest library. Libraries allow programmers to forget about some of the grunt work and concentrate on making the actual product.
David Walsh provides his reasons for using libraries:
- Don’t Reinvent The Wheel.
- Do More With Less Code.
- Save Time.
- You Aren’t The Expert.
- Speed Thrills.
- Avoid Cryptic Code.
If you decide to read David’s article, you’ll learn that while using a library can be great, there are compromises. I’ve made every attempt in my code to avoid these compromises. Our library does not try to fix every problem. Our library attempts to prevent what’s known as leaky abstractions by exposing the low-level code that lies under the hood. This means that our library is shallow, only trying to knock down the major pain points.
Because I like to practice what I preach, I use several libraries in conjunction with our code. You may benefit from giving some of these a try:
- ASIHTTPRequest: An abstraction for making HTTP requests.
- FMDB: An abstraction for using a SQLite database.
- SBJson: A JSON serializer and deserializer.
Libraries are great resources for new programmers; you can bypass low-level annoyances while learning how you might approach solving the problems you will encounter. Students of our iOS Development class will not only have BitMethod’s libraries available to use, but understand how the code relates to their projects and how to use it as basis for creating their own library. Regardless of what instruction and resources are available to you, I strongly encourage you to learn about how to create reusable code and what makes for good API design.Tweet
Commenting is closed for this article.