Hacker News new | past | comments | ask | show | jobs | submit login

Try re-indenting a large xml file, or something else that will result in a very large number of small deletions and insertions throughout a file. Even on a modern computer the underlying data structures will make the difference between something near instantaneous and the user giving up in despair after a few minutes. A simple array does not cut it.



Formatting a file could be a single operation that creates a single array of lines. Normally the formatter is a separate program that actually gets the input as string and returns a new string as output. So the extra concatenation and splitting would not cost much extra.

The formatting is often difficult enough that it will need a separate data structure anyways.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: