Hacker News new | past | comments | ask | show | jobs | submit login

A great reminder that code is data, and data code.

Now I want to see how all my programs look as bitmapped images... brb.




Hopefully it will look mostly like random noise, without many patterns. That would indicate compressed information without much repetition. If you see lots of regular patterns, perhaps that means refactoring is in order to maintain DRYness.

Hmm, curious if this visualization would actually work to spot duplicated code.


Hopefully it won't actually. Most languages are not designed for compactness of source code, and most forms of factoring will produce fairly noticeable patterns; e.g. lots of funcion declarations.


True. One would have to first reduce the natural duplication/patterns that come with the language (i.e. function declarations, etc.) so that only the meaningful user code is left, before such analysis would be useful.


Back in the days of A500, you could point the video viewport at any part of the memory -- including currently executing code. Watching lz decompress files was mesmerizing.


Yeah, you're describing Shannon entropy: http://en.wikipedia.org/wiki/Entropy_(information_theory)

so that means DRY is "try to maximise entropy" gzipped files should also look like random noise, for the same reasons.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: