Live data from Hacker News

Learn Perl in about 2 hours 30 minutes

qntm.org

11–20 of 111 posts

Re: Learn Perl in about 2 hours 30 minutes

#12

Would it be beneficial to know this alongside of Python, or is it more used instead of Python?

The scripting languages are quite similar. IMHO, it is better to learn something different instead of another one of them.

Perl has an emphasis on libraries. CPAN is the gold standard for the scripting languages. (To see what I mean -- search for signatures, Moose and Acme::Bleach on search.cpan.org. (+) )

Another good thing is the community of smart and laid back people.

I personally prefer to do Perl because it is fun.

The main disadvantage with the Perl "everything and the kitchen sink" attitude is if you are in a group without good coding standards... Perl also gets a tougher learning curve in the beginning, just from there being more to learn.

(+) Joke modules on CPAN generally start with Acme.

Edit: Huh, why down votes? Just a reflex by language trollers? :-)

Re: Learn Perl in about 2 hours 30 minutes

#13
post #7

Wish there were similar ones for all the other languages - PHP / Python etc. I always thought that most programmers and web developers experienced in one language can quickly pick up the major features of another lanaguage, if there was a quick overview of this sort. Know of any sites that do this? Maybe this is a great opportunity for someone to put together a site like that?

Not just an overview but something where you pick the languages you know and it shows you side by side examples doing the same thing.

I know there's a site that does that (can't remember the name) but having it side by side with a great overview like this would be awesome.

Re: Learn Perl in about 2 hours 30 minutes

#14
post #7

Wish there were similar ones for all the other languages - PHP / Python etc. I always thought that most programmers and web developers experienced in one language can quickly pick up the major features of another lanaguage, if there was a quick overview of this sort. Know of any sites that do this? Maybe this is a great opportunity for someone to put together a site like that?

One thing I've always wanted to do is cross reference the data structures/containers for various languages. In Python a dictionary is what Perl calls a hash and what C++ calls a map. Three different names for the same data structure (key value based).

I don't think Perl has a set container by default, but they can be added from CPAN, Python does, it's called a set ;) as does c++ where it, too, is called a set. Again, a key value based data structure, but in this case, the key is the value.

Re: Learn Perl in about 2 hours 30 minutes

#15

Would it be beneficial to know this alongside of Python, or is it more used instead of Python?

That depends on what you want to do. If you want to do things with text, especially transforming text, Perl is IMO opinion better at that task. Perl has been the scripting language for me, but I'm thinking of changing to Python because of NumPy, SciPy and the libraries for numerical analysis and scientific computing. Python seems to be better than Perl in that area. This is a library issue whereas when it comes to text processing it's more of a language thing.

I think Perl and Python have a lot more in common than differences when it comes to what they are good at. If you know one scripting language, you don't gain as much when you learn the next. My recommendation is to learn something different, C, Haskell, Lisp or Prolog for example. That would make you think in different ways.

Also, chromatic (a Perl developer) gives a very balanced answer in a sibling to my answer, so I won't repeat what he said.

Re: Learn Perl in about 2 hours 30 minutes

#16
Over the past week I've read "Modern Perl", and will finish it later today:

http://onyxneon.com/books/modern_perl/

The ebook/PDF edition is free! It's a great book for learning (modern) Perl basics if you're already familiar with programming concepts and another language like JavaScript (which is where I'm coming from).

Actually, I think the knowledge and best-practices gleaned from the book will help to make me a better programmer in a general sense (not just in terms of the Perl language). It's well written, a pleasure to read and I highly recommend it.

Re: Learn Perl in about 2 hours 30 minutes

#17
post #4

Would it be beneficial to know this alongside of Python, or is it more used instead of Python?

I personally found that I didn't need Perl at all. I am a bioinformatics programmer/scientist and Perl was the first language I learned. I find that whatever I can do in Perl I can do with bash/awk/sed--and whatever I can't do with bash/awk/sed I can do in Python. I've never been happier.

obviously in such a small (in terms of computing in general) discipline, a general purpose language might not be the best. Now if you want to publish your results to AWS and a website and pull data from a website front-end, etc. You can probably do it quickest with ducttape.

Re: Learn Perl in about 2 hours 30 minutes

#18
post #7

Wish there were similar ones for all the other languages - PHP / Python etc. I always thought that most programmers and web developers experienced in one language can quickly pick up the major features of another lanaguage, if there was a quick overview of this sort. Know of any sites that do this? Maybe this is a great opportunity for someone to put together a site like that?

Not just an overview but something where you pick the languages you know and it shows you side by side examples doing the same thing. I know there's a site that does that (can't remember the name) but having it side by side with a great overview like this would be awesome.

Perhaps you're thinking of PLEAC?

http://pleac.sourceforge.net/

Or perhaps Rosetta Code?

http://rosettacode.org/wiki/Main_Page

Re: Learn Perl in about 2 hours 30 minutes

#19
I do wish he had mentioned the smart match operator ~~ as it nearly eliminates the confusion between EQ and ==. Of course, if you're dealing with legacy code, then you still need to understand both (or all three), but new coders might be well advised to start with smart match.

Re: Learn Perl in about 2 hours 30 minutes

#20
post #4

Would it be beneficial to know this alongside of Python, or is it more used instead of Python?

I personally found that I didn't need Perl at all. I am a bioinformatics programmer/scientist and Perl was the first language I learned. I find that whatever I can do in Perl I can do with bash/awk/sed--and whatever I can't do with bash/awk/sed I can do in Python. I've never been happier.

Perl's advantage over bash/awk/sed is that you can test, organize, and maintain code more effectively. This may not matter if you are programming to solve tiny unrelated problems, but it's a waste of effort if you are doing similar things frequently.

Python is basically Perl but with different syntax, libraries, and community.

Post reply on HN