• 0 Posts
  • 2 Comments
Joined 2 years ago
cake
Cake day: June 12th, 2023

help-circle
  • There’s a lot here that I could comment on, but I’m particularly fascinated that you make a big deal about const by default.

    First of all, it’s not particularly good evidence that rust is functional, you could just as easily have a const-by-default java or c. Rust still has mutable data structures which is decidedly non-functional. I do actually think that rust is more inspired by fp than a lot of other languages so it’s not even that you’re completely wrong here, it’s just an odd example.

    Secondly, do you actually think that const variables is a bad default? Personally I find that it makes it code easier to read when the author is explicit that a variable is going to be mutated down the line because it makes the intention clearer. It also makes it easier for the compiler to make certain optimizations which is significant in a low-level language.