Desktop icons are surprisingly hard
akselmo.dev
akselmo.dev
Fortunately I didn't have as much trouble in the "reading code is the hardest part" dimension, as I was largely redoing code I myself wrote around 20 years ago (though others had changed it a bit in the meantime).
It's fun to see a lot of the same problems I had when modeling how all of this should work. Xfce 4.20 (probably end of next month) will have all of my changes for this, but of course I expect I've broken some things as well and will have to add in a bunch of little hacks and workarounds. It's a truly weird, complex problem, even though at first look it feels like it should be simple.
Unfortunately, almost everything is.
Sometimes, when I'm reviewing code I did just some weeks ago, I'm completely lost.
(Checks source history)
Crap, I did
Do not wind them around your hand, this creates a curling force that makes them tangle. It’s a fundamental symmetry effect in action, with which you turn a straight line into a knot. Try the same with a flexible ruler tape and you’ll see how much it twists, unless you counter-twist every loop.
Instead just gather the wire into a flat compressed /\/\…/\ form and put it there. The worst thing that will happen now is one accidental semi-knot that is trivial to shake away.
Now I wonder how that applies to code, maybe we’re onto something here.
Just like you would with a garden hose, or a rope on a sailing boat. Tangled ropes is a potential problem there so no one would flail your hands about and hope for the best. Instead you roll neatly.
That's the whole trick: don't wind, twist.
Observe: take a short cable (or a piece of thread), hold it straight at each end with two fingers by the wire; at one end, roll the cable along its main axis between the two fingers; a loop forms, purely through created stress.
Now, with a longer cable you just accumulate such loops by iterating over the length; stress can be relieved by accompanying the cable while twisting: there should never be any resistance felt.
If done correctly the folded cable should be able to lay flat on a table and not move a millimetre. Note that there's a "natural" radius that is best respected.
One could stack a bunch of those in a box and they basically won't mix unless massively shaken, but to make sure one can tie a single point of the loop to eliminate lateral slack.
Source: folded a cumulated thousands of kilometres of usb/ethernet/XLR/6.35" cables over the years, packed together in bags or boxes.
The “accordion” method actually counteracts knotting because it forms a sort of an amorphous spring that is unstable outwards rather than inwards (careless winding) or just being stable (twisting). I find it more useful as it never twists and tends to decay into a straight wire by itself. But ymmw, cause it tends to be all over the place in your pocket/drawer/etc. also doesn’t work for hoses cause they deteriorate at sharp folds.
The moral is just know your methods and where they apply and if that suits you the best.
On a short cable like a headphone string, this is just a matter of holding the cable up so the plug can rotate freely. Then you can do anything, you won't accumulate stress. (On a longer cable that means putting temporary stress on the non-wound part of the cable. If it's too long, you need to remove it from time to time.)
Anyway, I've just printed a ton of cable-winders, for all sizes and calipers, and never thought about it again.
That is a great tip: "hold the loop in left hand, cable in right, both palms up, then bring thumbs together to create the 'under' loop"
Hopefully the new code discussed in OP isnt quadratic.
> Symbol servers are good. If you are on Windows then make sure you are using symbol servers. If you are not on Windows – I’m very sorry (and by that I mean that it is a shame that debugging and profiling – especially of issues on other users’ machines – is so much harder for you).
It seems that the author believes that only Windows has good debugging symbol support, which isn't true at all. In fact, several Linux distributions provide debugging symbols for most of their packages, and from my own experience I know that in particular Arch Linux and Void Linux are quite easy to set up to use them. I'm not even getting started on the availability of source code.
Void Linux in particular is very convenient for debugging issues on different architectures, because its package build system inherently supports cross-compiling for multiple architectures from the same package definition with minimal extra configuration, including generating debugging symbols. Naturally these symbols are packaged separately from the binary packages that reference them, so there is no need to install binary packages for an incompatible architecture just to get at the debugging symbols.
A better rebuttal to "symbol servers make debugging on Windows more convenient, because they allow you to open a debug trace from someone else's computer and immediately have symbols available that match the versions installed on their system" would be "here's how to configure your debugger on Linux so it automatically downloads the correct symbols as well."
Edit: I guess the answer is DEBUGINFOD_URLS https://sourceware.org/elfutils/Debuginfod.html
Microsoft's symbol servers allow cross-OS-version symbols with ease. The easiest solution I've seen on Linux involves downloading a full copy of the foreign distro and hope the exact library versions on the server are still available in the repos.
The Void Linux tooling sounds interesting for sure, but by your description I think it doesn't solve the same problem?
Linux has made progress in this area, but I think that Windows is still better. Maybe I'm wrong (I haven't used Linux in a while) but I think when Linux developers say that they have excellent support for debug symbols this just means that they don't realize how good it is on Windows.
I can load a crash dump or ETW profiling trace that has come from a customer using any version of Windows and load it up on my machine and the debug symbols just appear. Windows 11? Windows 10? Windows 7? Some random patch level? It doesn't matter - they just show up. When I worked on Chrome I had that symbol server configured as well, so any combination of old Chrome version and Windows version would just work. It's really magical.
In addition, Chrome source code would automatically show up as I explored the crash dump. That's source indexing which is separate but related, and also magical.
If some Linux variants work this well, then that is great. Last time I tried I found there were many different steps and debug packages to install just to get all of the symbols for my local Linux install, and handling other Linux installs was more complicated.
This is all I do to make it work on Windows:
```set _NT_SYMBOL_PATH=srvc:\Symbolshttps://msdl.microsoft.com/download/symbols;SRV*c:\symbols*h...```
This might be one of these cases in which Windows had to become better. On Linux, you always could recompile everything yourself enabling debug symbols, but that's not an option on Windows.
I find these kinds of problems the most fun and the most educational! I tried building a grid layout system from scratch in SwiftUI, and it was similarly tricky to map out:
- what the "ideal" behavior one expects is,
- what edge cases exist,
- how to handle the edge cases,
- maintaining ideal behavior while handling edge cases.
(It was tricky b/c SwiftUI lays out its children, then its parent -- so the parent needs to ask its children for its view size, and iterate and set rows/columns that way.)
Maybe because the problem seem simple, it is that much more fun to dig into. Some good ol' time with a whiteboard.
The bug described in the article was the icons being moved around without user input, and then their wrong/unwanted location saved as "user preferred icon arrangement". Which sounds like an obvious bug in hindsight.
Users normally place their icons using a given, single resolution, so that would only give you one initial saved icon position. You need some heuristic when the user first changes resolution with that icon present on the desktop.
*lifetime of that computer
Icons need arrangements in each combination of monitors, resolutions, and scaling. So that when I'm sitting at my desk in the office I have a consistent experience of icon location. When I'm at home and have different screen layout, I can have a different icon layout suited to that screen layout and everytime I plug the dock in at home I should get the same arrangement that I had yesterday. If there's a new icon that has never been placed in a particular desk setup, drop it anywhere.
Does it change often enough that an absurd like 20s update-time would impact you?
Anyway, the article has plenty of reasons to save more than 1 resolution as "user-defined positions". But not a lot of them, probably 2*n^2 for n monitors is more than enough.
Give me a one dimensional list, or table I can sort, search and actually find things in.
No, I am not much fun at parties, why do you ask?
I can understand the desktop metaphor but just because it is intuitive to aged boomers that liked Steve Jobs does not make it right. But these people did not get the advantages of the history file or how command line meant that you could repeat common tasks with an exclamation mark + number.
Another thing that gets me with icons is when people over complicate them. An icon has to be simple, if it is not simple then it is not an icon.
I’d like to use spatial sorting more and in regular folders, but that’s very fragile and second-thought in most UIs. Also they provide no visual cues, so I can’t leave my file in the left black drawer with a flower sticker on it.
Yes I know about Bob and how it failed. But it works for me in e.g. Fallout games where I can use multiple boxes in different rooms to sort my loot. I just know that my plasma rifle is in the metal box near the bed and cells are in the dresser.
The ability to find things without creating, remembering and searching the names or containers feels good.
Oh yes! And so under appreciated. Things that have their place is absolutely crucial. Imagine if your menu bar sorted based on how often you used “edit” vs “file”. Or why not have the keys on the keyboard change based on frequency? I’d argue we should leverage spatial- and muscle memory much more in UX and design.
It’s strange that UX overlooks space so badly and uses same-{shape,color,font} elements everywhere. I guess it’s due to that Bob meme, what else.
There’s “Raskin”, but it also isn’t perfect in this regard.
I've heard that the "spatial Finder" from the old Mac OS worked like that: from what I understood from reading a couple of classic Ars Technica articles about it, there was a direct one-to-one correspondence between each folder and the window which represented it on the screen, and each of these windows always preserved its size and position. Quoting from https://arstechnica.com/gadgets/2003/04/finder/
"[...] There was no such thing as a "Finder window" that "displayed the contents of a folder." Double-clicking a folder opened it. The resulting window was the folder. When scrolling, moving, or resizing that window, there was no doubt about which folder was being affected. And the stability of the interface was such that there was no doubt about what that folder would look like the next time it was opened."
Yes, if you can organize your staff. Windows 10 and 11 will just put your icons as it see fit, without the option to change the size of them. Position is also monitor dependent. And the ribbon is a disaster for spatial navigation.
Does anyone have experience using an LLM to extract documentation from code?
Or are LLMs bad at it because we have too few good examples? :)
If you're lucky, you get something bland and verbose, but not incorrect. If you're unlucky, you get something dangerously wrong that a later reader assumes is true / important, since "otherwise, why would they have put it in the documentation?".
This is part of why I refuse to work on codebases which LLMs have mucked about with. Even the most basic things cannot be relied upon. (Note: refusal can be overridden by suitable application of financial compensation.)
Happy to read that PS
> That's fair. Why show desktop icons on a screen that is non-existent?
Custom keys to launch the most used apps.
Alt+F2 to launch less used apps.
And... the big star... one of my reasons for stay in fluxbox for so many years, the custom menu (right click anywhere in the root background, left click in the corner of the toolbar, or custom key to launch the menu).
Custom menu that can make includes, oh yeah, can be updated via cron/systemd-timer/scripts, etc so you can have a hierarchical menu to all your machines, by project, by datacenter, by service, IPMI, ssh, remote desktop... always up to date (i.e. from ansible-inventory). Or you can have your browser boomarks in the menu (with the same folder hierarchy). Or you can implement your own RSS in the menu via cron. Anything you can imagine.
For me, hierarchy > 2D positioning, and "desktop" != root folder for any "data".
Last step of my weird, non mainstream setup, is the all my data is not in my home, but it's in /data/myuser (in a partition separated from the OS), in folders like backup, docs, downloads, media, src, vms which are linked to my home. All dot files that I care are under my custom config management system (sh script + git), and all the data is in /data (+backups). Why I mention this? it's on topic... some apps try hard to use the "desktop" directory. So I have this bit just for them:
$ grep DESKTOP .config/user-dirs.dirs
XDG_DESKTOP_DIR="$HOME/docs/desktop"
Because why the hell a browser need to mkdir ~/Desktop or ~/Downloads for nothing.My app launching shortcuts/menu are very well organized and optimized. My data is in /data. I live without the "desktop is everything/anything/chaos-thing" seen in many people machines, and I'm happy.
When I've used other's OSs with a desktop full of icons, I dislike specially not being able to make the exact placement because of auto alignment.
If I used desktop+icons, would like something like diagramming apps: "Let me place things exactly where I want, but, let me align groups of selected items, horizontally and vertically, via context menu/shortcut when selected".
All the apps that I launch multiple times per day have their own global shortcut keys. And then for everything else I have a setup where pressing the Windows logo key brings up a "start" menu right where the mouse pointer is. From this menu I can then launch the other apps that I use infrequently. Super convenient.
But really the best part of Fluxbox is that never changes. I think I've run the setup for about 20 years by now with only occasional minor tweaks.
As an old grumpy developer things not changing without my consent is the best possible feature. I have absolutely zero interest to learn new shiny things just because someone wanted to shove them down my throat!