5 ms·
I think perl invites a kind of mindset from how the language is and how the initial community was. Why does it have something called 'say' instead of something
by nf05papsjfVbc 9y ago
I think perl invites a kind of mindset from how the language is and how the initial community was.
Why does it have something called 'say' instead of something more intuitive like 'println'. Then there are worse examples: carp, cluck, croak. These are commonly used. They are from the same module of course. There is also Moo, Moose. I'm not sure but was there something called 'Mo' too? Commonly used of course but as you can see from the names - you can't tell what they are for.
So, I think from some of the choices made in how the language is, it ended up being more drawn towards unreadability than readability by attracting a kind of mindset that wanted it to be 'fun' in a way that only a clique could relate to and now if the language doesn't have broad appeal, I think it shouldn't be that hard for them to accept that fact.
- perigrin 9y agoI'm biased, I've release bits for Moose but ... Django, React, Rails, Spring, : can you tell what they are used for from the names? Does this mean that Python, Javascript, Ruby, and Java are "drawn towards unreadability than readability by attracting a kind of mindset that wanted [them] to be more 'fun'"? In fact Moose, Catalyst, Starman, etc were all projects specifically named more fun _becasue_ their authors saw other communities not naming things "DBIx::Class" or "ExtUtils::MakeMaker" and wanted to bring some of that fun to Perl.
- chromatic 9y agoWhy does it have something called 'say' instead of something more intuitive like 'println'. Why is the Unix command `ls` not `list-directory-contents`? Sure, it's a lot more for everyone to type all the time, but you could get rid of a single line in the man page, meaning the name is much, much more intuitive!
- yellowapple 9y ago"Why does it have something called 'say' instead of something more intuitive like 'println'." 'say' is a lot more intuitive than 'println' for me. In the former case, I'm telling my program to say something. In the latter case, I'm telling it to... print? What if I don't have a printer? And what's a 'ln'? Line? Loan? Loon? In other words, 'println' is not "intuitive". The word you're looking for is "conventional" or "familiar", and it's only either or both of those things if the programmer is coming from a different language. Perl was the first programming language that really "clicked" for me, though, so I'm probably a bit biased there. (as a side note, Perl has a 'print' as well, which actually predates 'say' by a considerable amount ('say' only became a thing in, what, Perl 5.10?). 'say' is pretty much just 'sub say { print "$_[0]\n"; }'.) "Then there are worse examples: carp, cluck, croak." 'carp' and 'cluck' are weird, yeah. 'croak', however, makes sense in the context of 'die'. "There is also Moo, Moose." Both of which feature the letters "oo", which usually stands for "object-oriented". Not as obvious as I'd personally like, but once you spot that it becomes clear that both have at least something to do with Perl5's object system.
- cutler 9y ago... which is basically just blessed hashes.
- yellowapple 9y agoBlessed anything, really. One could bless a scalar or array if one so chooses (not that I would recommend doing so, but whatever). But yeah. Perl 5's flavor of object-orientation is remarkable for exposing the inner workings of objects to the programmer. Fields are just hash table items. Methods are just subs that take the object as the first parameter. Classes are just namespaces/modules full of methods and constructors. Constructors are just ordinary subs that return blessed data structures. It's all remarkably simple and elegant once you're used to it.
- dragonwriter 9y ago> Why does it have something called 'say' instead of something more intuitive like 'println'. "Say" is a common English verb that fairly directly communicates the action performed (with a bit of metaphor, sure.) "Println" is, well it starts out with something which might be as good as "say" and then has some extra opaque consonants glued on the end. The latter is only "more intuitive" from the perspective of someone whose used languages which happen to use it in the past.
- throwaway7645 9y agoExactly. "Print" originally made me think of an ink printer. "Say" makes alright sense. Strangest I've seen is the basic language PBASIC's "debug" statement for the BASIC STAMP controller.
- vram22 9y ago>Why does it have something called 'say' instead of something more intuitive like 'println'. Then there are worse examples: carp, cluck, croak. These are commonly used. They are from the same module of course. There is also Moo, Moose. I'm not sure but was there something called 'Mo' too? Commonly used of course but as you can see from the names - you can't tell what they are for. I'm not a Perl expert, but have read books on it and done a bit with it. I think Perl tends to attract the kind of people who find these kinds of names (and many other things) fun, and are not put off by it - which is fine. >worse examples According to who(m)? Opinions differ.
- nf05papsjfVbc 9y agoEDIT: Please, before you get fixated on 'say', consider that perl already has 'print'. So, it has "print" and "say" - where "print" is "print" and "say" is "println".