LWN.net Logo

Deliberate obfuscation: who needs it?

Deliberate obfuscation: who needs it?

Posted Apr 10, 2005 0:00 UTC (Sun) by hppnq (subscriber, #14462)
In reply to: Deliberate obfuscation: who needs it? by rknop
Parent article: Protect Your Source Code: Obfuscation 101 (O'ReillyNet)

Uhmm.. One of the characteristics of good code, is that it still makes sense even if you're not familiar with it. ;-)


(Log in to post comments)

Deliberate obfuscation: who needs it?

Posted Apr 10, 2005 1:59 UTC (Sun) by rknop (guest, #66) [Link]

...then maybe good code doesn't exist?

To be fair, I have written lots of code, and seen lots of code, that does indeed make sense upon reading. However, that's the exception more often than the rule.

If the algorithm is anything other than straightforward, even a wealth of comments at the beginning still leave you with a reasonable task and some time to understand what code is doing. And, once it's been hacked a couple of times to adapt it for other purposes, it almost certainly won't be good code any more. That's when maybe it makes more sense to start over.

-Rob

Deliberate obfuscation: who needs it?

Posted Apr 10, 2005 10:15 UTC (Sun) by hppnq (subscriber, #14462) [Link]

However, that's the exception more often than the rule.

Agreed! I have written my share of really bad stuff, so I know. ;-)

What you're basically saying is that writing a sizeable amount of complicated code does not only demand good enough programming powers (knowledge of algorithms, data structures etc.), but also requires proper maintenance (version control, patch management etc).

Not unlike how the Linux kernel is developed. ;-)

Deliberate obfuscation: who needs it?

Posted Apr 10, 2005 2:34 UTC (Sun) by kokopelli (guest, #11341) [Link]

I would make one subtle change - it should make sense to anyone already familiar with the environment even if it's totally incomprehensible to an experienced but newly hired developer. Mature projects tend to develop their own style, and high reliability projects (e.g., kernels and servers) can be nearly incomprehensible because of the heavy use of macros that ensure the state of the software isn't compromised.

Deliberate obfuscation: who needs it?

Posted Apr 10, 2005 11:10 UTC (Sun) by hppnq (subscriber, #14462) [Link]

Yes, good point. Of course, you can't simplify your code and your means to develop it at the *expense* of its quality, so a steep learning curve is to be expected in some cases, even if you're an excellent programmer.

Note however, that complicated software has levels at which things are happening, which makes it possible to compartmentalize parts of it, in black boxes, for instance. Take git for instance. While I am struggling trying to grasp what is happening there, Linus has already moved to the next level. (Of course. ;-) He knows exactly how git could be part of a bigger system like a SCM tool. And the thing is, it works the other way around too, to some extent. These design issues are hard to extract from the actual code itself if you haven't thought about it for a bit before. ;-)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds