3 ms·
"There are only two types of people who write the code for parsers from scratch: absolutely beginners and absolute experts."
by tester34 6y ago
"There are only two types of people who write the code for parsers from scratch: absolutely beginners and absolute experts."
- gumby 6y agoGood advice, but every good rule requires context: sometimes a really simple grammar (e.g. a lisp tokenizer) is faster to implement with a tiny handmade recursive descent parser that could fit on a single page of code. Faster to write and easier to understand than calling out to a pen external lexer. Not THAT being said I will contradict myself: when you are writing a tiny language like that it’s easy to accidentally add dependencies like context-sensitive behavior. Which means if things grow to the point where you need a parser generator it may become much harder.
- rualca 6y agoThat quote without context or the rationale just feels needlessly snarky, as it leaves out arguments in favour of using parser generators.