4 ms·
Kolmogorov complexity is close to what you're getting at, but is about total string length of the program which is more useful than line count when line count c
by Jtsummers 5y ago
Kolmogorov complexity is close to what you're getting at, but is about total string length of the program which is more useful than line count when line count can be gamed. That is, a shorter program is "simpler" than a longer program. In quotes because it's not necessarily true (see code golfing, the language itself may become very complex to permit such a short program and the requisite knowledge and competency then increases the total complexity to achieve, or even understand, the simpler result). A similar technique that doesn't discount meaningful variable names might use syntactic token count. That way:
printf("Hello, World!\n");
and:
Put("Hello, World!\n");
Can be treated as the same complexity (the difference is 3 characters, and they are otherwise equivalent).
There are also analysis methods (names escaping me, and Google fu is weak today) that look at loops, procedure calls, dependency graphs, and other things to attempt to discern (should be treated as guidelines and not rules) the complexity of a program using objective metrics.
https://en.wikipedia.org/wiki/Kolmogorov_complexity https://en.wikipedia.org/wiki/Kolmogorov_complexity
- Zababa 5y ago> There are also analysis methods (names escaping me, and Google fu is weak today) that look at loops, procedure calls, dependency graphs, and other things to attempt to discern (should be treated as guidelines and not rules) the complexity of a program using objective metrics. Cyclomatic complexity https://en.wikipedia.org/wiki/Cyclomatic_complexity https://en.wikipedia.org/wiki/Cyclomatic_complexity might be what you're thinking about.
- Jtsummers 5y agoThat was it, thank you.
- namaria 5y ago>the language itself may become very complex to permit such a short program Hit the nail on the head. We can't fight thermodynamics, we can only cheat by drawing lines and pumping entropy one way. "Simplicity" is obtained by hiding complexity away. Modern container ships are reliably run by 13 people because of a huge system of builders and maintainers for everything from diesel engines to navigation systems.
- Buttons840 5y agoFamiliarity is a rug we get to sweep the complexity under. If people know a language, like regexes (or APL as an extreme case), they can hide a lot of complexity.