nice .. and so simple![]()
Yep, I finally got bored enough to sit down and learn perl!
Here's a simple perl implementation of the "echo" command:
Ain't perl great?Code:#!/usr/bin/env perl print "@ARGV\n";![]()
nice .. and so simple![]()
Code:#!/usr/bin/env ruby p ARGVCode:#!/usr/bin/env python from sys import argv print argv
sorry, but as far as i'm concerned,
python > perl ;D
Ugh, I don't like python much anymore.sorry, but as far as i'm concerned,
python > perl ;D
As far as I'm concerned, any language where something like the above is legal is really messed up. Real languages use braces to denote code blocks, not indentation. Makes them so much easier to read.Code:... return 0 return 1 ...
#:: ::-| ::-| .-. :||-:: 0-| .-| ::||-| .:|-. :||
open(Q,$0);while(<Q>{if(/^#(.*)$/){for(split('-',$1)){$q=0;for(split){s/\|
/:.:/xg;s/:/../g;$Q=$_?length:$_;$q+=$q?$Q:$Q*20;}print chr($q);}}}print"\n";
#.: ::||-| .||-| :|||-| ::||-| ||-:: :|||-| .:|
As far as I'm concerned, any language where something like the above is legal is really messed up. Real languages use indentation to denote code blocks, not braces. Makes them so much easier to read.
I'm sorry, but having heard you say that, all your opinions are suspect, IMO. Perl, in general, has never been more readable than python (again, IMO obviously), even when a user doesn't use context to obfuscate the code. Having used python for the last six or so months, I have to say that not having braces makes code (to me) worlds easier to read. Indentation is used for readability. Braces are used to tell the compiler when a block is done. Makes sense to combine them and get rid of those extraneous characters. IMO, a language that doesn't need extra characters scattered about (including the $,@,%) is more aesthetically pleasing, more readable, and more writable. But if you think that, it's your opionion, and I won't try to change it; I'll just have to remember not to base my judgements on your opinions.
As far as I'm concerned, any language where something like the above is legal is really messed up. Real languages use braces to denote code blocks, not indentation. Makes them so much easier to read.
I don't mean to be insulting; I just want you to understand how vehemently I disagree with you. And I wonder just how much you've used python.
Wow, talk about a slanted opinion. That's a freaking comment! That has nothing to do with anything! You just put that there to look worse than it really is!#:: ::-| ::-| .-. :||-:: 0-| .-| ::||-| .:|-. :||
Only an idiot would code something like that (how surprizing that it comes from you...). A sane person would have written it like this:open(Q,$0);while(<Q>{if(/^#(.*)$/){for(split('-',$1)){$q=0;for(split){s/\|
/:.:/xg;s/:/../g;$Q=$_?length:$_;$q+=$q?$Q:$Q*20;}print chr($q);}}}print"\n";
Code:open(Q,$0); while(<Q>) { if(/^#(.*)$/) { for(split('-',$1)) { $q=0; for(split) { s/\|/:.:/xg; s/:/../g; $Q=$_?length:$_; $q+=$q?$Q:$Q*20; } print chr($q); } } } print "\n";Way to completely miss the point Vince!As far as I'm concerned, any language where something like the above is legal is really messed up. Real languages use indentation to denote code blocks, not braces. Makes them so much easier to read.
My point was that it's really confusing to see a return statement on one line, then another one on the next line! Logically, you'd think the next one does nothing, because the first one already returns something and ends the function/whatever the code block was.Perl, in general, has never been more readable than python (again, IMO obviously), even when a user doesn't use context to obfuscate the code.
I agree that indenting it properly makes it easier to read (stupid vince), but once you lose the braces, the code blocks become blurred and harder to see just by looking.Indentation is used for readability.
Well first of all, one thing that really bothers me about python is that it doesn't even convert between the different types of variables automatically. I mean, python will tell you plain and simple that 1/2=0, but 1.0/2=0.5. Awesome language, guys! In perl, if you divide two numbers, it gives you the actual value, not rounded down or whatever.IMO, a language that doesn't need extra characters scattered about (including the $,@,%) is more aesthetically pleasing, more readable, and more writable.
On top of that, perl will tell you just by looking at the name of a variable whether you are dealing with a scalar, array or hash. Python won't tell you anything about a variable by it's name -- and python has so many more types of variables! ints, floats, lists, strings, etc. Way more confusing if you ask me.
When have you ever based your judgements on my opinions?I'll just have to remember not to base my judgements on your opinions.
Well, I've submitted more Python examples to CCAE than perl examples.And I wonder just how much you've used python.
Bookmarks