3 ms·
I love go, but I think it is a straight up dangerous language. I believe this because: - The tiny standard library and low learning curve make it quite easy to
by dm03514 6y ago
I love go, but I think it is a straight up dangerous language. I believe this because:
- The tiny standard library and low learning curve make it quite easy to get started.
- Concurrency is a first class citizen, through goroutines and channels
- The performance, combined with the low barrier to entry, combined with its popularity make it very desirable for companies
In my experiences this means a lot of companies without deep concurrent programming experience begin to adopt it. In my experiences this means concurrent programming errors....literally EVERYWHERE. I've seen (and created these of course) in every company I've been at and in huge open source go projects.
I wish go would address this through first class tooling or type supported in the language like rust.
I have a hueristic based approach that I've had success with when writing and reviewing code, but writing a static analysis tool for it is a bit out of my experience:
https://medium.com/dm03514-tech-blog/golang-candidates-and-contexts-a-heuristic-approach-to-race-condition-detection-e2b230e70d08 https://medium.com/dm03514-tech-blog/golang-candidates-and-c...
- candiddevmike 6y agoCan you expand on the types of errors you're seeing? Go has a fairly powerful race detector you can run as part of your test suite that seems to catch everything I've thrown at it.
- dm03514 6y agoMe too! I generally think that the race detector is the best approach right now. At a prior job we had a lot of code that wasn't structured in a way that made it easy to exercise using the race detector. This was combined with misunderstanding about what the race detector did and didn't do. For example there was one team that ran `-race` on non-concurrent code, and expected it to verify race conditions.