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

If you have strings that long, maybe it would be wise to break it up semantically into some collection of resources (paragraphs, lines, etc.). It could be reassembled as needed for display but then stored and updated as its semantic parts.



Taken to an extreme (and isn't that what programming is all about), that could end up using a lot more memory and overhead, storing an array of many short strings, instead of storing one big flat string. And it would also require more work and pointless code complexity to deal with many short strings.


As opposed to the pointless complexity that comes from implementing support for string diffs?

Having implemented a json differ (which is similar, but with different representations of the paths due to having uniform access to nodes in the tree due to having id elements everywhere that matters), I would consider string diffs overengineering.




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

Search: