Notes IV

bearophile bearophileHUGS at lycos.com
Thu Jan 24 01:08:09 PST 2008


Robert Fraser:
>True, if you're the only one coding. But if there are 20 different people working on a project, who know 20 different subsets of the language, then it becomes a huge issue. Especially if you're maintaining code written by someone else.<

If you have some experience of API design you know that Downs is quite probably wrong there. The size of an API (string functions are an API) *can't* grow without bounds, it must to be the result of a (more than one) compromise.
If you put too much things in it, you end having functions with similar purpose that you can exchange with each other for mistake, and you end looking in the manual often, slowing down your coding speed (and debuggin/code reading speed of code written by others, as you say. Experience shows that often reading code is more common than writing it). If you take a look at Delphi (or even Ruby) you can see that problem.
While if you don't have enough functions (see the C std lib) you end re-writing (or downloading & including) your own string functions (or string-processing code) all the time, so you end with code written in many different ways, with redundant code, and often not efficient enough (because very good string functions contain refined algorithms, see the substring match problem), or even buggy.
The current Phobos is almost there, IMHO it just needs some cleaning, to remove few bits, to make it a bit simpler, and to have its functions written in a more efficient way (and maybe work with Unicode better, but I am not sure about this).

Walter has told me that I can offer more efficient string functions, but I don't know how or where to submit them :-)

Bye,
bearophile



More information about the Digitalmars-d mailing list