Named parameters for code readability


(Anatoli Babenia) #1

I wish that instead of app.SetRoot(list, true) I could read app.SetRoot(list, fullscreen=true) to avoid switching to documentation and back every time I read new code. Why Go doesn’t support calls with named parameters?

I miss that from Python.

>>> def a(n):
...   print(n)
... 
>>> a(3)
3
>>> a(n=3)
3

(Norbert Melzer) #2

My assumption is, to keep the languages grammar simple and unambigous.

Can’t tell you the official reason though.