2,119 karma · joined Mar 10, 2021 (5y ago) · 953 submissions
comment 3h ago · link · parent
Labeled break/continue is in some way better than unlabeled break/continue because they can carry more meaning and tell you which loop you are operating on.
You can of course write some ugly soup with this, but so can you right now with some extra variables.
And even then this does not have the full "power"s of goto. You cannot even create irreducible control flows with it.
Finally, labeled break/continue has been supported in many languages for a long time (Java supported it in its 1.0 release!) and I have never seen it being considered harmful there.
comment 4h ago · link · parent
comment 16h ago · link · parent
> Well thought out REST endpoints organically grown as usage is required or observed trumps hyper flexible endpoints created because "Who knows what the user might need"
The issue with having all those endpoints is that you start waiting for one endpoint response before calling another, and that adds a lot of latency for end users.
comment 1d ago · link · parent
The C standard doesn't even guarantee that. It only guarantees the conversion from 0 to a null pointer. Any other integer-to-pointer conversion is implementation defined.
What implementations _want_ to define is a different question though.
comment 2d ago · link · parent
Saying this comparison has its limits is an understatement. Energy released by different atomic bombs can vary across different order of magnitudes.
comment 3d ago · link · parent
Sidenote: note that in some countries someone with a degree in Computer Science cannot legally call themselves an _Engineer_, even though they have roughly the same knowledge and abilities as someone who got a Computer Engineering degree.
comment 1w ago · link · parent
> puts control in users' hands rather
These two statements are very much at odds with each other.
Non-technical users generally don't know which folder the app needs. It will be confusing for them. If anything this feature works best for *technical* users, that know, or have the ability to look up, which folders the application actually needs.
comment 1w ago · link · parent
The article is focusing on that fifth of students that didn't perform well, but if that can be trusted then it means 80% of the students did end up performing better than the national median, and 80% seems pretty high to me. Do normal private schools guarantee even higher chances of my kids performing better?
comment 1w ago · link · parent
Merge sort is algorithmically faster only when either quicksort is implemented naively (in the O(n²) way, which I would obviously ignore) or when data is already almost sorted (when using something more similar to timsort). In the latter case it will be faster even when the data size becomes pretty big, because merge sort will actually reduce memory movements in those cases.
comment 2w ago · link · parent
Goose's stacks have quite some complexity themselves. They preallocate a ton of memory. The compiler has to magically match your code to each stack. You are not allowed to have nested growing types (e.g. creating an adjacency list is not so easy). And after all for some usecases you still end up using an allocator (Goose's linked list example ends up building a pool allocator for the linked list nodes!)
comment 2w ago · link · parent
For another example: Adwaita's boxed lists [2] are pretty complex. Blender generally uses a simple label followed by some kind of button, in comparison Adwaita has a wrapping box, separator, special handling for first/last items, subtitles, animated expansion, and a ton of customizability.
I'm not saying these are good examples of UI, but they are surely _more complex_ than Blender. Blender has more menus and controls compared to a normal Material/Adwaita UI for sure, but they are pretty much the same, so it has quantity but not complexity from my point of view.
[1]: https://m2.material.io/components/cards#anatomy
[2]: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.4/boxed-lists.htmlcomment 2w ago · link · parent
Also consider that if your UI framework supports z-level, opacity and other features like that then determining what has changed for rendering is much more complex than just determining what UI elements have changed.
comment 2w ago · link · parent
That said, I indeed am not fond of GPUI and egui, but for different reasons.
In GPUI having to manually mark the state as changed is IMO a footgun and any decent UI framework should not require something like that.
In egui I found the "immediate mutation" pattern (e.g. the classic `if button.pressed() { mutate }`) to produce glitches in the UI, because it will cause half the UI to draw the old state and half the new state. You almost always want to anticipate interactions, or to delay mutations. But performance is not a problem IMO unless you're writing a complex vector graphics viewport (in which case retained UI won't help you either)