2 ms·
> If you can do with one regex what would require 10 "fast" string manipulations, then the regex will nearly always be faster. Agreed, but most of the time I o
by nailer 18y ago
> If you can do with one regex what would require 10 "fast" string manipulations, then the regex will nearly always be faster.
Agreed, but most of the time I only need one string manipulation, and from what I can tell, the code behind split and endswith etc. are faster than using RegExs in the same place. Recently I've had to convert something back to Python 1.5, which lacks string methods, but has regex's, and it's noticeably slower.
>>It's also common for Perl users to use RegExs to do things like modify markup languages, which is extremely fragile - use a tree data structure and paths
>This has nothing to do with Perl.
It has something to do with Perl - Perl lacked these data types in the mid 90s Perl boom. So people who learnt Perl then see no problem with using what's always 'worked for them'. I agree it's nothing to do with the language as it stands now.
> When you write code, expect that you will be the primary maintainer forever.
Would you hire someone that said that to work on your startup?
>> Your beholders value simple code rather you selfishly saving a few keystrokes.
> If you can't read Perl, perhaps it's because you don't know Perl.
That's a troll. I can fix a problem with a blank editor and Perl, and I can read and debug most people's Perl. Not being able to understand someone's sloppily indented bracket abortion-code isn't because I don't 'know' the language.