Style Checking for iOS Development

In a recent episode of Silicon Valley, Richard and Winnie had a fight about Spaces vs Tabs. It reminded me of this comic on the debate: TabsSpacesBoth

Obviously the point of the comic is that the decision is fairly arbitrary, but consistency is of the utmost important.

So the question is: Teams how do you stay consistent? or How do you stay consistent to your former self? The answer: Style Checking.

So I thought I'd write this blog post to talk about the way I use style checking. Obviously I spend a lot of time doing iOS, so let's talk about that.

Firstly, I have a few requirements for such as tool.

  1. Support both Swift and Objective-C
  2. Produce inline style errors in Xcode
  3. Easy to configure
  4. A nice settings file that could be checked into Git
  5. Free or low cost

What I found about 2 years ago was Objective-Clean (and later, it's sister product Swift-Clean). These are fantastic tools created The Ostlers and have served my needs since.

Objective-Clean icon

Swfic Clean icon

The workflow is really simple too. To start, simply gather your team and take the survey together. Once the yelling ceases and the evil eyes have stopped being made, you'll have yourself a downloadable settings file.

Once you've got that, grab a copy of the software (It's very cheap at $10USD).

Then, open the app, drag your xcodeproject or xcworkspace into it, and it'll configure itself. Under the hood, it adds a build step that'll style check your code after each build.

From there, the style errors will jump out at you, and you can take a small amount of time to bring your project up to consistency. Boom.

So that's how I take care of Style Checking. Props to Blair for showing me the ways back in the day. It's been rewarding to keep our code looking 💯.


Do you use style checking? If so, what do you use? Do you know any other tools? I'd love to hear from you on twitter - I'm @samjarman.

Learning Elixir: Part 2

Hey All, Thanks for reading my last post - since then I've been doing a little more hacking and watching.

I believe the important thing with learning a new programming language is to focus on its strengths and weaknesses rather than just the syntax difference. Syntax is something you can learn quickly, but knowing the strengths and weaknesses of any language of tool can take an indeterminate amount of time.

Resources

I prefer to learn by really getting into the head of the people who came up with the language. One of those is Robert Virding, one of the original team members who worked on Erlang at Ericsson.

Here's a talk by him describing the Rationale of Erlang.

https://www.youtube.com/watch?v=rt8h_xeESLg

Another great resource is The Zen of Erlang. This (long) read covers some of the core principles and the mindset of Erlang (all of which are applicable to Elixir) 001 Some other things I plan to watch and read are Learn You Some Erlang and this other talk by Virding. I was also suggested a book called The Little Elixir and OTP Guide Book. Do you have any more to add to this list? Let me know.


I had some more progress to talk about in this post, but I'll leave it for next time in the interest of keeping these posts short and to the point.

Have you also been learning Elixir or Erlang too? Do you have any tips or comments? I'd love to hear them and share them in an upcoming post. Ping me on twitter.