4 ms·
As someone who does a ton of Objective-C, I challenge the notion that namespaces are even remotely necessary ... Apple is now suggesting that you use three-cha
by ant5 16y ago
As someone who does a ton of Objective-C, I challenge the notion that namespaces are even remotely necessary ...
Apple is now suggesting that you use three-character class name prefixes, since they claim all the two character ones. I had my two character prefix claimed by a new private framework Apple added to iOS, and now one of my class names conflict with one of theirs. Kaboom.
If you go the no-prefix route, your code isn't library-reusable since other people will do the same thing, and you will still get screwed -- Apple regularly claims non-prefixed classes in their code, too.
My assumption is that you simply don't grok it, that you haven't learned how to utilize dynamic dispatch, KVO, etc. to greatly simplify and streamline your application designs. Or you are one of those script kids that takes all the low level shit for granted. This isn't python. This isn't ruby. This isn't even smalltalk.
Seeing as you're writing ObjC using a compiler I've worked on, I think that probably understand the "low level shit" better than you do.
- jawngee 16y agoSo you work on GCC and are complaining about mostly legacy C things? What?
- ant5 16y agoJust because I have the perspective to understand what's wrong with a language doesn't mean I can't or won't use it when it is the correct solution in a specific problem domain. If Apple developed a first-class alternative to ObjC I would switch in a heartbeat. In the meantime -- to write Mac/iPhone apps -- I will continue to use it.
- Zev 16y agoThe best way to hate a language is to implement it. It forces you to learn all the ins and outs of the language, every nook and obscure corner that something, somewhere, depends on.
- Zev 16y agoApple is now suggesting that you use three-character class name prefixes, since they claim all the two character ones. So you saw that talk at WWDC as well? Every engineer from Apple that I've spoken to and asked about this has gone "What?! Did he really say that? Ignore it. We don't recommend that. Not at all." Seeing as you're writing ObjC using a compiler I've worked on, I think that probably understand the "low level shit" better than you do. You work on LLVM? Props to you, if so. Thats an awesome project. However, if you work on gcc, I haven't used that in over a year :-) (I kid. Props to you, either way. I can't do what I do without what you do.)
- ant5 16y agoSo you saw that talk at WWDC as well? Every engineer from Apple that I've spoken to and asked about this has gone "What?! Did he really say that? Ignore it. We don't recommend that. Not at all." Regardless of what they say, Apple is still claiming new two-character prefixes, including the one I've been using for years. You work on LLVM? Props to you, if so. Thats an awesome project. However, if you work on gcc, I haven't used that in over a year :-) I'm a big fan of LLVM, but no, I've done nothing with it. That said, if you're using clang for your production builds, you're a much braver soul than me. There are still plenty of codegen issues, especially in the new iPhone/ARM support. There's a reason Apple is still using GCC.
- Zev 16y agoThat said, if you're using clang for your production builds, you're a much braver soul than me. Hardly brave; I only use it personal projects (which target 10.6/64-bit Mac) and debug builds. Release/Ad Hoc/Distribution builds for what I work on uses llvm-gcc. But, I'm not responsible for those builds.