3 ms·
Like everything else, Perl has its warts - tacked on object orientation, crude way of handling errors, lack of a decent REPL, way too much expressiveness (I hav
by noisy_boy 3y ago
Like everything else, Perl has its warts - tacked on object orientation, crude way of handling errors, lack of a decent REPL, way too much expressiveness (I have seen what happens to a few hundred thousand lines of Perl code written by developers who, instead of writing in a maintainable consistent style, tried to show their cleverness and the language was a willing ally to that) etc. Many words have been spent on those shortcomings so I want to focus on the other side.
Many eons ago, I remember me (and my team) being so tired of writing bash wrapper scripts - we just didn't know any better. To my surprise/delight, I discovered that the Solaris boxes we were using came with Perl pre-installed (which in hindsight is totally expected). So I decided to learn about it the proper way and the Llama book was exactly what I needed.
People have called Perl code line noise. But when I read the book for the first time, everything make sense to me because my mind likes mnemonics. $ is for ($)calar, @ is @(rray), % has a pair of circles like key/value pair and so on. I didn't find it odd that you'll get the array in list context and count in scalar context - it made complete sense. Till date, Perl is the language which I reach out for short-term tasks which need to be done immediately, because it helps me get the job done at the speed of thought.
I picked up some bash scripts as candidates to be re-written in Perl and I will never forget my mind being blown by the sheer lightening speed of Perl scripts; stuff that took many seconds or even minutes in bash were done in a second or less, even with my unrefined code. It was like a new world opened up and indeed, I felt like a wizard.
- 7thaccount 3y agoI love the glyphs in APL, but not so much with Perl as they don't seem consistent. Like there is an "of that's an array, but you're accessing it with scalar context" or some catch. With Python, you have lists, tuples, and dictionaries. Those are data structure objects that are useful for different things. Tuples use (), lists use [], and dictionaries use {}. After you learn that, you just learn the few methods and manners to populate them and you're done. There's nothing wrong with either way of course. Both appeal to different kinds of folks.