Tuesday, December 18, 2018

Take tokenizers, for example

30 lines of string spaghetti, works from an unknown string and a separator, operator string. It finds the markers. Mine finds he markers and produces null terminated strings. You find these on most systems, and for linux they are often a cutnpaste snippet. Too simple to make a library, but you all want to use the same ode for conformity. Snipes are great.

Why not make the general interface?
tokenize(int*argc,void *args[]);

About half the codes us the words 'tokenize' and how many different call formats?
tokenize src punct separators

 In a shared lib, the easy interface for a snippet is the universal interface, it never changes.

Move the call interface design and semantics to a layer above, keep it out of the Snippet codes, seriously. Make your enterprise an intelligent collection of snippets, each snippet knows only local variables. The use your high powered engines to format the args list properly over the collection of snippets.

No comments: