Hacker News new | ask | show | jobs
by jheriko 4575 days ago
"When trying to be informed of changes on a class that you don’t own, such as one of Apple’s classes. A classic case of this is observing the contentSize of a table view. This information can’t be gotten in any other way."

I never like this - platform holders ramming their crap down your throat basically...

A broader version of this applies to Objective-C as a whole for me... I have to use it to interact with iOS or OS X in the intended way. There is no other reason for me to want to use it - the language features are not helpful for me, the ref counting is dangerous and the performance is horrendous (that last one is a design tradeoff to be fair - but I don't want to pay for what I don't use).

1 comments

"the ref counting is dangerous"

hmm?

i consider it dangerous because it requires more manual (and error-prone) work than just doing allocations/deallocations yourself.

i can see the theoretical justification but I am yet to use a system where:

* i do not need to decrement ref counts manually in various situations or by default

* i do not get memory leaks resulting from the above ambiguity

* its easy to debug a leak (because I need to hunt for the right place to decrement the reference count, not just slap it in wherever i want)

coupled with the performance overhead of refcounting i see no benefit to it in practice - as nice as the theoretical idea is. this could be personal experience though - i can easily say that i've had more memory leaks from not understanding a ref counted library than when i manage my own memory - but that might not be the general case.

yeah, the problem with these kinds of discussions is that each of us has had their opinion coloured by their different experiences of software.

Overall, my experience of ref counting as implemented by the Apple frameworks has been very positive indeed.

My experience of ref counting in other contexts/frameworks has been patchy, usually depending upon the quality of the developers responsible for it.

The thing I really do like about ref counting is that it is deterministic, unlike other approaches, ie garbage collection.