4 ms·
There's nothing standard about perl (parameter passing via lists, DIY OO, references in a scripting language, and there has to be more that I don't remember any
by htns 10y ago
There's nothing standard about perl (parameter passing via lists, DIY OO, references in a scripting language, and there has to be more that I don't remember anymore - IMO these are the true reasons perl lost its popularity while ruby and python remain lively), nor is perl compact compared to other scripting languages. The parameter passing stuff especially made perl a verbose language.
- falcolas 10y ago> IMO these are the true reasons perl lost its popularity while ruby and python remain lively As a perl cum python developer, no. It's that I had to spend time reverse engineering the code I wrote last week, because of the hundreds of obscure symbols I cleverly used to reduce thirty lines of clear code to five lines of compact code. Python and Ruby both have to deal with references (though much more indirectly via the concept of mutable objects), as well as arguments coming in as parameter lists (and dicts).
- htns 10y agoSo what in perl made it conductive to that kind of coding? I never worked with perl much but back then I got the impression perl being line-nose or whatever was more legend than reality. Perl's not a different paradigm like APL. And by references I meant exactly that perl is not pass by reference, unlike just about any other scripting language. R is the only other popular one I can think of that's not. There's shell too but it doesn't count.
- Smaug123 10y agoPython's not pass-by-reference either!
- falcolas 10y ago> So what in perl made it conductive to that kind of coding? "Because I could" More specifically, in very short programs, the shortcut values were actually valuable, and the mental overhead for interpreting them in short subroutines or programs was minimal. The problem is that programs don't stay static, and that single time-saving shortcut becomes two, then four, then eight, then... Soon, it's an absolute mess. Even once I realized the cost, I had to follow the coding conventions of those who had come before, at the cost of increasing the cognitive overhead even further. A self-reinforcing loop. > not pass by reference, unlike just about any other scripting language As Smaug says, Python is pass by value. The trick is that the value is always a reference to an object, or more specifically “pass-by-object-reference” (“Object references are passed by value."). This causes a few subtle behavioral inconsistencies, such as the dreaded `def a(b=[]):` bug.
- htns 10y agoI'm way late to reply, but I never really understood what would qualify as pass by reference according to that logic :D you do have to pass a value eventually, it can't be references all the way