http://www.perlmonks.org?node_id=1015503


in reply to Re^2: Is there a module for object-oriented substring handling/substitution?
in thread Is there a module for object-oriented substring handling/substitution?

Anonymous Monk:

I don't care much for speed, I care about convenience and elegance.

Regarding the use-case of creating editors, they might prefer to use their own special-purpose class for performance reasons, with integrated support for efficient feedback on state changes of tracked ranges. For example, the Kate editor (coded in C++ with Qt and KDE libs) uses a light-weight class called MovingRange for keeping track of persistent ranges withing an opened document. They created this solution from scratch in 2010, dropping their previously used, more generic framework called "SmartRanges", in part due to performance reasons (see blog post).
Now, if this is a performance-critical code path that benefits from special-case optimization even in an editor written in C++, it probably will be even more so in an editor written in Perl...

For my purposes, notification about state changes is not needed, nor is performance a critical consideration so having a full substring class that stores a copy of its text (rather than just a thin "range" class pointing to a location withing the parent string) should not be a problem.

  • Comment on Re^3: Is there a module for object-oriented substring handling/substitution?