3 ms·
> no default parameter values This would seriously bum me out as I find the easiest to extend the functionality of an existing Python function is to add a new
by jgalt212 11y ago
> no default parameter values
This would seriously bum me out as I find the easiest to extend the functionality of an existing Python function is to add a new parameter with a default value. This way, regardless of whether the existing code base the calls the new or old version of the function, it performs the same way as it always has.
- bkeroack 11y agoSince Go is statically-typed and compiled, it's much easier to refactor a function compared to Python. Change it and fix everywhere the compiler complains.
- jgalt212 11y agotrue, forgot to think about that. But still potentially a lot of changes to fix, even if you are explicitly told what needs adjusting.
- logic 11y agoAnd this is where Go's tooling shines: https://golang.org/cmd/gofmt/ https://golang.org/cmd/gofmt/ (Refactor automatically, not by hand.)
- TillE 11y agoThat's fine for internal functions, but a big problem when publishing any kind of interface. It's really nice to be able to extend an interface without breaking stuff or adding cruft.
- pconner 11y agoYou can use variadic arguments with an interface type or a single struct parameter to get similar behavior.