Re:Ask HN: What do you think of Objective-C?
by jfarmer on Thursday December 18, 2008 @02:09AM
(#401904)
Yeah. One of the advantages of Objective-C over C++, IMO, is that it's clear which syntax is foreign to C and which is the extension. For example, Object-C strings are prefixed with @, so you see stuff like Log(@"Some message").
It looks weird to a C programmer, but it reduces ambiguity once you move up the learning curve.
Re:Ask HN: What do you think of Objective-C?
by twopoint718 on Thursday December 18, 2008 @12:03PM
(#402281)
This is more of a question than a comment, but isn't it the case that sometimes garbage collection will succeed where reference counting will fail?
I've used a kind of reference-counted pointer in C++, but it'll fail if the reference graph isn't basically a DAG, (e.g. if you have some kind of circular reference). Do garbage collectors catch this when reference counting won't?
Reference counting isn't that hard, but garbage collection is superior. I used to fall into the same camp as you, but prolonged experience to Objective-J and then going back to Objective-C, I realized that even though I knew how to solve the problems, they weren't worth wasting cycles in my thought processes. All that to say, reference counting works really well, but there's no good argument not to just use garbage collection (at least 99% of the time).