>>hmmm, only used textmerge to get pretty printed SQL or other strings, but never measured it against traditional assignment.
>>Even if it should employ only normal variable assignment, the style should help to eliminate memory thrashing via unneccessary temp variables/steps in between.
>>Do you have reason to believe it employs something else like memory mapped files?
>
>I think it uses a series of strextract(), eval() and stuff() calls. While the last function was there since forever (I think I even saw it in Clipper 87), the other two were, I think, first internally used in textmerge as early as Fox 2.0. Then the gods saw that these were good, and made them public.
>
>When I see some of my old code, from the nineties, where I used \ and \\ for output into a file... it worked, was blazingly fast, and the code was a mess. Once we got text-endtext into a variable, I never used those clumsy things again. And I think assignment with all chopped pieces being put together is equally messy.
for me the only antipattern is more than a handful of lines always adding to and reassigning the same result variable, especially if done in consecutive lines.
Not relying on language specific things like \,\\ and textmerge for trivial code makes porting the code to another dialect or even language much easier and I encountered that often enough. So I decide on the probability that this code will be ported or used as a template for porting wether to use textmerge or single assignments spanning a dozen or more lines of string concatenation.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement