News for hackers. Stuff that matters.
Re:Important PostgreSQL 14 update to avoid silent corruption... by RcouF1uZ4gsC on Thursday June 09, 2022 @08:20PM (#31688576)
Actually I don’t mind big files. It is simpler scanning through it or doing a quick search than if you had a bunch of smaller files. And 5000 lines is not awkward for most editors, especially as many editors have the ability to collapse functions.
Re:Important PostgreSQL 14 update to avoid silent corruption... by eyelidlessness on Thursday June 09, 2022 @08:44PM (#31688731)
This feels like a good area for tooling (editors, source hosts, SCM extensions) to improve experience. I don’t always mind large source files (and sometimes may prefer them over large file system hierarchies), but the can be a pain to navigate in some circumstances.

As an example, making several related changes in very different parts of a file, where you need to cross-reference between them. The changes themselves might be small, but it’s a huge cognitive burden to alternate/iterate through them. I’d love to have a view which temporarily projects those targets as if they’re isolated files without changing the actual structure on disk. I’d love it so much I actually do this manually for a lot of tasks, creating temp files to prepare edits for related areas of code. But then I lose a lot of the benefits of tools which understand what’s being referenced. It would be great to just type a quick command (or click or whatever) to say “don’t refactor this function to another file, but let’s pretend you did, for a while”.

Re:Important PostgreSQL 14 update to avoid silent corruption... by BlueDingo on Friday June 10, 2022 @12:02AM (#31689889)
This is how older editors like emacs work. You interact with views/windows/tabs called buffers and those buffers can have files loaded into them. Multiple buffers can reference the same code file but view different sections simultaneously. So you can investigate or edit different parts of one huge file the same way you would smaller ones.
Re:Important PostgreSQL 14 update to avoid silent corruption... by wahern on Friday June 10, 2022 @01:43AM (#31690484)
You just blew my mind.

I use JOE and JOE also supports multiple views into the same file. In fact, to open another file is two commands: the open view/window (^KO) command followed by edit file command (^KE). I've always used this facility for as long as I can remember and it never really occurred to me until now that people using more modern editors and especially GUI editors may not enjoy this same convenience--either not possible or no simple chain of command inputs to get there. And it's not like I don't use GUI editors, just not in situations where I would realize this feature was missing.

Re:Important PostgreSQL 14 update to avoid silent corruption... by joking on Friday June 10, 2022 @02:10AM (#31690664)
You can do this in vscode as well, even have it side by side. I’m missing something?
Re:Important PostgreSQL 14 update to avoid silent corruption... by qw on Friday June 10, 2022 @04:16AM (#31691411)
I just opened IntelliJ and it has this feature too, where you can "Split right" or "Split down" and have multiple views of the same file. Thanks for letting me know this is something editors might support.

For some reason I have not noticed that feature before. It's not like it is hidden either, as it is in the "right click" context menu that I use daily. I guess I need to learn the tool, so that I don't miss useful features like this.

Re:Important PostgreSQL 14 update to avoid silent corruption... by mjw1007 on Friday June 10, 2022 @04:26AM (#31691483)
For the "temporarily projects those targets as if they’re isolated files" part, you want something like narrow-indirect or edit-indirect.

https://www.emacswiki.org/emacs/NarrowIndirect

https://github.com/Fanael/edit-indirect

Re:Important PostgreSQL 14 update to avoid silent corruption... by djsavvy on Thursday June 09, 2022 @11:22PM (#31689610)
> The changes themselves might be small, but it’s a huge cognitive burden to alternate/iterate through them. I’d love to have a view which temporarily projects those targets as if they’re isolated files without changing the actual structure on disk.

This is exactly how vim buffers work (for instance in a split) work.

Re:Important PostgreSQL 14 update to avoid silent corruption... by eyelidlessness on Friday June 10, 2022 @02:00AM (#31690598)
I’m glad to see I’ve brought the emacs/vim people together for a common purpose!
Re:Important PostgreSQL 14 update to avoid silent corruption... by cozzyd on Thursday June 09, 2022 @11:18PM (#31689585)
this is what :[v]split is for.. .