News for hackers. Stuff that matters.
Re:Server APIs Project by seandougall on Tuesday October 25, 2016 @11:56PM (#12793767)
It sounds like you're used to manual reference counting in ObjC, which genuinely is a pain. Swift (and modern ObjC) use automatic reference counting, which is much more robust and less dependent on autorelease pools. For one thing, class instances get released when they no longer have a strong reference -- so to answer your specific question, you can totally instantiate a class for just one iteration of a loop. Plus, Swift makes much better use of value types, so you're less reliant on heap allocations in the first place.

I personally cringe whenever I have to go back to a GC and relinquish all control over object lifecycle.

Re:Server APIs Project by pjmlp on Wednesday October 26, 2016 @06:42AM (#12795401)
> I personally cringe whenever I have to go back to a GC and relinquish all control over object lifecycle.

I think it is a matter of which language and which GC.

A few do offer the possibility to control allocation, and sadly a few others that were good at it died in the late 90's.