4 ms·
> Every person sufficiently intelligent to program should figure out by themselves that having 2 parser implementations can cause various undesired consequences
by jraph 3y ago
> Every person sufficiently intelligent to program should figure out by themselves that having 2 parser implementations can cause various undesired consequences.
I disagree. Hindsight is 20/20, it's now obvious to me that using two different parsers for the same thing in a single process can cause bugs, but it didn't occur to me before reading about it.
Now that I'm aware of this, in particular, I'll be extra careful not to parse something manually if something already does it in whatever I'm working on and there's an API for it.
URLs and paths are the canonical (ah!) example of this: it's tempting to just take the string and split by "/". Whoever who has never done this should throw the first stone.
And people who have never written any parser may not clearly see this stuff.