4 ms·
To my mind the conclusion is backwards. A file with a high compressed size might be doing something useful; a file with a low compressed size but a high uncompr
by lmm 3y ago
To my mind the conclusion is backwards. A file with a high compressed size might be doing something useful; a file with a low compressed size but a high uncompressed size is a file that's full of repetitive junk, and those are the files that should be a target for refactoring.
- TeMPOraL 3y agoExactly. As ways to differentiate between "essential complexity" and "accidental complexity" go, the idea of looking at what compresses well sounds quite good - but it's the accidental complexity that will compress the best, and essential the worst. And latter is not the problem, the former is.
- deleted 3y ago[deleted]
- userbinator 3y agoIn other words, the compression ratio is what's important.
- nyrikki 3y agoThat is the entire basically the entire concept of complexity theory. The reals are compressed into the computable reals. The real numbers are un-computable 'almost everywhere' Semi-decidabity is just recursively enumerable that gets you to finite time with unlimited resources. NP-hard is brute forcible in exponential time, with most likely no approximate polynomial reductions. P has exact polynomial time reductions... Most code is made of IF and FOR loops, because that produces primitive recursive functions, which are most of the intuitive computable functions that always halt. The problem becomes with complex systems where you need to balance coupling with cohesion along with free variables, WHILE and GOTO. Note that the above compression was lossy. If you consider that information loss as setting constraints through heuristics, (educated guesses) those constraints may or may not work for a particular use case. The problem with how we often try to set coding style is that we want simple universal rules. Unless you have a system that fits in with those ideals all the time that is problematic. Gödel demonstrated that isn't possible for complex systems. Either our rules will be inconsistent or incomplete. This is why I think selling conventions as ideals, that need to yield to less preferred cohesion models when appropriate is the real solution. Unfortunately that requires a lot more thought and vigilance. Functional cohesion with loose coupling is what we shoot for when it is appropriate, but not as a hard fast rule.