It's a tragedy that ; and : are often on the same key on the keyboard, are often both legal syntax, and are so visually similar. I wonder how much programmer time has been wasted.
> Converting to hexl format discards undo info; ok? (y or n)
I really admire how seriously Emacs looks after your undo state. Not enough software will warn you if you're about to discard undo information.
What's the best keyword for function definitions?
My current hypothesis is that you want it to be short, but still pronounceable, so `fun` is the sweet spot.
I've really come to appreciate OCaml's notion of generics. It doesn't have subtyping, so e.g. you have an `int list` or an arbitrary `'a list`, but nothing inbetween.
As soon as you add constraints like Java's `List<? as Foo>` it become incredibly hard to produce good errors.
Switching between Rust and TypeScript, I really miss the Result type in TypeScript. I can kludge something with nullable types or exceptions, but it's not as nice for the caller.
Today I learnt about crossterm, a Rust crate for interacting with terminals in a cross-platform way: https://docs.rs/crossterm/latest/crossterm/
It handles things like is_tty() and terminal::size(), which are hard to support correctly in both Linux and Windows. I might port difftastic.
I have mixed feelings about the equality trait in Rust.
I have types where sometimes I want to compare by structure, and sometimes compare by reference.
I can only implement Eq for one, so which do I pick?
I feel like in-code docs are an underexplored design space.
Do you use comments or string literals? Before the function (e.g. JSDoc) or inside it (e.g. Python)?
Which is best? Which is the easiest to write, has the easiest tooling, or the most readable (code/HTML) artifacts?