Hacker News new | ask | show | jobs
by jasode 3128 days ago
The terseness isn't the variable name, it's the notation of the type:

  @foo 
... is more compact than C#...

  ArrayList foo = new ArrayList();  // C# v2
  var foo = new ArrayList();  // C# v3
And Perl

  %foo
... is more compact than C++:

  auto foo = std:map<string>;
1 comments

But when you talk about Perl stagnating and losing out to other languages, the languages it lost out to were Python and Ruby, which don't require any type notation. It also lost out to PHP, which has sigils, but they don't carry as much information: $foo just means foo is a variable. Perl didn't lose out to C++ and C#; they were never really competing in the same domain.

In Perl, you write:

    my @list = (1, 2, 3);
Whereas in Perl's popular successors, Python and Ruby, you write:

    list = [1, 2, 3]
Saying the former lost out because the @ makes it unreadably terse is nonsense.
>Saying the former lost out because the @ makes it unreadably terse is nonsense.

Well, that's not what I claimed. I also wasn't really focused on "@%$" specifically but you had brought it up so went with it. (I get this weird feeling that I'm discussing with someone who's emotionally invested in Perl and he feels like I'm bashing Perl. Please let's us both stop this and make sure we're talking about Perl in a detached manner.)

Yes, strlen("my @list = (1, 2, 3)") is greater than strlen("list = [1, 2, 3]"). I wasn't talking about that. I was talking about things like strlen("@") < strlen("arraylist"). But... "C# doesn't compete with Perl!". Yes, that's true.

A realistic scenario where perceptions of "@" and "Arraylist" is compared would be a C# programmer working on an ASP.NET website or Javascript programmer working on Nodejs and then the company needs him to go fix an old website that was written in Perl ~15 years ago. The old Perl programmer left and C# programmer is stuck looking at Perl's "line noise". That irritated C# programmer then fills the Stackoverflow survey expressing his "dislike" of Perl. The C# and Javascript looked "readable" but Perl syntax such as "<>" looked like gibberish.

> I also wasn't really focused on "@%$" specifically but you had brought it up

My involvement in this conversation started with quoting you saying that one of the major reasons for Perl becoming disliked was "PERL's usage of sigils.[1] One the one hand, it makes code compact and terse". Perl's use of sigils has nothing to do with terseness, and since Perl lost its mindshare to Ruby and Python which to the tiny extent that sigils contribute to terseness/verbosity are more terse, I don't think that's a valid point about Perl's trajectory.

> I get this weird feeling that I'm discussing with someone who's emotionally invested in Perl and he feels like I'm bashing Perl.

I don't even know Perl, I'm just critiquing your logic.

> Perl syntax such as "<>"

'<' and '>' are not used as sigils in Perl.

>, I don't think that's a valid point about Perl's trajectory.

Again, the "Perl lost to Python/Ruby ... terseness" connection is your narrative, not mine. I feel you have my comments mixed up with someone else.

>'<' and '>' are not used as sigils in Perl.

I agree and I didn't say they were.

That's 3 cases of nitpicking something I actually didn't claim. I can only assume this over-interpretation of things I didn't write is a result of some underlying irritation that I caused. Let's just stop. Peace.

> Again, the "Perl lost to Python/Ruby ... terseness" connection is your narrative, not mine.

Well, if you just weren't considering Python and Ruby, then aren't they counter-examples to your point? They're terser than Perl in that regard; if that's a major reason people moved away from Perl, then why did so many of them move to those languages?

> I agree and I didn't say they were.

Then why did you bring them up in a discussion about sigils?

>They're terser than Perl in that regard;

Again, that wasn't the "regard" I was focused on. It wasn't strlen(Perl_syntax) to strlen(Python_syntax). It's not about counting characters. It was terseness of non-obvious meanings for symbols which reduced readability for many. Yes, "$foo=7" is literally 1 character longer than "foo=7" which seems to violate terseness. (This is the example you seem to always gravitate back to.) For the 2nd time, I'm stressing that I already agree with that definition. However, that wasn't what I was talking about. People unfamiliar with a language that happens to have "ArrayList" spelled out will see as not being as terse as "@". It's a different axis of terseness. This cognitive readability is orthogonal to whether people migrate to Python because it's 1 less character type in front of a variable name.

>Then why did you bring them up in a discussion about sigils?

I wasn't talking about sigils exclusively by that point. I was talking about overall readability and "line noise" to fill out the C# story.