HaxeManual
HaxeManual copied to clipboard
Optional arguments vs default values
I find the pages on optional arguments and default values a bit confusing. They fail to mention that optional arguments are just syntactic sugar for a default value of null / that ?param:SomeType is the same as param:Null<SomeType> = null. To somebody that doesn't know that, it can read like optional arguments and default values are entirely different things.
https://github.com/HaxeFoundation/haxe/issues/7378#issuecomment-418139433