Practice makes perfect. Actually it takes more then practice to improve, you need feedback and guidance on your performance then more practice and the improvement will come. That’s where exercism.io comes in, it is a site that provides coding exercises with crowd-sourced code reviews. It offers the opportunity to improve your objective-c programming skills by writing small pieces of code and getting feedback on your results. You can then make improvements, receive more feedback, repeat until your ready to move on to the next exercise. Once you get an assignment under your belt you are offered the opportunity to “nitpick” on the coding efforts of others. I have found that I learn even more by observing other peoples code and giving feedback. When I take the time to judge the code of others by
the values presented in the rubric it gets me thinking.
Each assignment consists of a short requirements discussion and then a set of tests. Your mission is to write some code that passes the tests. Once you have code that passes the automated tests you submit it for review by others that have completed the same assignment. This is when the real learning begins.
When preparing your comments your asked to think about the following questions:
- What do you like about the code?
- How does the code make use of objective-c?
- Does the code make appropriate use of Object-Oriented or Functional principles?
- How readable is the code? How well does it tell its story?
- What software design patterns or principles (could) inform the code?
This moves the discussion beyond the question “does the code work” and into the realm of how well does the code communicate the intention of the programmer as well as fit into the larger eco system of common language usage, design patterns, and programming principles. Thinking about these issues and getting a chance to practice with them and receive feedback is the ultimate value of the activity.
Objective-C in an interesting co-mingling of the close to the iron C language with a very powerful and a dynamic object system inspired by the Smalltalk language. One of the assignments early in your time with exorcism is to build a word counter and report your results in an NSDictionary. A working solution took me about 30 lines of code but this simple body of code generated all kinds of interesting discussions many of them related to this paradox between the two faces of the Objective-C language. One question came up with why is the return value of a failed NSDictionary lookup (nil) the very same value of zero for a counter. This paradox, source of confusion the great power of the language or just interesting side effect has been the center of many subtle bugs I’ve uncovered over my years of C programming as well as a source a frustration for many Objective-C n00bs. It doesn’t take a lot of code to dig through important issues and drive new understandings. I’m finding it a lot of fun, even additive. I’ll post the highlights of the nil is zero discussion in my next blog post.
The objective-c community on exercism.io
is small we need more leaners and teachers. Give it a try.