News for hackers. Stuff that matters.
Re:Swift Regrets by pjmlp on Thursday September 23, 2021 @02:21AM (#28625724)
For Cocoa like classes, it did not solve anything else for the rest.
Re:Swift Regrets by mpweiher on Thursday September 23, 2021 @05:28AM (#28626980)
My stack-allocated integers don't need it.
Re:Swift Regrets by pjmlp on Thursday September 23, 2021 @06:08AM (#28627229)
Yeah, but those heap allocated structs surely do.

And although there is now partial ARC support for that scenario, partial is the keyword here, as it needs to obey specific access patterns to actually work.

Re:Swift Regrets by mpweiher on Thursday September 23, 2021 @07:14AM (#28627651)
But why on earth would I heap-allocate structs in Objective-C? That's what I have objects for. If I am going to dumb things down to structs, the reason is that I don't want heap allocation.

Unless I have no clue whatsoever as to what I am doing.

As in, I just wrote pure C (no Objective- at all) and for some reason changed the extension of the file to .m

Anyway, not using the solution that is there is not the same as the solution not existing, it certainly doesn't qualify as "the rest".

Re:Swift Regrets by pjmlp on Thursday September 23, 2021 @07:44AM (#28627844)
You "mpweiher" might not do it, but I assure you plenty of enterprise programming cogs do.

They code mostly in a C like way, and only use Objective-C at the level it is required to call into Apple specific APIs.

When using C++, then their code looks like what I call C+.

The same set of people that are to blame for Objective-C conservative GC never working in practice, when mixing Frameworks compiled with different modes.

Re:Swift Regrets by mpweiher on Thursday September 23, 2021 @11:02AM (#28630173)
Er...no.

I mean, sure, I believe you that you've seen this. But I've looked at quite a number of iOS/macOS projects and this was never a problem. Not even close. If anything, people were extremely hesitant if not actually afraid of using C features outside of the very basic ones like control structures, arithmetic and assignment.

Re:Swift Regrets by pjmlp on Thursday September 23, 2021 @03:50PM (#28634345)
Doesn't change the fact ARC doesn't work with structs, and people actually allocate them on the heap, hence why on 2018 Objective-C got some support for also applying ARC to structs.

Maybe time to also review the WWDC session and the points made there?