7 ms·
There’s nothing wrong with optimism. But this line of thinking is a bit naive unfortunately. I’d say pretty much no one agrees on what “better” looks like. Bet
by amw-zero 6y ago
There’s nothing wrong with optimism. But this line of thinking is a bit naive unfortunately.
I’d say pretty much no one agrees on what “better” looks like. Better to someone often means applying a pattern that they just discovered in a blog post that week. Software design is still entirely subjective.
For example, “better” once meant refactoring to be more object-oriented. That’s backfired a bit recently, so now “better” might mean having a more functional design. There’s no evidence that either of these actually have any impact on the end result of quality as perceived by users.
Anyway, it’s good to be positive. There’s probably subconscious good that comes from that.
- tuwtuwtuwtuw 6y agoI think in a huge number of cases it is possible to objectively say that a change made the code better. I see those very often when consulting at companies. Just to give you an example (which I ran across last week), if you have some code handling a cart in an e-commerce site and you need to keep track of the number of items in this cart would you prefer the variable name "totalAmount" or "quantity". There's also a variable named "totalAmountIncludingTax" which holds the monetary amount to pay for the items in the cart.
- mattgreenrocks 6y agoThe accumulation of many small wins in things like naming is often much more helpful than full-on overhauls. But you have to be willing to do the small, seemingly inconsequential things to build up to those.
- amw-zero 6y agoHow do you know that one name is better than the other? I see renames all the time where I preferred the original version.
- tuwtuwtuwtuw 6y agoIf you have a variable representing the length of an array containing user accounts, would you prefer the name "length" or "price"?
- amw-zero 6y agoThis isn’t a relevant argument. The fact that you constructed an absurd scenario and there’s a clear winner in it does not imply that there is always a clear winner. In fact, my experience is that in the majority of times there is not a clear winner, and terms get completely overloaded or used imprecisely. So, again, your absurd scenario proves to be quite a weak argument when you consider the scope of the whole problem.
- tuwtuwtuwtuw 6y agoThen I don't think I see the type of meaningless variable renames you are talking about. I do see variable names about as bad as in my example though, and I see them being fixed. They typically arise from some copy/paste where someone wanted similar logic but forgot to rename a variable. I don't see people renaming from say numberOfItems to noOfItems or similar, if that's the type of renames you're referring to. Can you give an example of a rename you are seeing?
- mattgreenrocks 6y ago> Better to someone often means applying a pattern that they just discovered in a blog post that week. Software design is still entirely subjective. No. There are plenty of not-purely-subjective criteria to justify refactors: * the refactor improves abstraction quality * design improvements that result in edge cases being obviated * coupling is diminished/cohesion is improved The relativistic "there is no perfect software design" view is good inasmuch that you don't make idols out of any particular design approach. It is bad when it becomes a fatalistic, thought-terminating meme used to justify one's own inaction. Software design is difficult work. That doesn't mean it isn't possible because the Internet hasn't figured out an exact recipe for creating it. :)
- amw-zero 6y ago> the refactor improves abstraction quality The quality of abstractions is entirely subjective. > coupling is diminished / cohesion is improved This is also entirely subjective. The idea that eliminating coupling is inherently good is an unsound premise. There’s no proof that coupling is bad, and even if there were, there’s also the conversation to be had about which things should be coupled, which is surely a subjective conversation. > design improvements resulting in edge cases being obviated I guess this one is slightly closer to being an objective good. Though even still, I think this is linear thinking at its finest. You may be getting rid of some edge cases but introducing others. Every design is a trade off, and evaluating tradeoffs is a subjective act.
- mattgreenrocks 6y agoWhy is it so important if improvements are “objectively” good?
- amw-zero 6y agoHow else would you know if they are improvements?
- mattgreenrocks 6y ago