Re:First chapter of Kernighan and Donovan's new Go book [pdf]
by bkeroack on Monday October 19, 2015 @03:39PM
(#10415160)
Since 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.
Re:First chapter of Kernighan and Donovan's new Go book [pdf]
by TillE on Monday October 19, 2015 @04:52PM
(#10415652)
That'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.
Re:First chapter of Kernighan and Donovan's new Go book [pdf]
by jgalt212 on Monday October 19, 2015 @03:57PM
(#10415272)
true, forgot to think about that. But still potentially a lot of changes to fix, even if you are explicitly told what needs adjusting.
Re:First chapter of Kernighan and Donovan's new Go book [pdf]
by logic on Monday October 19, 2015 @05:03PM
(#10415728)
And this is where Go's tooling shines: https://golang.org/cmd/gofmt/
(Refactor automatically, not by hand.)
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.