Re: ObjC's flat and all-exported namespace, help!
Re: ObjC's flat and all-exported namespace, help!
- Subject: Re: ObjC's flat and all-exported namespace, help!
- From: Ian Joyner <email@hidden>
- Date: Thu, 10 Nov 2011 12:04:54 +1100
On 9 Nov 2011, at 22:44, Andreas Grosam wrote:
>
> On Nov 9, 2011, at 12:11 PM, Karl Goiser wrote:
>
>> Your first option looks better to me!
>> :-)
>>
>> All I’m saying is that Objective C is a very mature language now
> Depending on your perspective, you can say this for many languages. But only the dead ones do not evolve (Objective-C, does it, though)
>
>> and if it has been able to get by
> You should ask the *developers*, not the *language*, if they experience issues and if they feel comfortable to workaround these issues.
>
>> without adding this extra layer of complexity, why introduce it for an edge case to address a situation where people are expecting it to act like C++?
> I wouldn't say it is an edge case. If you develop small applications in a one-man company, and no plugins, you may feel this as a minor issue.
> Others won't agree, and actually have a big problem.
>
> Namespaces for Objective-C will likely not require the same feature set than what is available in C++ (e.g., no argument dependent lookup). There is also no need to do this. The only thing that should be considered when introducing namespaces in my opinion is, that it should be seamlessly integrated into Objective-C++. The negative asset against C++ made from a few posters here, is futile - Objective-C will have and be Objective-C++ as well. This requires to consider C++ syntax - and IMHO, regarding namespaces, it isn't ugly at all.
Well, a lot of folk consider that Windows isn't ugly, after all they find it useful to do some work. But it is ugly!
Let's forget the subjective term ugly. Why is it not good? The same reasoning is like the goto argument. Dijkstra pointed out gotos considered harmful, and Knuth said you could do structured programming with gotos. Both were correct.
The problem with C is that it exposes too much low-level stuff that makes code inflexible and doesn't add anything to the power of the language. For example C pointers are the data structure equivalent of gotos. That is coming from the bottom up, so that stuff that is at a lower level than should be in an algorithmic language is exposed.
The problem with C++'s namespace mechanism, is it's exposing the opposite, the higher-level organizational aspects, and putting these in the programming language. Thus the higher level that should also not be in a programming language is exposed. This complicates the programming activity and hides the true purpose of a computation. This is a concern.
A parallel with aspect-oriented programming is that AOP attempts to remove cross-cutting concerns from regular code, so that the real purpose of a computation is clear.
Modularization aspects (at least the mixing of modules) really should not be a part of the language. We program a module, but it should be as independent from its environment as possible. That is essential to reuse. Imports and #includes expose the environment internally in a module.
We are progressing towards this and C++'s implementation of namespaces really goes in the opposite direction.
It's the old I have a hammer so everything looks like a nail, but in C++'s case it's I have a programming language, so everything gets put in that. We really need to get away from that kind of thinking about programming languages and get back towards the Smalltalk ideal. Objective-C does that, which makes it the nicest flavour of C. The programming community needs to learn what the phrase 'separation of concerns' really means.
>
>>
>> Apple, after all is all about being simple and clean, and its language of choice should reflect that because, after all, it’s the developers who create the simple and clean. In my opinion, Objective C is an embodiment of the Apple attitude.
> From the developers view, using namespaces shouldn't appear to be complex and its usage should be certainly optional. IMHO, Objective-C could stay without having namespaces. C is required to use the same approach to avoid name conflicts: prefixes. However, introducing namespaces to Objective-C++ could be worthwhile to investigate if this is feasable. IFF, then integrating namespaces with C++ possibly could be done seamlessly.
>
> Andreas
>
>>
>> My favourite saying of all time is, “to a person with a hammer, everything looks like a nail.” Objective C is a screw, and you use a screwdriver on it, nor a hammer.
>>
>>
>> As far as versioning issues from the same class in two bundles is concerned, if the class works to spec, there’s no problem. If it doesn’t, that’s a bug, and wouldn’t the bundles have to be updated anyway?
>>
>> Karl
>>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >ObjC's flat and all-exported namespace, help! (From: Andy O'Meara <email@hidden>) |
| >Re: ObjC's flat and all-exported namespace, help! (From: Greg Parker <email@hidden>) |
| >Re: ObjC's flat and all-exported namespace, help! (From: Ian Joyner <email@hidden>) |
| >Re: ObjC's flat and all-exported namespace, help! (From: Jean-Daniel Dupas <email@hidden>) |
| >Re: ObjC's flat and all-exported namespace, help! (From: John Joyce <email@hidden>) |
| >Re: ObjC's flat and all-exported namespace, help! (From: Karl Goiser <email@hidden>) |
| >Re: ObjC's flat and all-exported namespace, help! (From: Andy O'Meara <email@hidden>) |
| >Re: ObjC's flat and all-exported namespace, help! (From: Karl Goiser <email@hidden>) |
| >Re: ObjC's flat and all-exported namespace, help! (From: Andreas Grosam <email@hidden>) |
| >Re: ObjC's flat and all-exported namespace, help! (From: Karl Goiser <email@hidden>) |
| >Re: ObjC's flat and all-exported namespace, help! (From: Andreas Grosam <email@hidden>) |