News for hackers. Stuff that matters.
Re:C++ the Good Parts (2014) by ChrisMarshallNY on Thursday October 01, 2020 @04:50AM (#24648848)
Swift has it. It’s called `dealloc()`. Since the language is fairly tight, and doesn’t have real stack-unwinding exceptions, there’s not a whole lot of utility in it.

Apple seems to think that anything that you put in dealloc should end up in the system (like unsubscribing from notifications).

C++ is a dangerous, powerhouse systems language. I think it really needs things like destructors, and I’m glad to see its continuing development.

Re:C++ the Good Parts (2014) by saagarjha on Thursday October 01, 2020 @05:40AM (#24649102)
deinit, and if they’re from NotificationCenter you haven’t had to do that for a while and for KVO if you’re using the block syntax (you should!) you basically have an RAII “observation” that you control the lifetime of (often you assign it as a property of the object being observed, so it automatically gets cleaned up when the object goes out of scope).
Re:C++ the Good Parts (2014) by ChrisMarshallNY on Thursday October 01, 2020 @06:15AM (#24649286)
You're right (shows how often I use it, and I write Swift every day).

Apple is amping up KVO, in general, which I like.