3 ms·
You're wrong, your initial corrections were correct. Your boss will now have to spend 4x as much money to modify every class that ever relied on Ovals and Recta
by noduerme 3y ago
You're wrong, your initial corrections were correct. Your boss will now have to spend 4x as much money to modify every class that ever relied on Ovals and Rectangles if/when he realizes there's another way he might want to modify them.
- vorticalbox 3y agowhat if you want to process different things for each type of shape? then you will have to refactor it all out again. there is a talk by James Power [0] during which it he speaks about whether the repetition is intention or coincidental. [0] https://www.youtube.com/watch?v=-z2eqLwVmzw https://www.youtube.com/watch?v=-z2eqLwVmzw
- cogman10 3y agoYou didn't catch the end where they explicitly say > Secondly, nothing is free. My code traded the ability to change requirements for reduced duplication, and it was not a good trade. For example, we later needed many special cases and behaviors for different handles on different shapes. My abstraction would have to become several times more convoluted to afford that, whereas with the original “messy” version such changes stayed easy as cake. Clean code is easy to understand and to change. Ideally, any given file or method only deals with one concept. Messy code usually results from someone merging concepts to avoid duplication. After that happens, differences in the concepts cause the code to become much harder to reason about. I've seen this particular problem happen a million times. The worst code I ever stepped into was completely DRY. When, where, and why something happened wasn't something the original authors could answer. That's because everytime they found code duplication, they'd abstract. And everytime that didn't work, that ended up adding little "if (this instanceof Foo) special case;" to get over the most recent bug.
- seattle_spring 3y agoJust curious, what does your software engineering career look like? Length, education, etc.
- noduerme 3y agoI've written code for profit for about 25 years, although I started learning to code in Perl and BASIC when I was 8 years old, so, 35 years total. I have a high school degree. I dropped out of art school. I'm self-taught. I've worked on some larger teams but generally in a role where I was responsible for a final module or piece of code from start to finish. Most of my career has been working alone, planning and building full stack custom software for midsized businesses and startups that need particular functionality in their workflows that they can't find off the shelf. Much of it is designing the business logic. Most of my codebase now is TS, NodeJS and PHP, (and SQL) although up until 2016 or so I did a huge amount of work, including games, in Actionscript 3.