top | item 46594667

(no title)

teach | 1 month ago

Perl was the first language I learned on my own after graduating university many years ago. I fell in love with it because of quirks like these and because code written in it can have a poetic quality you don't see often.

Now I am old and joyless and I want the code I write for work to be boring and unsurprising.

But sometimes one can still want to write poetry.

discuss

order

rcyeh|1 month ago

Agreed!

I learned Perl after trying C; and after struggling with `scanf` (not even getting to tokenization), the ease and speed of `while (<>) { @A = split;` for text-handling made it easy to fall in love. This (in the mid 90s, before Java, JavaScript, and C++ TR1) was also my first contact with associative arrays.

I was also drawn to the style of the Camel Book.

More than most other languages, Perl encouraged one-liners. When I later read PG's "Succinctness is power" essay, I thought of Perl.

https://paulgraham.com/power.html

quietbritishjim|1 month ago

> This (in the mid 90s, before Java, JavaScript, and C++ TR1) was also my first contact with associative arrays.

Associative array is just a fancy term for map / dictionary. C++ has always had one of those, even before TR1: std::map (which is a tree under the hood). It does have the extra requirement that your key be ordered, which isn't part of the core definition of associate array[1]. But usually it's not a problem even if you don't actually need the ordering.

As I think you're implying, TR1 / C++11 added std::unordered_map, which is a hash table and doesn't need keys to be ordered (just hashable).

[1] It isn't part of the core definition of "map" either, which despite C++'s usage just means the same thing as dictionary / associative array. A lot of those early STL containers are confusingly named: e.g., in general, "list" just means some ordered sequence of elements, so it covers static arrays, dynamic arrays, and linked lists, but C++ uses this term for linked lists, probably the least likely understood meaning. It use of the term "vector" for contiguous dynamic arrays is very odd. But I'm now way off topic...

jrockway|1 month ago

Perl was also my first productive language, and I do miss it a little. Write something like []string{"foo", "bar", "baz"} in go and you really appreciate qw(foo bar baz). Perl was always designed to be easy to type in, and maybe not so easy to maintain later. Good memories, but not for me anymore.

liveoneggs|1 month ago

All of the Quote and Quote-like Operators, and __DATA__, and so many other niceties..

wvenable|1 month ago

This isn't the first time I've said this but also had an early-career job writing Perl code. And I actually got to the point where I liked it -- I mean I could see why it had a following.

Subsequently I've written code in almost every popular programming language and I will frequently go years between languages but even so I have very little trouble picking them back up. Even C++. But not Perl. It's just so weird with so many idiosyncrasies that I just can't remember it.

ktpsns|1 month ago

I discovered Perl directly after PHP before Web 2.0 days. Compared with the extreme, Java or (contemporary) Go, Perl codes (can) have a soul. Interestingly, modern ECMAScript (JS) brought in a few of the nice breweties from Perl world which I haven't seen a long time.

pavel_lishin|1 month ago

I'm having to write a lot more perl at work than I would prefer to. It's still poetry, I suppose, but mostly of the bathroom-stall variety.

stouset|1 month ago

Ruby took the best parts of Perl and got rid of the worst. Give it a shot :)

teach|1 month ago

I actually switched to Ruby for this very reason and used it for a few years. I still have a soft spot for Ruby as well.

Unfortunately I had a different experience with the Ruby community, so I eventually switched to Python along with apparently everybody else.

publicdebates|1 month ago

Please show me an example of Perl that looks beautiful.

I don't believe you.

apercu|1 month ago

It might be a generational thing.

When I started out as a sysadmin it was all shell and glue and different syntax on the 8 different flavours of *NIX I worked on between '94 and '97, then I found Perl suddenly you could actually build things that felt "real". It took me straight into web application development by '98, and I'm not sure I would have stayed in this field had it not existed (I was also working in neuro-diagnostics at the time and might have stayed there).

I saw some really elegant stuff written in Perl.

I also saw some absolutely unhinged, impossible-to-maintain garbage.