3 ms·
Doesn't matter. People are roughly as good at comprehending languages given the same number of lines.
by kqr 5y ago
Doesn't matter. People are roughly as good at comprehending languages given the same number of lines.
- Jensson 5y agoI'd like to see someone try to review a 200 line regexp. They might take about the same amount of time to write per line, but they definitely don't take the same amount of time to read.
- kqr 5y agoIt sounds like you have an illegible, compact regex in mind. If you write regexes like that for others to read, I feel sorry for the other people. If you write the regex like you would production code, i.e. with whitespace, newlines, and comments[1], I imagine 200 lines of regex would be about the same as 200 lines of any other type of production code, be it APL, Haskell, or conjunctive normal form. I realise this is a bit of a circular argument: if you write the code such that 200 lines is about n units of review in a specific language, then 200 lines will be about n units of review in any language. But that's also kind of the point. There's a very specific logic density that you can accomplish for production code to be readable, and that results in about that density being reviewed. [1]: In Python you can do this with the re.VERBOSE flag, in other languages you can do it by breaking the regex apart into separate variables that are then combined together.