There is a full blog article with the answer to this question :)
https://blog.golang.org/gos-declaration-syntax
It's so good, that I actually use it as a reference to people asking me
about C's declaration syntax.

On Thu, Sep 20, 2018 at 8:03 AM Tristan Colgate <tcolg...@gmail.com> wrote:

> But every aspect of that still reads unambiguously in a left to right
> order. Actually understanding C declarations can be extremely challenging.
>
> On Thu, 20 Sep 2018, 06:47 Sathish VJ, <sathis...@gmail.com> wrote:
>
>> So, you are saying it is only for readability?
>>
>> But even in go we can write convoluted functions like:
>> func f(func(*int, *string) *int, []*byte) (func(*int, *float32), error)
>>
>>
>> On Thursday, 20 September 2018 11:09:23 UTC+5:30, kortschak wrote:
>>>
>>> To avoid having to have something like this:
>>>
>>> http://c-faq.com/decl/spiral.anderson.html
>>>
>>> On Wed, 2018-09-19 at 22:30 -0700, Sathish VJ wrote:
>>> > I've been asked this question a few times and I haven't been able to
>>> > find
>>> > an answer.  Why does go reverse the order of variable
>>> > declaration:  "i int"
>>> > vs "int i"
>>> >
>>> > Is there anything in the language design that requires this or was it
>>> > based
>>> > on readability/writability or related to the parsing process or
>>> > something
>>> > else?
>>> >
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to golang-nuts+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to