News for hackers. Stuff that matters.
Re:Real pixel coding (2011) by shurcooL on Tuesday March 05, 2013 @09:52AM (#5324729)
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.

Re:Real pixel coding (2011) by algorias on Tuesday March 05, 2013 @10:23AM (#5324925)
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.
Re:Real pixel coding (2011) by shurcooL on Tuesday March 05, 2013 @11:21AM (#5325341)
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.
Re:Real pixel coding (2011) by btbuildem on Tuesday March 05, 2013 @11:34AM (#5325447)
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.
Re:Real pixel coding (2011) by jes5199 on Tuesday March 05, 2013 @01:40PM (#5326418)
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.