Hacker News new | ask | show | jobs
by rpsw 1809 days ago
I think in a real parser your instincts would likely serve you well.

For example, if a string data type was added, our tokenize method could not be this simple.

To the actual question, I think one good approach when cutting corners or doing a quicker sub-optimal approach, is to document the limitations and assumptions in some way. You could then evaluate and prioritise you efforts and time from this, rather than getting stuck in the weeds early in the process.

1 comments

Barring the use of unsafe, Rust gives you more guarantees about containing low quality code behind good interfaces, so in Rust, one should do the thing in the most expedient manner and then can revisit it after the program is working.

Working code can be iterated on, by multiple people. Non-functioning code cannot. Having a repo in state that can be shown functional by a CICD pipeline is the equivalent of achieving a chain reaction and freezing to death. Light that fire.