4 ms·
I think dot notation was a mistake -- it creates ambiguity between what is an object and what is a struct. There's no way to know without the aid of the documen
by boucher 18y ago
I think dot notation was a mistake -- it creates ambiguity between what is an object and what is a struct. There's no way to know without the aid of the documentation or the compiler.
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).
- jfarmer 18y agoYeah. 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.
- twopoint718 18y agoThis 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?
- cpr 18y agoYes.