The Artima Developer Community
Sponsored Link

Python Buzz Forum
Executable line noise? Damn right (at least in this case)

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Carlos de la Guardia

Posts: 219
Nickname: cguardia
Registered: Jan, 2006

Carlos de la Guardia is an independent web developer in Mexico
Executable line noise? Damn right (at least in this case) Posted: Jun 27, 2006 9:28 PM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Carlos de la Guardia.
Original Post: Executable line noise? Damn right (at least in this case)
Feed Title: I blog therefore I am
Feed URL: http://blog.delaguardia.com.mx/feed.atom
Feed Description: A space to put my thoughts into writing.
Latest Python Buzz Posts
Latest Python Buzz Posts by Carlos de la Guardia
Latest Posts From I blog therefore I am

Advertisement

Like many web development veterans, I once used Perl and even liked it (I was a subscriber to the Perl Journal and all).

Now I really prefer Python, though I still do some Perl work from time to time. I'm not really what you would call a Perl hater, but still, when you see code like this, it's hard to argue with this quote from Bruce Eckel's site:

"Python is executable pseudocode. Perl is executable line noise".

Have a look at this code (from Marc Abramowitz via Chris Petrilli):

    ''=~(        '(?{'        .('`'        |'%')        .('['        ^'-')
.('`' |'!') .('`' |',') .'"'. '\$'
.'==' .('[' ^'+') .('`' |'/') .('['
^'+') .'||' .(';' &'=') .(';' &'=')
.';-' .'-'. '\$' .'=;' .('[' ^'(')
.('[' ^'.') .('`' |'"') .('!' ^'+')
.'_\{' .'(\$' .';=('. '\$=|' ."|".( '`'^'.'
).(('`')| '/').').' .'\"'.+( '{'^'['). ('`'|'"') .('`'|'/'
).('['^'/') .('['^'/'). ('`'|',').( '`'|('%')). '\".\"'.( '['^('(')).
'\"'.('['^ '#').'!!--' .'\$=.\"' .('{'^'['). ('`'|'/').( '`'|"&").(
'{'^"[").( '`'|""").( '`'|"\%").( '`'|"\%").( '['^(')')). '\").\"'.
('{'^'[').( '`'|"/").( '`'|".").( '{'^"[").( '['^"/").( '`'|"(").(
'`'|"\%").( '{'^"[").( '['^",").( '`'|"!").( '`'|",").( '`'|(',')).
'\"\}'.+( '['^"+").( '['^")").( '`'|")").( '`'|".").( '['^('/')).
'+_,\",'.( '{'^('[')). ('\$;!').( '!'^"+").( '{'^"/").( '`'|"!").(
'`'|"+").( '`'|"\%").( '{'^"[").( '`'|"/").( '`'|".").( '`'|"\%").(
'{'^"[").( '`'|"$").( '`'|"/").( '['^",").( '`'|('.')). ','.(('{')^
'[').("["^ '+').("`"| '!').("["^ '(').("["^ '(').("{"^ '[').("`"|
')').("["^ '/').("{"^ '[').("`"| '!').("["^ ')').("`"| '/').("["^
'.').("`"| '.').("`"| '$').",".( '!'^('+')). '\",_,\"' .'!'.("!"^
'+').("!"^ '+').'\"'. ('['^',').( '`'|"(").( '`'|")").( '`'|",").(
'`'|('%')). '++\$="})' );$:=('.')^ '~';$~='@'| '(';$^=')'^ '[';$/='`';

The amazing thing? It works (try it out if you don't believe me).

Of course I know you would never write real code like this, even in Perl, but still, the language seems to be perfect for this kind of stuff. I also know that you can write unreadable code in any language, but it seems to me that you can write it far better in Perl.

(With apologies to Codehead.)


Read: Executable line noise? Damn right (at least in this case)

Topic: Try out CPSBayes, the multipurpose naive bayesian classifier for CPS Previous Topic   Next Topic Topic: This is a test

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use