Comment

Comment by fn1

After 20 years of software development I‘ve come to adopt a best practise:

Whenever I start writing a regular expression, I stop and write a „manual“ domain specific parse function instead.

Saved me a LOT of debugging time.

Since I can now use kotlin pretty much anywhere (jvm, browser, shellscripts) this is easy because of the superb stdlib („startsWith“, „lastIndexOf“, „substringBeforeLast(...)“)

The time saved I invest in Unittests for the parser.

parent fn1 8 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton