4 ms·
> would it be much easier for Java programmers to move to Go compared to C programmers? Don't know about "very", but there would be very little difficulty movi
by masklinn 11y ago
> would it be much easier for Java programmers to move to Go compared to C programmers?
Don't know about "very", but there would be very little difficulty moving from java to go. There wouldn't be that much value to it though (startup speed and deployment would be the primary ones, and if those are your concern chances are you're not using java as it's notoriously not great at those).
> And, what about python programmers, how would Go be for them?
That seems to be the primary actual market, migrations from python, ruby, php and the like: Go provides a bit of type safety and easy concurrency, an easy deployment story, structural typing is closer to duck-typing than nominal typing (where interfaces must be explicitly opted into by objects) and the fast compilation time means the compilation step isn't much of an issue over "direct" interpretation (/implicit compilation).
- aaggarwal 11y agoThis is helpful. Thanks! I have one more question, how does Go ensure easy concurrency?
- Blackthorn 11y agoAssuming that's an honest question: it has actual lightweight threads, so you don't need to muck around with either async garbage or worrying that you're using too many threads because you aren't mucking around with async garbage.
- aaggarwal 11y agoYeah,I was reading about the http module and goroutines. It looks nice. Though I still have to try it.
- masklinn 11y agoIt provides built-in lightweight thread abstraction ("goroutines", and "channels" for communication between these). Beware though, Go uses shared-memory concurrency (as opposed to, say, Erlang) so if you pass a pointer to a mutable structure through a channel the structure won't be copied or moved, both sides will be able to alter it. It does provide a data race detector but it's just that, you have to hit the corruption path while running the detector for it to have a chance, I'm not sure it's 100% even if you do, and I understand it has a non-trivial runtime cost and limitations wrt number of routines it can track.
- aaggarwal 11y agoThanks for informing, that is an important point to keep in mind, ignoring this would lead to potential bugs and very difficult debugging as you said.