gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re[4]: additional methods in NSMutableString


From: Markus Hitter
Subject: Re: Re[4]: additional methods in NSMutableString
Date: Fri, 7 Jan 2005 11:12:51 +0100


Am 06.01.2005 um 20:03 schrieb Manuel Guesdon:

o about performances, ...

Well, you'll have to run some benchmarks to find out.

Surely, you already know NAT!'s great article(s) about Objective C optimization: <http://www.mulle-kybernetik.com/artikel/Optimization/>.


o will it be possible to add a method in NSMutableString like this: -setCharacters length: ...

Just to add a more general comment ...

One of the big advantages of OpenStep / Cocoa is it's simple, easy to remember API.

Adding methods also has disadvantages:

- GNUstep code becomes more complex and more difficult to maintain.

In your example, any change to your extensions have to be kept in sync with the methods they replace. You have to write and maintain documentation etc. .

- Overall performance degrades: More methods for the dynamic linker to consider, bigger libraries to load.

- Writing applications becomes more difficult since you have to choose from a bigger set of methods. If you have several methods to solve one problem and you just ignore some of them because you have lost overview, the whole point of API extension is moot.

- Compatibility with OpenStep / Cocoa degrades: You have to work around these extensions if you want to have portable code. Portability is a big plus of GNUstep.

- Adding a method fitting to a particular situation doesn't automatically increase performance in this situation.

In your case, most of the point of NSStrings over NSMutableStrings is better performance. I can well imagine creation of a few temporary NSStrings to perform better or almost as good as some specialized NSMutableString methods.

- For coding convenience, you get the same result with much less work by adding a category in your personal code base only.


Please check the results of your work and consider, wether it makes sense to change the GNUstep API, carefully.


Thanks,
Markus

- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]