> I was really excited when Perl 5 came out, but ugh. I wound up writing about 10,000 lines of it at a dotcom, and it was so, so ugly. All the stuff that made 50 line Perl 4 beautiful made 10,000 line Perl 5 an unreadable mess.
I find that Perl gets a bad rap for being "unreadable". In my experience the readability of Perl is the direct result of the discipline of the person writing it. It's not hard to write readable, maintainable Perl 5, but it's _easy_ to write _crap_ Perl 5. So, you have to be disciplined in how you create things.
Beauty is in the eye of the beholder. I won't bore you with the details, but rest assured that there are many others like me, who appreciate Perl 5 both for its aesthetics, and are able to use the technical consequences of said aesthetics for productivity.
> It just happened that the Perl community went off the deep end and decided that tiny unreadable code was better than big readable code.
That's one way to look at it. The other is that they embedded more syntax which makes the learning curve longer, but yields more more efficient writing and reading of code once you've fully internalized that syntax. The big mistake, IMO, was that they also made the language easily usable to get something done before you've fully internalized those rules, which leads to subtly wrong or weird programs that just work most of the time.
Perl is fundamentally different than most languages in how it uses context, but you can get away with not really understanding that at all by just learning a few rules-of-thumb. This, predictably, results in frustration in the writer, as they run up against what look like rough edges and weird idiosyncrasies in the language but are often just places where they've never actually learned how Perl really works.
That's not to say Perl doesn't have actual rough points and problems (what language doesn't after almost 30 years?), but contrary to popular belief, Perl is actually highly designed, and usually conforms to a few core principles (even it those principles are not what many other languages emphasize).
I've been diving into some of our legacy Perl and man, the learning curve of the various sigils and implicit variables. Even working with collections was challenging.
I'm working to make it better Perl (I have a copy of Modern Perl on my desk), but that's solely to make it understandable so that we can rewrite it / replace it with something like Salt.
A lot of Perl can be readable. But sometimes you get a backend where someone with , let's say, a "unique" view of software development writes a huge monolithic monstrosity by creating their own ORM and object model with almost zero documentation in or out of the code and hoo boy, that is not going to be a fun time 10 years later when basically nothing has changed because no-one has the time or energy to parse out what they've "crafted".
> However, most people have dismissed it because they think Perl 5 is dead and anything using Perl should be replaced with Python or Ruby or Go or Rust or some other language.
I didn't dismiss it for that reason. I wanted to like Perl 6, but dismissed it because last time I tried learning it:
* it seemed to include too much syntax
* too much lingo required to understand core concepts
* no coherently-written definitive tutorial. No Camel book for that matte.
* most examples seem to be written with maximum quirky-ness to show off the acrobatics you can do. I just want to get work done.
> You'd come back from lunch and need to pull out a notepad and start diagramming to understand the code you are written an hour earlier.
I think this says more about your skill level in programming Perl or programming in general at that time than it does about Perl. Or at least the influences that you learned Perl from.
It's possible to write nearly unreadable code in any language. It's easier to do so in Perl, since it's pretty freeform. It's also not that hard to write very clear code. But you're complaining about your own code. I think perhaps blaming the tool at that point is looking in the wrong place.
>>without even understanding why Perl is hard to read in the first place.
You are talking about Bunce there.. he is smart (and pedagogically talented) enough to know what he is talking about, more than amateurs like us. :-)
>> Which is what life is like when you are surrounded by perl code and are not a perl expert.
Hmmm... you wrote "using perl longer than any other major language except C"? At the end, you wrote that you mostly read code... you're not really a full time programmer, but browse code for different languages?
Again -- you're out of luck with most "real" environments, since you need the libraries.
TCL is really optimized to be trivially easy...
>> You can't use parameter lists in perl. You can't use variables without context.
There are misfeatures in all languages. Without checking, you can find solutions for most every Perl problem on CPAN.
If you go there, check Moose. Also check Enlightened Perl/Modern Perl on the web.
If you are only going to read without writing, then you will probably not start enjoying Perl. If you use it for real, it is fun and has a really good community.
Most of '::', '->' etc exist in other languages. I already discussed that.
For another example, Python's ability to keep {} for one thing really kneecaps the possibility to do one-liners with the same syntax... :-)
> I'm not really understanding the lack of love for Perl 6 unless it's from folks that have invested careers in Perl 5 and are miffed by the compatibility story.
I think far more likely is the people that have decided to dislike "Perl" are letting their prejudice leak.
Perl 5 is one of those languages that is hides complexity, partially by accident. I'm sure a lot of people have looked at Perl and been unable to figure out what's going on, and why the same function returns different values sometimes when called with the same arguments[1], and not known what to make of it because many things work exactly as expected, especially for people familiar with C. This can be confusing to people that thought they were getting a handle on the language. The conclusion then is either they are failing to understand the language, or the language sucks. I imagine one choice is easier on the ego than the other.
1: Context. People skimp on the reading or targeted learning and context bites them in the ass, even if it's fairly simple once known.
>I associate Perl with inscrutable cat-walked-on-the-keyboard programs and little else.
That's because Perl had a lot of "convenient" shorthand and quirks in the language that could be abused, leading to unreadable, "cat-walked-on-keyboard" code. However, that is just a stereotype. One could also force Perl to straighten its posture with a strict pragma, making much of the eccentricity disappear. I have worked on several large Perl 5 codebases that were/are clean and easy to understand and maintain.
> And if you stray into the "clever" subset of Perl, frankly it becomes hell
Yeah, this is the thing... it's very very easy to go down a one-way street to an endless hell of incomprehensible line-noise code and "clever" tricks that are incomprehensible and unmaintainable.
On the plus side, having dealt with the hell of "clever" perl early in my career (and, ahem, maybe having been guilty of writing some), it has beaten into me the absolute necessity of writing the simplest, clearest, not-clever code possible. In some other language.
> And, by the way, Perl 5 has grown enormously in the past 10 years. I would say that if you haven't taken a look in a while, give it another shake.
this. I can hack a bit in Perl 5, but "modern Perl" is virtually a unique language that just so happens to be written using the same words I use. I haven't had a chance to really learn modern practices, I keep telling myself I'm going to sit down and do it, but I haven't had a chance. But what I've seen is really pretty different than what I grew up with.
That would be mostly Python these days. If someone here would touch Perl on my systems, they're gonna have a very bad day. Sure I wrote stuff in Perl back in the days, but those days are over.
I see this as Perl's problem: to be good enough at Perl, you'd have to frequently use it, but Perl is in my eyes only suitable for quick hacky run-once scripts - which should not be written frequently, so you shouldn't be good at Perl. My Perl is pretty damn rusty these days.
If someone is still writing large scripts/apps in Perl these days, I question their judgement in technologies and ability to keep up with the times. Sure you can write larger scripts in Perl - but what's the point? You have to take care not to make things unreadable, while when using something like Python, it's much harder to make a script that's unreadable.
> Imo, the reason perl failed was not because the syntax was obscure but because even once you learned the syntax, it was still hard to read perl code.
IMO, the reason Perl failed is that Perl 6 (which is a fairly awesome language in its own right) sucked up all the energy in moving Perl forward for too long and delivered too late, while competing languages kept providing usable progress (and avoided, as a consequence, looking dead, which may be as important as the actual usable progress itself.)
> It's early prioritization of text manipulation makes it not great at general purpose programming.
Exactly, and that's where I went wrong the first time I looked at Perl. You can tell the language was designed by someone that knew a lot about text manipulation. That means it's really good at solving those problems. Unfortunately I wasn't using it for text manipulation at that time.
> * the culture of Perl is what makes me believe that it will never be a viable choice over other dynamic, interpreted languages.*
What's wrong with Perl culture? Perl as a language and as an implementation has many weaknesses (esp. maintainability), but I've never seen any reasonable criticism of its culture as a whole. Only very recently have I noticed a somewhat annoying trend towards evangelism, I attribute this to the loss of interest in the language with the exception of somewhat fanatic users. But most current users are probably still grumpy old men like me who just want to get work done without rewriting large legacy code bases from scratch.
I would say hate is a strong word but I have 2 issues with Perl:
1) Regex choices made
2) Readability, if someone wrote something in Perl I normally would rewrite it if it took me less time then figuring out what they wrote and wasn't working as expected. Maybe it was just my poor skills but man Perl can be hard to tell what is actually going on.
>>Is Perl 6 is more consistent(for lack of a better word) language ?
Not the right way of looking at it.
Perl 6 doesn't continue from Perl 5. Its more like a total redesign. Some even say, they are so different Perl 6 isn't even Perl(5) anymore- only common things being sigils, core philosophy and the author.
I can't obviously write a complete synopsis of Perl 6 in a comment. But its like what Perl 5 would look after 20-30 years in development + Lisp powers in C syntax.
I find that Perl gets a bad rap for being "unreadable". In my experience the readability of Perl is the direct result of the discipline of the person writing it. It's not hard to write readable, maintainable Perl 5, but it's _easy_ to write _crap_ Perl 5. So, you have to be disciplined in how you create things.
reply