3 ms·
you can't monkey-patch functions into external libraries like you can with Python modules You can add functions to existing types in Golang. no preemptive mul
by cmccabe 13y ago
you can't monkey-patch functions into external libraries like you can with Python modules
You can add functions to existing types in Golang.
no preemptive multitasking, so one goroutine can wedge the entire program
That's pretty misleading. If all you write is go code, you can't "wedge the entire program" in Golang just from one thread. You could wedge a native thread if you were using C methods. Assuming you don't want to fix your broken code, you can just set GOMAXPROCS to something high and work around even that.
passing around arrays and structs is by value, leading to unexpected allocation and memory usage
Most developers pass pointers. Pointers are not really that hard in Golang, because there is no pointer arithmetic or undefined behavior.
- ambrice 13y agoMethods for a type have to be declared in the same package as the type.
- wonderzombie 13y agoFortunately you can embed other people's types within your own type, thereby extending it.
- ambrice 13y agoSure. But that's not monkey patching, that's inheritance.
- Fistandantilus 13y agoI'd say it's closer to subtyping.