News for hackers. Stuff that matters.
Re:Types Are Moving to the Right by karlakush on Saturday March 16, 2019 @04:52PM (#19410224)
I'm not convinced. The article found one situation where it makes more sense for the type to be on the right, but in most situations it makes more sense for the type to be on the left. The reason being that it reads more naturally. It's the difference between saying "Golfer Tiger Woods adopted a cat" and "Tiger Woods, golfer, adopted a cat." Nobody speaks the latter.
Re:Types Are Moving to the Right by int_19h on Saturday March 16, 2019 @07:27PM (#19411082)
It stops reading naturally as soon as you get composable type constructors, and people start actively using them. Even in English, once there's enough qualifiers, we move it to the right - e.g. "Tiger Woods, a famous but controversial golfer, adopted a cat".
Re:Types Are Moving to the Right by JadeNB on Wednesday March 20, 2019 @01:08PM (#19444276)
> "Tiger Woods, a famous but controversial golfer, adopted a cat".

"Famous but controversial golfer Tiger Woods adopted a cat" might be awkward, but it's hard for me to buy an argument that it's either unnatural or even particularly hard to understand.

Re:Types Are Moving to the Right by coldtea on Saturday March 16, 2019 @07:13PM (#19411017)
>but in most situations it makes more sense for the type to be on the left. The reason being that it reads more naturally

Not really. And the Tiger Woods example is a whole phrase with a verb and an noun (describing what he did to whom), so not representative of a type declaration (which is just just describing what thing something of a specific name is).

So, it's more like:

  Tiger Woods: a golfer.
vs:

  A golfer: Tiger Woods.
Which of course is an argument for types on the right -- the first reads much better.
Re:Types Are Moving to the Right by Mirioron on Sunday March 17, 2019 @03:33AM (#19412744)
In my opinion the second reads better, because if you have multiple declarations (multiple rows) then they will all line up:

  Tiger Woods: a golfer.
  Jon Rahm: a golfer.
  Bryson DeChambeau: a golfer.
vs

  A golfer: Tiger Woods.
  A golfer: Jon Rahm.
  A golfer: Bryson DeChambeau.
This makes it easier to group up information when glancing at the code.
Re:Types Are Moving to the Right by makapuf on Sunday March 17, 2019 @07:16AM (#19413423)
I don't understand the alignment argument. You can insert spaces (or your editor ) and align types on the right if needed.
Re:Types Are Moving to the Right by Mirioron on Sunday March 17, 2019 @10:44AM (#19414263)
So, will you go back and beautify code? When will you insert them? If there are 3 lines like that? 4? 5?

It leaves so many questions that will have to be solved through "best practices" and everyone ends up doing it slightly differently.

Re:Types Are Moving to the Right by coldtea on Sunday March 17, 2019 @10:27AM (#19414168)
That's what TAB is for.
Re:Types Are Moving to the Right by andolanra on Saturday March 16, 2019 @05:58PM (#19410577)
'Naturally' is almost always a red herring in programming language design, because what is 'natural' tends to be 'whatever I was previously familiar with'. There are a lot of unstated assumptions here:

· That what's best for natural language is also the best for programming languages. This is still a debated topic, but my personal feeling is that the two are different enough in both mechanism and purpose that what's good for one isn't necessarily good for the other. (For an illustrative example, look at how sigils worked in Perl 5, as they were explicitly designed to work like English demonstrative words like "that" or "these", and many programmers when first exposured to Perl feel like they were 'illogical'. They weren't, but in this case, mirroring a natural-language convention tended to obscure, rather than clarify, what was going on in the language!)

· That phrase ordering in English is necessarily 'natural'. Lots of naturally-occurring spoken languages feature word order that differs tremendously from English!

· That the English-language phrase you're describing as 'unnatural' is in fact unnatural: it's actually a common convention, especially when you're introducing a new fact to a conversation! "Tiger Woods, a famous golfer, adopted a cat."