4 ms·
So instead of refactoring, they hacked around it, and now the law is that much harder to read. Law making and programming are quite similar in some ways, and s
by BurningFrog 4y ago
So instead of refactoring, they hacked around it, and now the law is that much harder to read.
Law making and programming are quite similar in some ways, and share some pathologies.
- tagami 4y ago"Code of Law"
- quantified 4y agoShip it!
- bko 4y agoI don't understand. I think the term "fish" was defined in the text, so fish is akin to a variable name with its true identity defined in a single place. So they wanted to add something to the term "fish" so they changed that one place. Seems more sensible and less error prone than using "fish, mollusks..." everywhere and doing a ctrl+f and adding a ", bees" everywhere. Doing the ctrl+f approach would be the hack IMO. I guess they could have changed the variable name as well but legal documents probably aren't written in IntelliJ or some other tool where you can confidently believe that you changed every occurrence. Plus, you don't have compiler warnings! Unless I'm misunderstanding something or your comment...
- tptacek 4y agoI suppose the "clean code" solution implied here is to change the term "fish" to something like "species of concern".
- xsmasher 4y agoYes - redefining "fish" is similar to "#DEFINE ONE = 0.99" It's a landmine for future developers who want to parachute in, understand what is happening, make a fix, and jetpack out again.
- Diris 4y agoLaw making is kinda logic programming[0]. Someone even wrote the constitution of Japan in prolog ! [1] [0] https://en.wikipedia.org/wiki/Logic_programming https://en.wikipedia.org/wiki/Logic_programming [1] https://github.com/bitlaw-jp/the-constitution-of-japan https://github.com/bitlaw-jp/the-constitution-of-japan