On Sun, Jun 05, 2022 at 07:03:32AM +1000, Chris Angelico wrote:

> How is redundancy fundamentally good,

I don't know, you will have to ask somebody who is arguing that 
"redundancy is fundamentally good", which is not me. Redundancy can be 
either good or bad.

https://www.informationweek.com/government/redundancy-in-programming-languages


I didn't think that would be a contraversial position to take, 
programming and IT frequently makes use of redundancy, e.g.

- multiple routes to a destination
- warm and hot spare servers
- RAID, backups
- documentation versus "read the source"
- unit tests, regression tests, etc
- checksums and error correcting codes
- eyword parameters when positional would do
- making allowance for "the bus factor" in projects
  ("why do we need two people who understands this?")

Python uses redundant colons after statements that introduce a block; 
other languages use redundant variable declarations and semicolons.

Outside of IT, we even have a proverb about it: don't put all your eggs 
in one basket. Redundancy is used to make systems more resilient against 
failure:

- Spare tyres, spare keys, etc.
- Subject-Verb Agreement Rules in language.
- Double-entry book keeping.
- Using two or more locks on doors.
- Belts and braces, seatbelts and airbags, etc.

I'm not saying that redundancy is always good, but your argument that 
"all" (your word) it does is to "introduce the possibility of error" (as 
if there are no other sources of error in programming!) doesn't stand up 
to even the most cursory consideration.

In this specific example, `spam, eggs, cheese = islice(values, 3)`, I 
think that the cost of the redundancy is minimal and the benefit 
non-zero. Which one "wins" is a matter of taste and the programmer's own 
personal value judgement of risk versus opportunity.

If you don't like it, fine, but I do, and if I were BDFL of Python, I 
wouldn't add syntax to the language just to remove this redundancy.

-- 
Steve
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/AUYTGNSKMHO7RB7ZIJRXJIAAGMEZPRNP/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to