Skip navigation.
 
mlRe: Find the 'Application Support' folder
FROM : John Stiles
DATE : Mon Oct 18 18:03:50 2004

Well, sure, your code example 1 looks better than 2, because it doesn't
do the same thing! :) Not every Cocoa call in the world [[[can stack]
like] this] although I agree it's cool when it works.

My advice to you would be to make Carbon-to-Cocoa wrapper functions
when you need them, and use categories to put them in the classes where
you need them, so you can keep [[[[[coding things] all] on] one] line].
Personally, while I've found that style very convenient on some
occasions, I frequently find that I need to use the whole width of my
Cinema display to write code that actually does something useful :) so
I end up breaking things up a lot anyway.


On Oct 17, 2004, at 4:31 PM, Greg Hurrell wrote:

> El 12/10/2004, a las 18:40, John Stiles escribió:
>

>> On Oct 12, 2004, at 9:21 AM, Charles Srstka wrote:

>>>
>>> FSFindFolder works, but I have always wondered why Apple hasn't
>>> built in a Cocoa API for accessing these folders. Having to go
>>> through Carbon to do this is kind of annoying.
>>>
>>> Yes, there are third-party categories that give this functionality,
>>> but it really should be part of the default API.

>>
>> I've never understood this attitude. I must be missing something,
>> because to me it feels elitist.

>
> Nothing to do with elitism. Everything to do with code readability and
> consistency.
>
> A pageful of pure Objective-C method invocations is much easier to
> read than the same slab interspersed with C-style function calls.
> Here's a contrived example to show the contrast; personally I find the
> first version much easier to read:
>
> // version 1: nothing but Objective-C selectors:
> [[[instance method1] method2] method3];
>
> // version 2: Objective-C selectors mixed in with C-style function
> calls:
> result1 = [instance method1];
> thing result2;
> FunctionCall(result1, &result2);
> if (result2)
>     [result2 method3];
>
> For that reason, if I generally write wrappers for any such function
> calls, if it's likely that I'll use them often. That way all the
> procedural/functional ugliness is encapsulated away, out of sight.
>
> Cheers,
> Greg
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list      (<email_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>

Related mailsAuthorDate
mlFind the 'Application Support' folder Peter Karlsson Oct 9, 16:38
mlRe: Find the 'Application Support' folder Sherm Pendley Oct 9, 17:34
mlRe: Find the 'Application Support' folder David Reed Oct 9, 17:57
mlRe: Find the 'Application Support' folder Finlay Dobbie Oct 9, 18:11
mlRe: Find the 'Application Support' folder Steven Kramer Oct 10, 22:38
mlRe: Find the 'Application Support' folder Sean McBride Oct 12, 02:40
mlRe: Find the 'Application Support' folder Charles Srstka Oct 12, 18:21
mlRe: Find the 'Application Support' folder John Stiles Oct 12, 18:40
mlRe: Find the 'Application Support' folder stephane sudre Oct 12, 19:04
mlRe: Find the 'Application Support' folder John Stiles Oct 12, 19:36
mlRe: Find the 'Application Support' folder Rosyna Oct 12, 20:43
mlRe: Find the 'Application Support' folder Greg Hurrell Oct 18, 01:31
mlRe: Find the 'Application Support' folder John Stiles Oct 18, 18:03