3 ms·
One of the best ways to measure code complexity is to zip up the source code. This eliminates a lot of the redundancies and is a more direct measure of entropy/
by jiggawatts 11mo ago
One of the best ways to measure code complexity is to zip up the source code. This eliminates a lot of the redundancies and is a more direct measure of entropy/complexity than almost anything else.
By that metric, jpeg-xl is about 4x the size of the jpeg or png codebase.
- tkfoss 11mo agoInteresting approach
- jiggawatts 11mo agoIt comes from the "intelligence is a form of compression" hypothesis that has been floating around in the ML space. Also, with a good compression algorithm it is a fairly direct measure of entropy, which is quite well correlated with what a developer might consider code size and/or complexity.
- tkfoss 11mo agoI'm familiar with the concept[1], but I'm unsure if it's a good showcase of code complexity. I've tested some internal microservices I'm deeply familiar with and found no correlation... [1] for the past ~15 years actually, got introduced to the concept through works of mr. Hutter, after becoming aware of his Prize, and I'm dabbling in compression to this day (right now trying to improve on Bellard's nncp)
- account42 11mo agoYour method would still judge well-documented code with lots of intermediate variables as more complex than undocumented code golf soup.