Daily Shaarli
July 17, 2026
But after programming in Rust for 10 years, I think that your coding style has the biggest impact on how your Rust code will look and feel.
People often say Rust’s syntax is ugly, but I’d argue the syntax is the least interesting thing about Rust. The semantics (the bits and pieces the language provides to express your ideas and how those bits combine to build interesting things) are much more important.
Parsing a .env can be clunky in basic algorithm, but elegant in Rust.
Tips:
read_to_string()instead of using a path, opening a file, creating a vector, adding the content to the vector to make a string- Use type inference:
let mut cfg = HashMap::new() - Lean into the typesystem:
.lines()to split strings safely and iterates over the linessplit_once()to get each key-value pair for each lines
- leverage error handling: use an enum to list all possible errors with important values and
thiserrorcan handle the error message
fn parse_config_file(path: &str) -> Result<HashMap<String, String>, ParseError> {
let content = read_to_string(path)?;
let mut config = HashMap::new();
for line in content.lines() {
match KeyValue::try_from(line) {
Ok(kv) => { config.insert(kv.key, kv.value); },
Err(ParseError::InvalidLine(_)) => continue, // Skip invalid lines
Err(e) => return Err(e), // Fail on any other error
}
}
Ok(config)
}
and why this code structure offers more extensibility!
Rust’s beauty is in its semantics and the core mechanics it provides: ownership, borrowing, pattern matching, traits, and so on. If you merely look at its (admittedly foreign) syntax, you overlook the real elegance of the language.
If there is anything that makes Rust “ugly”, it isn’t its syntax but the fact that it doesn’t hide the complexity underneath. Rust values explicitness and you have to deal with the harsh reality that computing is messy. Turns out our assumptions about a program’s execution are often wrong and our mental models are flawed.
Fortunately, we can encapsulate a lot of the complexity behind ergonomic abstractions; it just takes some effort! So don’t worry: once you start to confront your bad habits and look around for better abstractions, Rust stops being ugly.
Démarrer Firefox dans Firefox.
Pour les développeurs, il est donc possible de fabriquer une miniature de page ou prévisualiser du HTML directement chez le visiteur:
import { Gecko } from 'gecko.js';
const gecko = new Gecko({ canvas: document.querySelector('canvas')! });
await gecko.init();
await gecko.load('data:text/html,# hello from Gecko
');
(par https://simonwillison.net/2026/Jul/16/firefox-in-webassembly/)
Du coup, vous vous demandez peut-être pourquoi ces deux sites collectionnent les TLD les plus improbables du registre. Hé bien c'est pas du folklore, c'est une réponse directe à l'ARCOM. À chaque fois que les FAI français appliquent une salve de blocages DNS , les opérateurs enregistrent un nouveau domaine et redirigent leur public via des pages d'atterrissage et des canaux Telegram. La Belgique hérite donc d'un stock de domaines cramés par la France, et les bloque consciencieusement, un par un, avec plusieurs coups de retard.
Les TLD changent en quelques minutes. C'est fort.
Source: https://torrentfreak.com/pirate-sites-domain-hopping-habit-undermines-belgiums-new-blocking-order/
Les blocages comportent des erreurs
That’s also the reason NaN !== NaN. If NaN behaved like a number and had a value equal to itself, well, you could accidentally do math with it: NaN / NaN would result in 1, and that would mean that a calculation containing a NaN result could ultimately result in an incorrect number rather than an easily-spotted “hey, something went wrong in here” NaN flag.
How to check the value can be used for a calculation?
typeof theValue === "number": to me too, it feels clunky th compare strings in order to use a numberNumber.isNaN()does exactly what it means: it checks for theNaN- but the global function
isNaN()returns true "“if I tried to make you into a number, would that work, or would you end up being NaN?"
L’application stricte de cette conformité par « géofencing » valide d’ailleurs le constat de Mozilla : le respect du choix de l’utilisateur est actuellement conditionné par la pression réglementaire locale plutôt que par la philosophie de conception.
Simple white paint sprayed on the side of the rails can bring down temperatures 11 °C
Évidemment que Netflix, Amazon, Google et Meta concentre 49% du trafic en nombnre d'octets puisque la vidéo pèse plus lourd.
Il faut donc être conscient de cette limite en nombre d'octets: le transfert d'une vidéo sera toujours plus important qu'un PDF.