That will make a good weekend read thanks! Others may be interested in Data Structures for Text Sequences by Charles Crowley[0] which describes Piece Tables. This is the basis for the Vis editor[1].
"There is a huge opportunity here to contribute to Atom and make it way better than it already is. Write a piece chain text buffer implementation. Write a gap buffer implementation. Anything but using a regular array like this."
Is it really that easy? Why aren't they using those data structures already?
Because it doesn't matter with modern day CPUs with typical file sizes and typing speeds.
Worst case scenario for a plain array is if you insert to the front of the array where it has to shift everything down one. But even if the file is on the order of several megabytes, this will still finish in milliseconds at most and the typist won't notice it.
Key takeaway from the article: "One thing I'm taking away from this is if I ever need a web-based source code editor, hands down I'm going with CodeMirror."
I long for the day that Microsoft starts transitioning to C# on .NET Core for vscode. They made the right choice using typescript on the electron platform, but the difference in efficiency between C# and js is night and day. I've heard it's in the long term plans, but how that'll work I have no clue.
For those wondering why the heck you would make a web based text editor: browsers are actually very good at displaying text, and javascript is good at handling text.
That headline hurts my brain. Awful start. Why not "how web based text editors manage their text" or "a glance at the text management of web based text editors"
The new title is not accurate though, since those editors are not "web-based", but indeed "web tech-based" (based on Chrome), or perhaps simply "HTML/JS-based".