4 ms·
You're right, memory management was a requirement in the early days and it created more cognitive load on the dev in exchange for not having to stall for garbag
by mapmap 8y ago
You're right, memory management was a requirement in the early days and it created more cognitive load on the dev in exchange for not having to stall for garbage collection. But Objective-C has had automatic reference counting since around 2011. Retain and release aren't used anymore.
I have talked to many people who have had a hard time getting past the square brackets - I did at first too. But now I think of them as book ends around the work. In my opinion, they are clearer to divide actions with. They can of course be abused with many layers of [[[]]], but so can the optional unwrapping code golf one-liners I see written in Swift.
And I agree with you, block syntax is terribly hard to remember. I still copy paste or use typedefs. But I love using blocks – they've done so much for readability of asynchronous code. The language really has come a long way since the first iPhone.