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 614090
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE: Why perl?
by Wondercool on Wed 15th Jul 2015 09:00 UTC in reply to "Why perl?"
Wondercool
Member since:
2005-07-08

I can only speak from a personal point of view - I still code (professionally) in Perl from time to time.

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.

When I started coding in Perl I was cursing it like anyone else, but I have come to appreciate the flexibility of the language and its versatility. For instance, it's quite an achievement that Perl supports Object Oriented Programming with a minimal change to the language.

I actually really like the language: hashes and arrays our of the box with all the manipulation functions, auto-vivification, interpolation of strings, file handling. Yes you can screw it up the readability royally and the language requires discipline but at least everything is possible.

I also like the gigantic library of useful code called CPAN and the extremely knowledgeable and friendly Perl community. See www.perlmonks.org

And I also really like the really good builtin documentation (perldoc), character and language support, package managers and mostly the builtin debugger.

It's just awesome!

Reply Parent Score: 7

RE[2]: Why perl?
by cfgr on Wed 15th Jul 2015 12:00 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[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[2]: Why perl?
by Bill Shooter of Bul on Wed 15th Jul 2015 14:05 in reply to "RE: Why perl?"
Bill Shooter of Bul Member since:
2006-07-14

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.


This is why I never want to use it for anything that anyone else will ever contribute to. Everyone has their own style and in perl they are greatly exaggerated and its difficult to get people to switch

Yes you can screw it up the readability royally and the language requires discipline but at least everything is possible.


Yes, I agree. And yes its difficutl to get more than a few people to share the required discipline.

Reply Parent Score: 3

RE[3]: Why perl?
by WorknMan on Wed 15th Jul 2015 15:18 in reply to "RE[2]: Why perl?"
WorknMan Member since:
2005-11-13

This is why I never want to use it for anything that anyone else will ever contribute to. Everyone has their own style and in perl they are greatly exaggerated and its difficult to get people to switch


Yeah. I've (unfortunately) had to maintain some perl code and quickly realized that out of the 9,000 different ways there are to do one thing in perl, perl coders usually gravitate to the most cryptic and hard to read way, because they seem more interested in showing off than actually writing readable code. And you know what I'm talking about too... the kind of code that looks like modem line noise, without a comment in sight.

And I think they do it on purpose too. If you ask me, they've gotta be compensating for something. Penis size, perhaps ;)

Edited 2015-07-15 15:20 UTC

Reply Parent Score: 4

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

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.

Which is funny, because I (and most of my colleagues) regard that as one of it's biggest weaknesses. Too many ways to do the same thing, so that unless you're an expert in all of them, it's all but impossible to maintain code written by someone else according to their own personal style and expression.

I actually really like the language: hashes and arrays our of the box with all the manipulation functions, auto-vivification, interpolation of strings, file handling. Yes you can screw it up the readability royally and the language requires discipline but at least everything is possible.


It's been a long time since most of those features were considered to be anything more than *absolute minimum* functionality for any popular scripting language.

Reply Parent Score: 3

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

It's been a long time since most of those features were considered to be anything more than *absolute minimum* functionality for any popular scripting language.


You would think so, I tried to learn Ruby lately but it isn't easy. I couldn't understand why it wouldn't accept constructs like my_array[][] and it turns out that you have to create your own overloading to do auto-vivification. I just couldn't believe it.

Reply Parent Score: 2