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 614099
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[3]: Why perl?
by Alfman on Wed 15th Jul 2015 14:24 UTC 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[5]: Why perl?
by Soulbender on Thu 16th Jul 2015 03:27 in reply to "RE[4]: Why perl?"
Soulbender Member since:
2005-08-18

until I threw my (python) code through a PEP8 linter.


PEP8 is one of the best things about Python.

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[5]: Why perl?
by acobar on Wed 15th Jul 2015 16:31 in reply to "RE[4]: Why perl?"
acobar Member since:
2005-11-15

Had you ever worked with maintenance of code of someone else besides you ? If you had, chances are that you wished the coder had stick with standardized libraries instead of picking some random he thought were great and that didn't receive maintenance for a long time (i.e. is close to an abandoned carcass by then).

Anyway, I am not sure if my sarcasm detector is waning. ;)

Edited 2015-07-15 16:34 UTC

Reply Parent Score: 4