News for hackers. Stuff that matters.
Re:A glance into web tech-based text editors’ text management by lpasselin on Friday November 11, 2016 @10:31AM (#12931454)
"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?

Re:A glance into web tech-based text editors’ text management by rawnlq on Friday November 11, 2016 @11:59AM (#12932354)
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.

Re:A glance into web tech-based text editors’ text management by time4tea on Friday November 11, 2016 @01:04PM (#12932802)
What a waste of fossil fuel energy!

What a waste of laptop battery!

It can be really hard to make software efficient, sometimes there are easy wins.. seems odd to not just do it.

An insert or delete from (e.g.) a rope is very cheap and as they are immutable can make some other features very easy... saves copying megabytes...

Re:A glance into web tech-based text editors’ text management by saosebastiao on Friday November 11, 2016 @12:10PM (#12932446)
I'd imagine that only having a partial buffer available makes it really hard to do text highlighting, auto completion, linting, etc.