Just my opinion, but the better Perl programmer you are, the simpler (simple is the opposite of obfuscated) your code is to understand :-) You should strive to create code that is simple for everyone to understand, whether or not your code is written in Perl.
It is useful to understand obfuscated code to see just what can be done with Perl, but I don't think there's really any use for obfuscated code. If it takes me 5 minutes to figure out what a piece of code does, than that is 4 minutes too long ;-) One of my programming teachers in college told us about the "KISS" principle - you may have heard of it - "K"eep "I"t "S"imple "S"tupid. That one stuck with me.
HTH. | [reply] |
Well in my point of view it is more a question of art. But if you want to get started with this have look at 20312. It should give you an idea of how to do it.
| [reply] |
Writing obfuscated code, for me, was an excuse for experimenting with various features of Perl that may be useful, but not frequently used. Through writing them, I exposed myself to many of the dusty corners that one might run into accidentally otherwise. To that end, I consider the experience of writing one to be of value as a learning tool. While Obfu doesn't teach good style, it teaches style to avoid, it reinforces the logical thought process, teaches a lot about Perl syntax, and in general, helps to force one to deal with parts of Perl that are often overlooked.
| [reply] |
There are no rules. However, some are better received than others. Here are some tips from what I have observed:
- Portability affects how well the code is received.
- use strict- and use warnings-friendly for bonus points.
- But most important by far: It must have artistic element to be interesting, and I don't mean simply formatting the code to look like something. Just look at Obfuscated Code and figure out what you like about your favorites.
| [reply] [d/l] [select] |
Of course that reading and writing obfuscations is good for you. Reading and trying to figure out what does it do and how not only exercises your brain, but it also teaches you about parts of Perl that you otherwise would not know about. It's quite possible that you will never use some of those, but you may learn something that will come handy later. Either when writing your own real code or when deciphering someone elses stuff.
Jenda
Always code as if the guy who ends up maintaining your code
will be a violent psychopath who knows where you live.
-- Rick Osborne
| [reply] |