@movq@www.uninformativ.de I’m feeling SO dumb right now 😅 I used to think !!
was a sudo
argument and never used it out of that context! Thanks for the $(!!)
tip 🤘
@kat@yarn.girlonthemoon.xyz Always do 🤣
Option
and error handling. (Or the more complex Result
, but it’s easier to explain with Option
.)
@movq@www.uninformativ.de Is this much different to Go’s error handling as values though really? 🧐🤣😈
@movq@www.uninformativ.de Agree! Good list 👌
(Of course, if we’re talking about a project you’re doing for a customer and the customer keeps asking for new stuff, then you’re never done, and you have to think ahead and expect changes. Is that what they mean? 🤔)
Saw this on Mastodon:
https://racingbunny.com/@mookie/114718466149264471
18 rules of Software Engineering
- You will regret complexity when on-call
- Stop falling in love with your own code
- Everything is a trade-off. There’s no “best” 3. Every line of code you write is a liability 4. Document your decisions and designs
- Everyone hates code they didn’t write
- Don’t use unnecessary dependencies
- Coding standards prevent arguments
- Write meaningful commit messages
- Don’t ever stop learning new things
- Code reviews spread knowledge
- Always build for maintainability
- Ask for help when you’re stuck
- Fix root causes, not symptoms
- Software is never completed
- Estimates are not promises
- Ship early, iterate often
- Keep. It. Simple.
Solid list, even though 14 is up for debate in my opinion: Software can be completed. You have a use case / problem, you solve that problem, done. Your software is completed now. There might still be bugs and they should be fixed – but this doesn’t “add” to the program. Don’t use “software is never done” as an excuse to keep adding and adding stuff to your code.
Okay, here’s a thing I like about Rust: Returning things as Option
and error handling. (Or the more complex Result
, but it’s easier to explain with Option
.)
fn mydiv(num: f64, denom: f64) -> Option<f64> {
// (Let’s ignore precision issues for a second.)
if denom == 0.0 {
return None;
} else {
return Some(num / denom);
}
}
fn main() {
// Explicit, verbose version:
let num: f64 = 123.0;
let denom: f64 = 456.0;
let wrapped_res = mydiv(num, denom);
if wrapped_res.is_some() {
println!("Unwrapped result: {}", wrapped_res.unwrap());
}
// Shorter version using "if let":
if let Some(res) = mydiv(123.0, 456.0) {
println!("Here’s a result: {}", res);
}
if let Some(res) = mydiv(123.0, 0.0) {
println!("Huh, we divided by zero? This never happens. {}", res);
}
}
You can’t divide by zero, so the function returns an “error” in that case. (Option
isn’t really used for errors, IIUC, but the basic idea is the same for Result
.)
Option
is an enum. It can have the value Some
or None
. In the case of Some
, you can attach additional data to the enum. In this case, we are attaching a floating point value.
The caller then has to decide: Is the value None
or Some
? Did the function succeed or not? If it is Some
, the caller can do .unwrap()
on this enum to get the inner value (the floating point value). If you do .unwrap()
on a None
value, the program will panic and die.
The if let
version using destructuring is much shorter and, once you got used to it, actually quite nice.
Now the trick is that you must somehow handle these two cases. You must either call something like .unwrap()
or do destructuring or something, otherwise you can’t access the attached value at all. As I understand it, it is impossible to just completely ignore error cases. And the compiler enforces it.
(In case of Result
, the compiler would warn you if you ignore the return value entirely. So something like doing write()
and then ignoring the return value would be caught as well.)
@movq@www.uninformativ.de Ewww 😈
We really are bouncing back and forth between flat UIs and beveled UIs. I mean, this is what old X11 programs looked like:
https://www.uninformativ.de/desktop/2025%2D06%2D21%2D%2Dkatriawm%2Dold%2Dxorg%2Dapps.png
Good luck figuring out which of these UI elements are click-able – unless you examine every pixel on the screen.
@prologic@twtxt.net have fun!
@prologic@twtxt.net Enjoy your road trip! Have fun!! 🤘
Gone on a road trip. Be back in a week 👋
Now I could. A few minutes ago I posted one, and it went to the void. I can’t delete, though. I get a lovely 403.
Can I create a post?
@bender@twtxt.net Ahh I see hmmm I don’t know this either 🤣
@kat@yarn.girlonthemoon.xyz I might give it a shot. 😃
Skimming through the manual: I had no idea that keeping the “up” cursor pressed actually slows you down at some point. 🤦
@aelaraji@aelaraji.com I use Alt+.
all the time, it’s great. 👌
FWIW, another thing I often use is !!
to recall the entire previous command line:
$ find -iname '*foo*'
./This is a foo file.txt
$ cat "$(!!)"
cat "$(find -iname '*foo*')"
This is just a test.
Yep!
Or:
$ ls -al subdir
ls: cannot open directory 'subdir': Permission denied
$ sudo !!
sudo ls -al subdir
total 0
drwx------ 2 root root 60 Jun 20 19:39 .
drwx------ 7 jess jess 360 Jun 20 19:39 ..
-rw-r--r-- 1 root root 0 Jun 20 19:39 nothing-to-see
@thecanine@twtxt.net With the teeth this looks like a vampire dog. :-D And I don’t get the reference either.
@aelaraji@aelaraji.com Oh, that’s great! I haven’t heard about any of them before either. There’s also a caveat though, that I ran right into the very first time I tried this in zsh:
$ ls > /dev/null
$ echo $_
--color=tty
Yeah, exactly what you think:
$ which ls
ls: aliased to ls --color=tty
Alt+.
is going to be my favorite one! In the above, it would also give me /dev/null
, which might be probably more what I would expect.
@prologic@twtxt.net no, good man. Follow the link, follow eet! :-)
@movq@www.uninformativ.de omg yeah! this one looks cute too (i’m weak to anything tux related!) but the commercial release has so much unpolished charm i love it! btw it’s on [internet archive(https://archive.org/details/TuxRacerCD) if you wanna download & play it :]
@kat@yarn.girlonthemoon.xyz I like the animations in your version much better than the ones from ExtremeTuxRacer. 😊 And there’s no little dance at the end of a race!
@aelaraji@aelaraji.com You mean Control R?
katseye does telenovela: the MV https://www.youtube.com/watch?v=CjnB56tSCQI
@bender@twtxt.net I SANG ALONG IN MY HEAD LMAOOO
I also just noticed that the performance issue doesn’t affect all games. 🤔 Sigh, I’ll just downgrade for the time being. Not in the mood to fiddle with this.
@kat@yarn.girlonthemoon.xyz I guess that qualifies as an “Arch moment”, albeit the first one I encountered. I’m running this since 2008 and it’s usually very smooth sailing. 😅
@lyse@lyse.isobeef.org Yeah, YMMV. Some games work(ed) great in Wine, others not at all. I just use it because it’s easier than firing up my WinXP box. (I don’t use Wine for regular applications, just games.)
@bender@twtxt.net Now I AM curious! What rabbit-hole? what am I missing here? 😆
Just discovered how easy it is to recall my last arg in shell and my brain went 🤯 How come I’ve never learned about this before!? I wonder how many other QOL shortcuts I’m missing on 🥲
@kat@yarn.girlonthemoon.xyz 🎵 Grafana ana bo bana fifo bo bana gra fana!🎶 Don’t mind me, I am nuts.
@kat@yarn.girlonthemoon.xyz I recommend you to remain curious without crossing the threshold. Unless, of course, you truly want to follow a never-ending rabbit hole. 😂
GRAFANA IS DRIVING ME NUTSSSSSSS
@aelaraji@aelaraji.com i’ve been curious about searxng!!!
@lyse@lyse.isobeef.org as long as i get to see silly little tux sliding around in a silly game older than me it’s ok even if i committed windows/wine crimes to see it <33
@movq@www.uninformativ.de arch moment
@movq@www.uninformativ.de i’m grateful that this works at least!
@kat@yarn.girlonthemoon.xyz UPDATE: getting it to run natively through a VM and other means all failed! so i did the cursed thing and tried the windows installer in wine…..
@thecanine@twtxt.net i do not get the reference but this is very cute!
Back to the future
from start to the end.
@aelaraji@aelaraji.com fuck yeah!
@movq@www.uninformativ.de missing libraries :( i expected it though
Felt the need to make this stupid reference - nobody will get, most likely. Feel free to guess (the file name and todays date, are both a hint), any other notes and opinions appreciated too, idk if I ever drew a standing one, from the front, before.
Achievement Unlocked: I have finally gotten to sit my ass down and watch Back to the future
from start to the end.
update on tux racer: ofc it doesn’t run on modern linux LMFAOOOOOOO i’m installing red hat in a VM right now
@doesnm.p.psf.lt@doesnm.p.psf.lt so sorry for your suffering, and loss. :-P
@kat@yarn.girlonthemoon.xyz uh, i use yandex mail which uses HTML by default
@kat@yarn.girlonthemoon.xyz join the SearxNG cult! the grass is way greener over here 😁
@movq@www.uninformativ.de neither do I 😆 and I’m going full Albert Camus mode. Embracing the Absurdism of life just to cope, it’s the only choice I have left.
i ordered some fun colorful new minidiscs so i can finally get back to recording my mixes :D looking forward to it
@aelaraji@aelaraji.com i’m so sick of AI summaries they piss me tf off