Unify differences between `multi` and `multi sub` #1189

Open
WildYorkies opened this Issue Feb 11, 2017 · 6 comments

Projects

None yet

6 participants

@WildYorkies
Contributor
WildYorkies commented Feb 11, 2017 edited

Some code is like:

multi sub hello($name) {say "hi $name"}

Other code is like:

multi hello($name) {say "hi $name"}

I'm not sure what is going on here, but this is something that should be decided upon. I think multi sub makes sense because you always clarify multi method in classes. And yet, I've never seen a proto sub. I've only seen proto by itself.

Thoughts?

@zoffixznet
Member

It defaults to sub, so you can omit it. In core, though, we always add it anyway. Makes it easier to grep 'sub blah' the source.

@Altai-man
Member

Judging by

> grep -I -r 'multi sub ' doc/ | wc -l
278
> grep -I -r 'multi [^sm]' doc/ | wc -l
50

plain multi case is less common. For the reasons of consistency we can edit such cases to full form. It is quite easy job too, if you have a good editor and some time on board.

@WildYorkies
Contributor

I think consistency in the docs is a worthwhile goal

@coke coke added the docs label Feb 11, 2017
@gfldex
Contributor
gfldex commented Feb 12, 2017

I do not agree. You don't learn how to deal with complexity by reading code that does it's best to hide it. If we prefer one style we should prefer the shorter version because lazyness is a programmers virtue.

@WildYorkies
Contributor

@gfldex Whether the docs show multi sub or just multi, I still think consistency should be the goal.

Programmers can learn complexity by reading real world code / books / tutorials. The docs should feel as if they're all written by one person, no? Hence unifying the comment styles, etc.

@awwaiid
Contributor
awwaiid commented Feb 12, 2017

So how about unifying on multi alone, only using multi sub long-hand when explaining that it is long-hand.

@WildYorkies WildYorkies added the meta label Feb 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment