(Ab)using Rust traits to write silly things

Recently I’ve found some cursed Rust code and decided to make a little joke/question on twitter. In the tweet I’ve presented some unusual code and asked “how could it compile?”. The solution was found quite fast by @Veykril (kudos to them!) and in this post I want to explain it in detail.

Read more  ↩︎

Why we can’t have nice things: min/max

In this post I’ll talk about Rust’s BTreeSet and tell a sad story about its methods.

Read more  ↩︎

Comments are weak

I like writing comments. But at the same time comments kind of suck. In this post, I want to outline some ways we could improve this.

Read more  ↩︎

if-else chains considered harmful

As always, I have some strong opinions on things I probably shouldn’t have opinions on. This time I want to tell you why I think if-else chains are syntactically harmful.

Read more  ↩︎

What does `&mut &[T]` mean?

References can be quite confusing, especially with different mutabilities. Indeed, only a third of people in my poll said that they understand what &mut &[T] means!

Read more  ↩︎

Everybody needs a place (and time) to pause

As you may know, I have a (russian) telegram channel. One day I had a random thought about something I could make there. Now it became a tradition…

Read more  ↩︎

You wouldn't use `filter_map`, right?

There is a function Iterator::filter_map. I want to argue that it’s useless and Rust provides more powerful tools to replace it.

Read more  ↩︎

Why null sucks, even if it's checked

We all know that null is a “billion-dollar mistake”, that it creates a lot of easy ways to make terrible mistakes. But it’s only so bad when it’s not checked by anyone and the compiler doesn’t force you to check it, right? Well, the title might be a spoiler, but let’s find out…

Read more  ↩︎