Live data from Hacker News

Perl is 25 years old today

perldoc.perl.org

101–110 of 131 posts

Re: Perl is 25 years old today

#101
I haven't written a single line of Perl for over a year now and can't remember much of the language - and I am sure I would not even be able to understand my own code anymore!

Perl is a very handy and powerful scripting language but it should not be considered as a durable solution. Whatever is quickly hacked using Perl should be probably rewritten in a much more structure language, especially if you plan on maintaining this code.

Re: Perl is 25 years old today

#102

I haven't written a single line of Perl for over a year now and can't remember much of the language - and I am sure I would not even be able to understand my own code anymore! Perl is a very handy and powerful scripting language but it should not be considered as a durable solution. Whatever is quickly hacked using Perl should be probably rewritten in a much more structure language, especially if you plan on maintain…

Of course one can also write perl with care and attention. Perl::Critic, the Moose family, and appropriate use of the CPAN really helps with that discipline.

Re: Perl is 25 years old today

#103

I haven't written a single line of Perl for over a year now and can't remember much of the language - and I am sure I would not even be able to understand my own code anymore! Perl is a very handy and powerful scripting language but it should not be considered as a durable solution. Whatever is quickly hacked using Perl should be probably rewritten in a much more structure language, especially if you plan on maintain…

Whatever is quickly hacked...

... in any language should probably be cleaned up if you plan on maintaining it.

Re: Perl is 25 years old today

#104
post #29

Earlier quoted context omitted.

CPAN might be centralized, but Java libraries are far superior. This is not a pissing contest, but a fact. The java runtime makes everything else look amateurish and unprepared. Debugging, profiling, introspection and distribution, all built into the platform. Attach to any running process and analyze away. Perl is good when it works, but when it doesn't, it's cryptic stack traces and `exit -1`, nothing meaningful.

Not really true. Yesterday I was trying to debug resource-loading issues. In any normal programming language, you can just strace it and you'll see where the program is doing I/O and you can figure out where it's trying to load files from. But if everything is in a jar, you don't see any OS-level I/O happening when Java tries to load something, so you have to invent all-new tools just to figure things out. When you s…

I never used strace even when doing C and sometimes C++ and still managed. Eclipse can't be beaten for Java, C/C++, PHP, Perl, Ruby and Python development.

EDIT: I just used "strace /usr/bin/java -jar myjar.jar" and saw what looks IO but I'm not familiar with strace output yet. It looks like a handy utility though. Can you give an example of something that you expected to see but didn't when you tried it?

Re: Perl is 25 years old today

#105
post #16

Before i switched to Python as my general purpose language, i used to be a bit of a Perl fanatic. I've still to come across a language that lets you get your ideas down as quickly. It's full of fantastic time savers, e.g. the for( ) construct and the format output functionality cover a bunch of common use cases in minimal keystrokes (let me pipe in some data, analyse it, then spit it out in a clean report). It can hu…

Have you looked at APL or its derivatives like J and K? For certain types of work, and with experience, it's very terse and expressive.

J, now there's a language! The C source is written in a J like style: a wall of ascii punctuation interspersed with single char identifiers.

It looks like a fantastically expressive language, but i fear the learning curve would be too steep for my time invested to pay off - others would have to spend the same time to learn it as well, negating any code sharing / reuse in my org (we don't use J).

Re: Perl is 25 years old today

#106
post #20

Before i switched to Python as my general purpose language, i used to be a bit of a Perl fanatic. I've still to come across a language that lets you get your ideas down as quickly. It's full of fantastic time savers, e.g. the for( ) construct and the format output functionality cover a bunch of common use cases in minimal keystrokes (let me pipe in some data, analyse it, then spit it out in a clean report). It can hu…

So why you moved to Python?

Good question.

I found others i had to share code with weren't as interested as me about writing maintainable perl code - i got really fed up with a patch work of "write only" perl scripts performing useful functions in prod. From DB maintenance tasks to general housekeeping, to work-arounds for prod app issues that never got prioritised for strategic fixes.

I found in practice python code produced by most others was easier maintained: it seemed to more or less force people to write more readable and therefore, maintainable code.

I also viewed the fact that Python was one of the premier languages across so many problem domains (Systems, DB, GUI, Web, Large data, GPU, etc.) as being a sure fire payoff for any time invested in it.

In environments this size it's not any one persons actions dictate what becomes the status quo: different groups will have different agendas and therefore priorities and views. I guess i was lucky that everyone else was either willing to give Python a go, or was easily convinced.

FWIW over the past few years it's proven to be a good choice for us. There are still O'Reilly books float about, esp between the newcomers but there's no zealous "where's my camel book!" shouts anymore.

Re: Perl is 25 years old today

#107
post #20

Earlier quoted context omitted.

So why you moved to Python?

Good question. I found others i had to share code with weren't as interested as me about writing maintainable perl code - i got really fed up with a patch work of "write only" perl scripts performing useful functions in prod. From DB maintenance tasks to general housekeeping, to work-arounds for prod app issues that never got prioritised for strategic fixes. I found in practice python code produced by most others was…

* ... it seemed to more or less force people to write more readable and therefore, maintainable code.*

What do you mean by "readable" and how does Python seem to enforce that?

Re: Perl is 25 years old today

#108
post #29
post #21

I've found over the past decade or so that when I write a "perl" program I'm really writing about five lines of glue code around multiple CPAN packages. Well maybe more than 5 lines for control flow, some business-logic error handling, etc. When I write in another language I spend a long time looking for a library like the ten I'd find in CPAN, sometimes I find one but often enough not, then a long time complaining a…

CPAN might be centralized, but Java libraries are far superior. This is not a pissing contest, but a fact. The java runtime makes everything else look amateurish and unprepared. Debugging, profiling, introspection and distribution, all built into the platform. Attach to any running process and analyze away. Perl is good when it works, but when it doesn't, it's cryptic stack traces and `exit -1`, nothing meaningful.

Seriously?

This is a fact: .

Java calling anyone else's stack traces is backwards and hilarious, and only going to get better in about 15 years when java finally gets lambdas.

Re: Perl is 25 years old today

#109
post #57

Earlier quoted context omitted.

My experience is almost exactly the opposite. Whenever I'm writing in Python I can't escape the feeling that the code is simply fragile due to missing language features. Obviously this starts with all the regex initializations (often quite distant in source from where they are applied) which make regular expressions in python just a huge mess. Perl's autovification allows me to build a data structure at parse time wi…

For list comprehensions and a different style of generator, look at https://metacpan.org/module/List::Gen And then there are a pile of modules that implement python-style generators, some using https://metacpan.org/module/Coro (co-routines implemented as threads), some using crazy hacks: https://metacpan.org/module/Compile::Generators https://metacpan.org/module/Coro::Generator https://metacpan.org/module/Attribute::…

Yeah, honestly though those fail the "clean" test for me. What I really meant isn't the computational capabilities of python generators but the way the mesh nicely with the way builtins like "in" or "all()" or "any()" work on plain old data. Reasoning about them, in general, isn't any harder than reasoning about a dict or list in the common case, and that's a feature missing from the perl equivalents which try to do it in a library. I'd feel comfortable throwing a comprehension into code intended to be maintained by a novice. I'd never inflict any of that junk on the poor maintainer.

Re: Perl is 25 years old today

#110
post #20

Earlier quoted context omitted.

So why you moved to Python?

Good question. I found others i had to share code with weren't as interested as me about writing maintainable perl code - i got really fed up with a patch work of "write only" perl scripts performing useful functions in prod. From DB maintenance tasks to general housekeeping, to work-arounds for prod app issues that never got prioritised for strategic fixes. I found in practice python code produced by most others was…

I am somehow surprised that people consider merely forcing indentation on bad programmers makes them good programmers.
Post reply on HN