[fpc-pascal] Re: Example: regular expressions and "hash-tables"

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Sat Mar 23 09:47:32 CET 2013


Mattias Gaertner wrote:

>> Also, there doesn't seem to be much use of regular expressions.
> 
> Well, I guess Pascal programmers prefer readability over shortness.

They're definitely not a panacea, but where you want to do things like 
extract the x.y.z version number from e.g 'PostgreSQL 8.4.6 on 
i686-pc-linux-gnu, compiled by GCC 2.95.3, 32-bit' and 'LI-V2.5.0.26054 
Firebird 2.5 Release Candidate 3', using regexes can end up being more 
readable provided that the comments include examples of what should be 
matched.

I know that function and variable names should be chosen so as to reduce 
the need for comments, but I feel that large sections of the programming 
industry are still biased against them because they have this fixed idea 
that they introduce overhead in the generated code or can give away 
trade secrets to the end user. In short, we're still hobbled by the 
legacy of interpreted BASIC, which is about all that some management 
types know.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list