3 ms·
> Keeping track of what the current indentation level should be also seems like something that any tool which outputs source code already does. The challenge y
by MadcapJake 4y ago
> Keeping track of what the current indentation level should be also seems like something that any tool which outputs source code already does.
The challenge you are refuting is about building said tools. Just because existing tools have pushed through this challenge doesn't mean it's not both tech debt for those existing tools and a challenge for any new tool in the space.
I think the best argument imo is that whitespace has to be properly maintained per line which adds computational cost and statefulness.
- TylerE 4y agoHow hard is it really? Instead of write(“{“) it’s indent += 1 and write(“ “*indent) and the start of each line. Decrement where you’d have a }