←back to thread

-2000 Lines of code

(www.folklore.org)
499 points xeonmc | 3 comments | | HN request time: 0.64s | source
1. justtinker ◴[] No.44387237[source]
In the days when perl was the language of choice for the web I got a 97% reduction in code size. I was asked to join a late project to speed it up. (Yes I know that has low success rate).

The lead dev was a hard core c programmer and had no perl experience before this job. He handed me a 200 line uncommented function that he wrote and was not working. It was a pattern matcher. I replaced it with 6 lines of commented perl with regex that was very readable (for a regex).

Since he had no idiomatic understanding of perl he did not accept it and complained to management. We had to bring in the local perl demigod to arbitrate(at 21 was half my age at the time, but smart as a whip). Ruled in my favor and the lead was pissed.

replies(1): >>44388835 #
2. ryao ◴[] No.44388835[source]
Was he unaware of regex.h?

https://www.man7.org/linux/man-pages/man3/regcomp.3p.html

replies(1): >>44390096 #
3. sgerenser ◴[] No.44390096[source]
Doing regex in C back in the day was not very common and far from idiomatic, unlike perl where its basically expected that you cram regexes in anywhere you can.