←back to thread

498 points azhenley | 2 comments | | HN request time: 0.632s | source
Show context
munchler ◴[] No.45767832[source]
> Making almost every variable const at initialization is good practice. I wish it was the default, and mutable was a keyword.

It's funny how functional programming is slowly becoming the best practice for modern code (pure functions, no side-effects), yet functional programming languages are still considered fringe tech for some reason.

If you want a language where const is the default and mutable is a keyword, try F# for starters. I switched and never looked back.

replies(19): >>45767880 #>>45767882 #>>45767891 #>>45767892 #>>45767898 #>>45767926 #>>45767975 #>>45767989 #>>45768118 #>>45768188 #>>45768230 #>>45769840 #>>45769875 #>>45770104 #>>45770306 #>>45771134 #>>45771926 #>>45772136 #>>45775848 #
1. Freedom2 ◴[] No.45767882[source]
Decades of blog posts, articles and books about "best practices" led to a suspicion of anything that wasn't bog standard OOP. This site in particular has also contributed to that, especially in the early 2000s, where you can easily find comments disparaging FP.
replies(1): >>45769413 #
2. jeffreygoesto ◴[] No.45769413[source]
I think there's a deeper mechanism in these discussions. They all tend to go "If you do <insert_arbitrary_method_here> fully correct[0], it solves all of your problems."

But [0] is never possible.