|
|
|
|
|
by troupo
960 days ago
|
|
> Labels are accidental. If all arguments automatically create labels then the programmer has not considered and deliberately designed the API. 1. Not every code is an API. And APIs exist in multiple languages that don't have labels 2. If you wanted named parameters, you could go the C# way: https://learn.microsoft.com/en-us/dotnet/csharp/programming-... 3. Since Gleam doesn't enforce labels or check labels in any way, it doesn't "make sure APIs are carefully thought out". Labels will be just as random and accidental as parameter names following the whims of the programmer who decides to use them > Renaming a variable becomes a breaking change. So does renaming a label. |
|
> So does renaming a label.
In languages without this feature, any renaming breaks the API, unlike the ones with distinct internal and external names. This is not the same.