Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn’t Objective-C have namespaces?

Why doesn’t Objective-C have namespaces? It seems like a simple feature that would make some class names more readable (AVMutableVideoCompositionLayerInstruction anyone?) and axe the silly letter prefixes on class names. Is this mainly because of backwards compatibility? Is it harder to implement namespaces than it seems?

like image 368
zoul Avatar asked Nov 29 '10 10:11

zoul


1 Answers

I don't know the answer but I suspect "it's harder than it looks" is probably it. You would have to introduce support in the compiler and linker in a way that doesn't break existing software. And while this is obviously possible (C++ has already done it) presumably the tool chain team have had higher priorities on their plate. e.g. in the recent past we have had garbage collection, GCD, blocks and Objective-C 2.0 appear so we can't say they have been doing nothing.

Namespace support is the one thing that I would dearly love to see introduced to Objective-C.

like image 71
JeremyP Avatar answered Oct 17 '22 15:10

JeremyP