Picotron[1] has this feature, I don’t remember the exact format but essentially you have a special comment syntax that includes a base64 encoded lz4 compressed string that stores the image, every text widget on the system supports it and renders it as an image, and it turns back to text when your cursor is on that line.
You can almost do it with `condition and value`, but you get `False` instead of `None` (and adding any more code makes this worse than `value if condition else None`. Interestingly lua like `<condition> and <true-expression> or <false-expression>` ternaries actually work in python, with the added footgun that <true-expression> must be truthy and people will despise you).
Rust for example has a solution for this in std, there's a `bool::and_some` method (and `bool::then` that takes a closure to avoid eagerly evaluating the value), but `if { ... }` isn't an expression like `if { ... } else { ... }` is, probably to avoid coupling the language to `Option`.
I meant more than it already is, I referenced this: https://stackoverflow.com/a/43339003. I do think it would be neat but it's niche enough to not be worth the non-obvious behavior of boxing with `Option`, e.g. you might forget an `else { ... }` and get complex type errors.
50/50 but yeah it's like Israel attempts to bomb Iranian nuclear facilities. Problem is they are buried so deep now that it's pointless and at best a slight delay. Only the US (or maybe China or Russia) to get at facilities that deep and I don't see that happening unless Trump wins. Biden/Harris will never sign off on that.
Terrible article imo. You can’t approach UI from the perspective of a developer using the UI you just wrote, you need to think about it from a user’s perspective. That sometimes means having redundancy in the name of familiarity and legibility.
I agree YouTube example is pretty bad, but the gmail one is a really good use of a toast! What do you mean “you can see the email is removed from the list”?? Have you ever used email before? You usually have more than 3 messages, and seeing which one was removed, let alone that one was removed at all is not always obvious. And “undo” is incredibly important since you don’t have direct access to the removed item (and sometimes it’s a time sensitive action like undoing sending an email). The last one is not very helpful but not harmful either.
Also even if all the the examples were truly horrible and despicable uses of toasts, 3 bad examples are not enough to say a commonly used UI pattern is outright “bad”.
Here is the [source code](https://github.com/OatsCG/Openmusic).
The app has a lot of cool features like themes (apple music, spotify, wii, windows 7), an equalizer and car control with your hand over the depth sensor.
It uses [OMDB](https://github.com/OatsCG/OMDB) which is an enormous database of songs scarped from youtube music ([source](https://old.reddit.com/r/datasets/comments/1b9ihqa/i_made_om...)).
I'm not the creator of either of these projects, I just think they are very underrated and should get more attention, and I really like the idea of a [common protocol](https://github.com/OatsCG/Openmusic-Server-Specs) for music streaming. So try out the app if you want, or create compatible clients/servers and have fun with it! (it doesn't look like the developer has setup any ways to donate...)
[^1]: https://www.lexaloffle.com/picotron.php