Live data from Hacker News

We were wizards – a foreword to Learning Perl (1993)

jwgoerlich.com

31–40 of 130 posts

Re: We were wizards – a foreword to Learning Perl (1993)

#31
post #18
post #3

Earlier quoted context omitted.

Stream of consciousness programming?

I associate this with what we used to call "one-liner programming": I would write a single line of Perl code (in bash, prefixed with `perl -Mwarnings -MDebug -E' '`, convince myself the code did what we needed, and then share it around as a paste in irc / chat / whatever. It was amazing what you could achieve with the right modules, and Perl's flexibility allowed your mind to roam freely. Incidentally, the fact that…

About Python, are there practical situations outside IRC where you can't include a newline in there? This ..

  python -c '
  import re, sys
  for line in sys.stdin: print(line.lower().count("foo"))
  '
works in shell interactively (both bash and zsh support multiline history entries well), or in shell scripts, and also in slack/mattermost/matrix/email.

Re: We were wizards – a foreword to Learning Perl (1993)

#32
post #31
post #18

Earlier quoted context omitted.

I associate this with what we used to call "one-liner programming": I would write a single line of Perl code (in bash, prefixed with `perl -Mwarnings -MDebug -E' '`, convince myself the code did what we needed, and then share it around as a paste in irc / chat / whatever. It was amazing what you could achieve with the right modules, and Perl's flexibility allowed your mind to roam freely. Incidentally, the fact that…

About Python, are there practical situations outside IRC where you can't include a newline in there? This .. python -c ' import re, sys for line in sys.stdin: print(line.lower().count("foo")) ' works in shell interactively (both bash and zsh support multiline history entries well), or in shell scripts, and also in slack/mattermost/matrix/email.

You can do that as a one-liner (I have kept the unused “re” module import, to keep it as close to your code as possible):

  python -c 'import re, sys; print("\n".join(str(line.lower().count("foo")) for line in sys.stdin))'
or if you want to avoid building one large output string:

  python -c 'import re, sys; print(*(line.lower().count("foo") for line in sys.stdin), sep="\n")'
if memory consumption is still an issue:

  python -c 'import re, sys; set(print(line.lower().count("foo")) for line in sys.stdin)'
(This creates a useless Set object and throws it away as a side effect.)

Re: We were wizards – a foreword to Learning Perl (1993)

#33
I liked Perl for text parsing and that kind of work.. Used it professionally for about 3 years.

Two things i didn't like about it which i still don't

1. It's a conceptually huge language. There are several things to learn to be effective or you fall into the problem when the 10% that you use is different from the 10% that your teammates use. I found python attractive because of this.

2. I disliked Walls book. It was long winded and very hard to sit down with when I wanted to find something. I expected something like K&R but found it tedious and boring.

Re: We were wizards – a foreword to Learning Perl (1993)

#34
post #27

Yeah, while everyone still discussing on how to do FP in mainstream languages, Higher-Order Perl was published in 2005, placing many of such ideas how we were already doing that stuff in Perl into paper. Perl allows to come at peace with UNIX being done in C, by exposing similar programing language capabilities, mixed with Lisp like wizardy, without having to deal with C security faults unless required for performanc…

Higher Order Perl is such a gem, one of the best programming books in general.

Re: We were wizards – a foreword to Learning Perl (1993)

#35

Learning Perl is imho the best book for beginning to code. It is clear, as short as it can be, fun, explains why not just how, encourages efficiency, has exercises, etc. To this day I still recommend it even if opportunities to use Perl are gone.

There's a lot of really good Python books too (and I have a 5 foot stack of Perl books). I read one for Python in 2012 that finally got me into coding a lot. People overlook how the basic building blocks of Python are very simple. I learned Perl after Python and it's fine, but I often found Python to be a bit clearer and more obvious than Perl.

If I had to use a language just for Unix scripting, it would probably be Perl though.

Re: We were wizards – a foreword to Learning Perl (1993)

#36

Bashing Perl is now a meme, but I can never get over what could have been… Python 3000 and Perl 6 had the community all abuzz. CPAN was the amazing Wild West where people were sharing amazing libraries in such a simple way compared to how every other language was still using the likes of Source Forge and possibly even Fresh Meat (GitHub didn’t exist yet). Don’t fall into the meme trap of hating on Perl. Although it’s…

Bashing Perl is a meme precisely because of the mentality of the creators of Perl (who set the culture). This "Forward to Learning Perl" epitomizes the mentality: Imagery of wizards, alchemy, breaking all the stuffy rules that quashed creative thought, etc. He even says "bowing down at the Temple of Orthogonality" like orthogonality a bad thing! It hearkens back to the days when motor cars were curiosities that requi…

>I'm glad we've moved on towards becoming a serious engineering discipline

To quote the immortal Bender:

>> Oh wait, you're serious, let me laugh even harder.

Re: We were wizards – a foreword to Learning Perl (1993)

#37

I liked Perl for text parsing and that kind of work.. Used it professionally for about 3 years. Two things i didn't like about it which i still don't 1. It's a conceptually huge language. There are several things to learn to be effective or you fall into the problem when the 10% that you use is different from the 10% that your teammates use. I found python attractive because of this. 2. I disliked Walls book. It was…

regarding 2., are you sure you're referring to the Camel book and not the Llama book? To me, Programming Perl (Wall, Camel) is closer in spirit to K&R than Learning Perl (Schwartz, Llama)

Re: We were wizards – a foreword to Learning Perl (1993)

#38

The worry with any language dying is the loss of knowledge that accompanies its demise. CPAN has a lot of great libraries that once used to power the early internet. Decades ago, it was in a Perl group / forum that I first heard the term "do not re-invent the wheel" when someone enquired about making some kind of their own CGI framework along with a great write-up about all the unique edge cases that the existing lib…

Unfortunately, "do not reinvent the wheel" coupled with "there is more than one way to do it" leads to a proliferation of wheels that you pull in in any medium-to-large project.

There are many ways to have OOP? Moose, Mouse, Moo, MooseX::Declare, Class::Accessor — you are pretty much guaranteed to pull in them all and have them coexist in runtime. Now Corinna or whassname is coming in, but it has no users yet so it doesn't count. JSON? You're guaranteed to have both JSON::XS and CPanel::JSON::XS. The list just goes on and on. HTTP clients? You have Furl, LWP::UserAgent, something built atop IO::Socket. TLS with HTTP? LWP::UserAgent::SSL, IO::Socket::SSL, and someone will use Net::SSLeay raw just to watch the world burn. You pull in all of the latter ones courtesy of modules doing API integrations because their authors just have their favorites.

Web? Oh, you want to do web. Mojolicious, Dancer, CGI::Application, just CGI.pm... Granted, at least you won't have libraries pull those in willy-nilly, thank goodness.

Re: We were wizards – a foreword to Learning Perl (1993)

#39

Bashing Perl is now a meme, but I can never get over what could have been… Python 3000 and Perl 6 had the community all abuzz. CPAN was the amazing Wild West where people were sharing amazing libraries in such a simple way compared to how every other language was still using the likes of Source Forge and possibly even Fresh Meat (GitHub didn’t exist yet). Don’t fall into the meme trap of hating on Perl. Although it’s…

I'm bashing Perl because I'm using it daily today. I have the moral right.

People waxing poetic about their time using Perl back in the late 1990s/early 2000s don't have a vote because they clung onto good bits and have long forgotten the ugly.

> it really makes Stream-of-Conscious programming the norm

Are you sure it's a Good Thing? Really sure? What if you have teammates? What if you have a life? What if you need to revise your stream of consciousness after a year? Still sure?

Re: We were wizards – a foreword to Learning Perl (1993)

#40

Bashing Perl is now a meme, but I can never get over what could have been… Python 3000 and Perl 6 had the community all abuzz. CPAN was the amazing Wild West where people were sharing amazing libraries in such a simple way compared to how every other language was still using the likes of Source Forge and possibly even Fresh Meat (GitHub didn’t exist yet). Don’t fall into the meme trap of hating on Perl. Although it’s…

I'm bashing Perl because I'm using it daily today . I have the moral right. People waxing poetic about their time using Perl back in the late 1990s/early 2000s don't have a vote because they clung onto good bits and have long forgotten the ugly. > it really makes Stream-of-Conscious programming the norm Are you sure it's a Good Thing? Really sure? What if you have teammates? What if you have a life? What if you need…

I still use Perl, maybe not daily but yes to weekly, so I have still have skin in the game.

Yes I'm sure.

Post reply on HN