r/programming • • Dec 03 '19

Immutable by default

https://functional.christmas/2019/3
55 Upvotes

50 comments sorted by

View all comments

Show parent comments

0

u/Minimum_Fuel Dec 04 '19

Programming isn’t math at all. It is programming. Pretending programming is math by muddying the waters of word definitions is exactly why we’re talking right now.

The point is that you cannot declare something to be true until you can actually prove it. This article about immutable data structures doesn’t prove anything and any grade school computer science student capable of rational thought could raise a number of questions and points which obliterate all of the articles claims.

For every anecdote you can produce about why immutable data structures are good, I can produce an anecdote about why that solution is bad and you should favour something else.

That differs greatly from goto. Unfortunately (for this discussion), most of this code showing how monumentally bad goto can be has either since been rewritten or is proprietary and has never been released. Having personally worked on massive cobol programs with goto all over the place, it’s bad. Infinite loops. Jumps top to bottom to top to bottom to middle to middle to top. This doesn’t actually sound that bad when you consider typical notions for what constitutes good programming practice today. Except that we’re not talking about today. We are talking about 400,000 line files that goto all over the file. It doesn’t take measurements to decide how horrifying it is to work on these.

Goto is not a great counter argument anyway. Linux makes pretty heavy use of goto.

It really just is a bad example. The original context of why “goto is bad” will be completely inaccessible to today’s programmers unless they are working on legacy code bases.