this post was submitted on 03 Aug 2025
64 points (95.7% liked)

Linux

8878 readers
426 users here now

A community for everything relating to the GNU/Linux operating system (except the memes!)

Also, check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] fruitcantfly@programming.dev 4 points 6 days ago

IMO, variables being const/immutable by default is just good practice codified in the language and says nothing about Rust being "functional-first":

Most variables are only written once, and then read one or more times, especially so when you remove the need for manually updated loop counters. Because of that, it results in less noisy/more readable code when you only need to mark the subset of variables are going to be updated later, rather than the inverse. Moreover, when variables are immutable by default, you cannot forget to mark them appropriately, unlike when they are mutable by default