Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Vignettes on language evolution: discovering an old syntax feature history (zverok.space)
3 points by todsacerdoti on July 1, 2024 | hide | past | favorite | 1 comment


I think non-trailing optional parameters are useful, especially in a statically typed language where you can't just shift the passed parameters around inside the body of the method without potentially messing up the types.

Several years ago, I wrote a proposal to support them in Dart:

https://github.com/munificent/ui-as-code/blob/master/in-prog...

It didn't get off the ground then for various reasons, but I hope we can revisit it at some point.

Of course, if the language has static types, it often has overloading too. In that case, you can often avoid the desire for this feature by using overloading instead. Dart is a bit unusual in that it's typed but doesn't support overloading.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: