| ▲ | tasty_freeze an hour ago |
| It isn't bad language design that you need to study the language before you can use it. I look at haskell programs and it looks mysterious to me because I haven't spent any time studying it, but I'd not thing to say it is bad language design. Yes, one can write obscure perl code and some love perl golfing. In the same way there is an IOCCC which delights in unreadable code, it doesn't mean that the C language should be relegated to the dustbin. The answer is to write readable code, no matter which language is in use. |
|
| ▲ | pavel_lishin an hour ago | parent | next [-] |
| But I can look at most Python code and be able to understand what it does. With perl, I have to look up so much. - Why is there a `1;` on a single line in the middle of this file? - What is `$_`? - This parallel execution manager doesn't actually seem to define what code needs to run in parallel in any specific way, how does this work? - What is this BEGIN block at the start of this Perl file? Why is that necessary? - What's going on with qx, qw, qq? - What does chomp do when it's just on its own line, with no arguments given to it? |
| |
| ▲ | tasty_freeze 21 minutes ago | parent | next [-] | | Again: python syntax is more akin to what you are used to, and so it feels more comfortable to you. $_ is inscrutable if you haven't studied perl, but the same thing would happen to anyone who sees a python decorator for the first time. what does "else: do after a while loop in python? Only people who know python know what it does (and I suspect most don't). The different quoting operators are also trivial to learn. In comparison, yield from python is also simple syntax but the semantics are much more involved. BEGIN? Take 60 seconds to read what it means. And if you knew awk, you'd not have to do that, as it was directly lifted from awk. | |
| ▲ | EgregiousCube 5 minutes ago | parent | prev | next [-] | | Honestly, $_ and "what does a function do when I don't supply any arguments?" are really nice in Perl, and not that difficult to understand. I think a lot of languages could use a 'default variable'. | |
| ▲ | montroser 18 minutes ago | parent | prev [-] | | Yeah, it's true that Perl did not have as a design goal that a complete newcomer should be able to intuitively understand the code without having any prior exposure to the language. There is a little bit of a learning curve, and that was completely expected by Perl's creators. Yes, you have to learn about the idioms above, but they became second-nature. For many of us, the model clicked in our heads and the terseness was worth it. You could express a lot of functionality in very few characters, and if you had invested in learning, it was very quick to grok because common patterns were reduced to familiar abstractions in the language. And yet, as the industry grew and all sorts of people from all sorts of backgrounds converged in this space, the tolerance and appetite for funky/terse waned in favor of explicit/verbose/accessible. It's probably for the better in the end, but it did feel a little bit like the mom-and-pop store on the corner that had weird pickled things at the register and a meemaw in the back got replaced by a generic Circle K with a lesser soul. |
|
|
| ▲ | harpiaharpyja an hour ago | parent | prev [-] |
| Seems like the essential criteria is not whether you can write opaque code in it, but rather whether the language enables you to accomplish most tasks using clear, readable code. They aren't mutually exclusive. Hopefully I am paraphrasing you correctly. |