I approach obfuscation more as an excersise in terseness than perhaps unreadability (although that is a byproduct).
I do them as a mental excercise to keep my brain actually having to think about things i don't normally have to - i agree with djantzen about it being partly "mental masturbation", but at the same time if people want to do that then who's to stop them? And by writing hard code in a terse manner i now understand functions i wouldn't necessarily have used or certainly understand as well (vec, pack/unpack, splice, map, grep etc etc)
Also it's nice to make something that people are surprised and pleased that it can actually be done in that space.
I started off doing them entirely for email signatures, so i almost always use a 288 char limit - 4 lines of 72 chars each.
I use Vim and a script which formats the code into 4*72 lines, removes whitespace and counts chars for me
(you can see it in my scratchpad - usage sizer <name of script to check> <char counting 0|1> <chomp whitespace> <width>).
The process usually starts with an idea - something i've seen that i think i can do in that number of chars (or more likely can't do - but want to try). I'm starting to do bigger ones - like Balls! as the problems i approach get harder to fit in.
For example: The first one i posted here was this - a pair of sigs to generate and then solve a maze. This became an obsession and i kept working at it till i got it into 4 lines.
After the idea i tend to write it in semi-long hand, then start shortening it - spotting shorter ways to do things etc etc.
er, that's it really!
apologies for the rambling post!
al
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.