|
|
|
|
|
by kelseyfrancis
3293 days ago
|
|
The part of this argument I don't really understand is that it seems like the cost of bad programmers is higher, not lower, with a "simple" language where it's _normal_ to have type-unsafe code and mutable state everywhere. |
|
Or show me how you would subvert Go's type system and tell me which language you're comparing it to that wouldn't allow similar type system subversion. And no moving goal posts, please. "Type safe" has a certain meaning.
The value of immutability is so overblown, as shown by literally every mainstream language being mutable by default.
Not to mention the perf cost of immutability.
For just one example see https://ayende.com/blog/164739/immutable-collections-perform... (immutable version of dictionary is 30x slower, immutable list is 16-32x slower).
I'm not cherry-picking. This is just the first search result. If you understand how immutability works from first principles, it just does much more work.
Ultimately I wouldn't describe Go as "minimizing bad programmers" but "minimizing a damage that well intentioned but ultimately mis-guided good programers can do to the codebase".
For example I believe that your enthusiasm for immutability is well intentioned but I would rather not take 30x perf hit for theoretically safer code.
Bad programmer will write a bug that can be fixed.
A mis-guided good programmer will write a compile-time parser that only he can understand (possibly only for a week after writing it), will baloon compile times, produces incomprehensible error messages and you won't be able to convince him that a standard recursive-descent parser is 10x simpler to write and read.
Go prevents mis-guided smart programmers from inflicting too much pain on everyone else.