From Apple to Indie in three easy steps

Menu

Anti-Patterns

Anti-Patterns
Coding practices you should avoid
Anti-Patterns
So your app don’t crater like a meteoroid

Whether you’re a newbie or here since NeXTSTEP 3.3
There’s a chance you’ve picked up some bad habits
So take my advice, make your code play nice
Or the bugs will multiply like rabbits
Doo, doo da doo doo

Anti-Patterns
Whoever said “When in doubt, retain” should be reprimanded
Anti-Patterns
Over-retaining just leaves all of that memory stranded

You should not rely on the amount of the retain count
That’s just asking for pain
Just follow the rules and use the diagnostic tools
Your code’ll be right as rain
Do I have to explain?

Hold me, Use me, then release me
Hold me, Use me, then release me

Anti-Patterns
Yeah, you know they’re gonna bite you somewhere down the line
Anti-Patterns
Even if the code seems to work at the time

If you choose to persue and use character values of NSString
You’ll be surprised when your app’s localized at the subtle problems that brings
Yeah, Unicode’s a complex thing.

Anti-Patterns
Sometimes it’s only good intentions gone awry
Anti-Patterns
Like calling stuff that isn’t public API

It’s not polite for random strangers to be groping at your privates.
So please try to refrain
But if its your infatuation to break encapsulation
It’s like running towards an oncoming train.
And your app submission will be in vain

Oh the code we’ve seen
Oh the code we’ve seen (It burns your eyes to read it)
Oh the code we’ve seen
Oh the code we’ve seen (and occasionally written)

Anti-Patterns
You know they’re gonna make you sadder but wiser
Anti-Patterns
Might I suggest that you run the static analyzer

I could on for hours, but the powers that be say that would be too long.

Anti-patterns is the code that you write when you’re writing it wrong. (Oh yeah.)
Anti-patterns is the code that you write when you’re writing it wrong. (One more time now.)
Anti-patterns is the code that you write when you’re writing it wrong.

Anti-Patterns debuted at WWDC 2010. This song marked James Dempsey’s debut on ukulele, having picked one up on a trip to Hawaii earlier in the year. This ukulele song has a Tin Pan Alley feel—the Hawaiian-style of The Liki Song came later, in 2012.