π Hi, the current time is about a half past nine in the morning π.
π Hi, the current time is about a quarter past nine in the morning π.
π Hi, the current time is about a quarter past nine in the morning π.
π Hi, the current time is about a quarter past nine in the morning π.
π Hi, the current time is about nine oβ clock in the morning π.
π Hi, the current time is about nine oβ clock in the morning π.
π Hi, the current time is about nine oβ clock in the morning π.
π Hi, the current time is about a quarter till nine in the morning π.
π Hi, the current time is about a quarter till nine in the morning π.
π Hi, the current time is about a quarter till nine in the morning π.
π Hi, the current time is about a half past eight in the morning π.
π Hi, the current time is about a half past eight in the morning π.
π Hi, the current time is about a half past eight in the morning π.
π Hi, the current time is about a quarter past eight in the morning π.
π Hi, the current time is about eight oβ clock in the morning π.
π Hi, the current time is about eight oβ clock in the morning π.
π Hi, the current time is about a quarter till eight in the morning π.
π Hi, the current time is about a quarter till eight in the morning π.
Thumbnail novo para a minha pÑgina sobre compreensão de listas⦠#Python
https://abav.lugaralgum.com/material-aulas/Processing-Python-py5/comprehension.html
(preciso dar uma melhoradinha na pΓ‘gina, por umas imagens, arrumar links quebrados)
Thumbnail novo para a minha pÑgina sobre compreensão de listas⦠#Python
https://abav.lugaralgum.com/material-aulas/Processing-Python-py5/comprehension.html
π Hi, the current time is about a half past seven in the morning π.
π Hi, the current time is about a half past seven in the morning π.
π Hi, the current time is about a half past seven in the morning π.
π Hi, the current time is about a quarter past seven in the morning π.
π Hi, the current time is about a quarter past seven in the morning π.
π Hi, the current time is about seven oβ clock in the morning π.
π Hi, the current time is about seven oβ clock in the morning π.
π Hi, the current time is about seven oβ clock in the morning π.
π§ Hi, the current time is about a quarter till seven in the morning π.
π§ Hi, the current time is about a half past six in the morning π.
π§ Hi, the current time is about a half past six in the morning π.
π§ Hi, the current time is about a half past six in the morning π.
π Hi, the current time is about a quarter past six in the morning π.
π Hi, the current time is about a quarter past six in the morning π.
π Hi, the current time is about six oβ clock in the morning π.
π Hi, the current time is about six oβ clock in the morning π.
π Hi, the current time is about six oβ clock in the morning π.
π Hi, the current time is about a quarter till six in the morning π.
π Hi, the current time is about a quarter till six in the morning π.
π Hi, the current time is about a quarter till six in the morning π.
π Hi, the current time is about a half past five in the small hours π΄.
π Hi, the current time is about a half past five in the small hours π΄.
π Hi, the current time is about a half past five in the small hours π΄.
π Hi, the current time is about a quarter past five in the small hours π΄.
π Hi, the current time is about a quarter past five in the small hours π΄.
π Hi, the current time is about a quarter past five in the small hours π΄.
π Hi, the current time is about five oβ clock in the small hours π΄.
π Hi, the current time is about five oβ clock in the small hours π΄.
π Hi, the current time is about a quarter till five in the small hours π΄.
π Hi, the current time is about a quarter till five in the small hours π΄.
π Hi, the current time is about a quarter till five in the small hours π΄.
π Hi, the current time is about a half past four in the small hours π΄.
π Hi, the current time is about a half past four in the small hours π΄.
π Hi, the current time is about a half past four in the small hours π΄.
π Hi, the current time is about a quarter past four in the small hours π΄.
π Hi, the current time is about a quarter past four in the small hours π΄.
π Hi, the current time is about a quarter past four in the small hours π΄.
π Hi, the current time is about four oβ clock in the small hours π΄.
π Hi, the current time is about four oβ clock in the small hours π΄.
π Hi, the current time is about a quarter till four in the small hours π΄.
Option
and error handling. (Or the more complex Result
, but itβs easier to explain with Option
.)
@movq@www.uninformativ.de Yeah pretry much π€£
π Hi, the current time is about a quarter till four in the small hours π΄.
π Hi, the current time is about a half past three in the small hours π΄.
π Hi, the current time is about a half past three in the small hours π΄.
π Hi, the current time is about a half past three in the small hours π΄.
π Hi, the current time is about a quarter past three in the small hours π΄.
Option
and error handling. (Or the more complex Result
, but itβs easier to explain with Option
.)
@prologic@twtxt.net Iβd say: Yes, because in Go itβs easier to ignore errors.
Weβre talking about this pattern, right?
f, err := os.Open("filename.ext")
if err != nil {
log.Fatal(err)
}
Nothing stops you from leaving out the if
, right? π€
π Hi, the current time is about a quarter past three in the small hours π΄.
π Hi, the current time is about a quarter past three in the small hours π΄.
π Hi, the current time is about three oβ clock in the small hours π΄.
@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 π€
π Hi, the current time is about three oβ clock in the small hours π΄.
π Hi, the current time is about three oβ clock in the small hours π΄.
π Hi, the current time is about a quarter till three in the small hours π΄.
@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 π
π Hi, the current time is about a quarter till three in the small hours π΄.
π Hi, the current time is about a half past two in the small hours π΄.
(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? π€)
π Hi, the current time is about a half past two in the small hours π΄.
π Hi, the current time is about a quarter past two in the small hours π΄.
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.
π Hi, the current time is about a quarter past two in the small hours π΄.
π Hi, the current time is about two oβ clock in the small hours π΄.
π Hi, the current time is about two oβ clock in the small hours π΄.
π Hi, the current time is about two oβ clock in the small hours π΄.
π Hi, the current time is about a quarter till two in the small hours π΄.
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.)
π Hi, the current time is about a quarter till two in the small hours π΄.
π Hi, the current time is about a half past one in the small hours π΄.
π Hi, the current time is about a half past one in the small hours π΄.
π Hi, the current time is about a quarter past one in the small hours π΄.
π Hi, the current time is about a quarter past one in the small hours π΄.
π Hi, the current time is about one oβ clock in the small hours π΄.
π Hi, the current time is about one oβ clock in the small hours π΄.
π§ Hi, the current time is about a quarter till midnight π.
π§ Hi, the current time is about a quarter till midnight π.
π§ Hi, the current time is about a quarter till midnight π.
π§ Hi, the current time is about a half past midnight π.