Linked by David Adams on Tue 14th Jul 2015 23:21 UTC
Original OSNews Interviews From Linux Voice: "Perl 6 has been 15 years in the making, and is now due to be released at the end of this year. We speak to its creator to find out what’s going on."
Thread beginning with comment 614096
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[2]: Why perl?
by cfgr on Wed 15th Jul 2015 12:00 UTC in reply to "RE: Why perl?"
cfgr
Member since:
2009-07-18

I just love the language, mostly because there are 1000s of (perfectly good) ways to get the same thing done. That means that your own style and expression of coding are more important than in other languages.

That's funny as it's the complete opposite of the Zen of Python: "There should be one-- and preferably only one --obvious way to do it."
https://www.python.org/dev/peps/pep-0020/

It's funny because Perl and Python are languages that have very similar use cases but have a very distinct ideology and approach.

I personally prefer Python's way. The expression is in the structure of your data and the architecture built around it, not in the code that is derived from it. Get your data structures right and the code should write itself.

That's nice about having the choice. We're all different and what doesn't work for me, might just work all the better for you. So let Perl flourish!

Edited 2015-07-15 12:02 UTC

Reply Parent Score: 5

RE[3]: Why perl?
by Alfman on Wed 15th Jul 2015 14:24 in reply to "RE[2]: Why perl?"
Alfman Member since:
2011-01-28

cfqr,

That's funny as it's the complete opposite of the Zen of Python: "There should be one-- and preferably only one --obvious way to do it."


I still use perl because it's always there (alot like VI actually), but this 1000s of ways has got to be one of my biggest gripes with it, since there's absolutely no possibility of mastering it. Everyone just learns a small subset and goes with it, this is especially true with modules. Devs wanting something better keep building new modules and wrappers with enhancements, which would be fine except that thousands of developers have the same idea. Without more discipline in synchronizing their work, it results in severe duplication and "not invented here" syndrome.


http://perldoc.perl.org/functions/localtime.html
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
my @abbr = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
print "$abbr[$mon] $mday";
# $mon=9, $mday=18 gives "Oct 18"
$year += 1900;


use Time::localtime;
printf "Year is %d\n", localtime->year() + 1900;


http://search.cpan.org/~drolsky/DateTime-1.20/lib/DateTime.pm
use DateTime;
$dt = DateTime->now; # same as ( epoch => time() )
$year = $dt->year;
$month = $dt->month; # 1-12
$day = $dt->day; # 1-31
# all of the start-at-1 methods above have corresponding start-at-0
# methods, such as $dt->day_of_month_0, $dt->month_0 and so on
$ymd = $dt->ymd; # 2002-12-06
$ymd = $dt->ymd('/'); # 2002/12/06


use Date::Simple (':all');
my $date2 = ymd($year, $month, $day);
my $today = today();


use Date::Time;
my $date=Date::Time->new();


...More modules for date parsing..
use Date::Parse;
$time = str2time($date);
($ss,$mm,$hh,$day,$month,$year,$zone) = strptime($date);


use Date::Manip qw(ParseDate);
$date=ParseDate($datestr);



There's a bewildering array of similar yet different solutions for everything. You really need to look at CPAN to appreciate the scope of the problem.
http://search.cpan.org/search?query=time&mode=module
http://search.cpan.org/search?query=date&mode=module

http://search.cpan.org/search?query=socket&mode=module
http://search.cpan.org/search?query=ipc&mode=module
http://search.cpan.org/search?query=sql&mode=module
http://search.cpan.org/search?query=cgi&mode=module


When I write perl, I find this extremely discouraging, I'd rather have a much more standardized framework with fewer & better solutions. Maybe I need to build my own.
/sarcasm

Reply Parent Score: 4

RE[4]: Why perl?
by cfgr on Wed 15th Jul 2015 15:34 in reply to "RE[3]: Why perl?"
cfgr Member since:
2009-07-18

Yep, that's one of the two main reasons I don't really like Perl. The other being that Perl's syntax is just too cryptic and ugly.

Personal styles usually suck anyway. I've always followed a very clean coding style, or so I thought, until I threw my (python) code through a PEP8 linter. I didn't believe it would make much difference, but the readability and consistency definitely improved. Some very smart people gave those things a lot of thought, why would my gut feeling be any better?

But then, I guess everyone's got different preferences and who am I to deny others having fun. Some people love puzzling. Let them enjoy it! As long as they stay away from my work.

As a side note, the above is also a bit why I'm not a huge fan of templating inside languages (such as Clojure). It again provides too many ways in which you can express the same thing. I'd rather have more explicit templating outside the language (i.e. strings or different files).

Edited 2015-07-15 15:46 UTC

Reply Parent Score: 3

RE[4]: Why perl?
by Wondercool on Wed 15th Jul 2015 15:47 in reply to "RE[3]: Why perl?"
Wondercool Member since:
2005-07-08

IMHO the fact that there are 15 different Date modules in CPAN isn't a big problem at all, it is a feature.

Just like the 10s of Desktop managers, init systems, file systems, distributions in Linux, this is what makes it strong. It means you aren't coerced into using some shitty API but can pick what suits you.

Edited 2015-07-15 15:59 UTC

Reply Parent Score: 2

RE[3]: Why perl?
by Wondercool on Wed 15th Jul 2015 15:58 in reply to "RE[2]: Why perl?"
Wondercool Member since:
2005-07-08

In natural language you wouldn't expect people to all speak the same sentence for the same situation or even the same language.

How boring would it be if all would always say 'Good day' instead of 'Hi', 'How are you?', 'Nice day', 'Bonjour'

The exercise of a computer language is to create a language that is understandable by humans while still possible to compile into something the machine understands.

I don't like forcing people into a certain format.
An example would be:

if ($opt_v) {
print “Some verbose message \n”;
}
Vs.
$opt_v && print “Some verbose message\n”;
Vs.
print “Some verbose message\n” unless !$opt_v
Vs.
print “Some verbose message\n” if $opt_v

Why would I force a programmer to use exactly one of these methods? The more expressive the language, the greater chance of creating beauty, IMHO.

Reply Parent Score: 3

RE[4]: Why perl?
by Delgarde on Wed 15th Jul 2015 21:40 in reply to "RE[3]: Why perl?"
Delgarde Member since:
2008-08-19

The more expressive the language, the greater chance of creating beauty, IMHO.


It's a programming language, not a human one. It's not supposed to be beautiful - it's supposed to be functional, and it's supposed to be maintainable. Beauty is a bonus.

Reply Parent Score: 3

RE[4]: Why perl?
by WorknMan on Thu 16th Jul 2015 02:08 in reply to "RE[3]: Why perl?"
WorknMan Member since:
2005-11-13

Why would I force a programmer to use exactly one of these methods? The more expressive the language, the greater chance of creating beauty, IMHO.


Personally, I'll take readability over beauty any day. I don't give a damn if it looks 'boring' or not.

Reply Parent Score: 3