官术网_书友最值得收藏!

Common criticisms about Go

There are a few criticisms that show up repeatedly in the community. Probably the most notorious and most-discussed criticism is the lack of generics. This leads to repeated code to handle different data types. Interfaces can be used to some extent to alleviate this problem. We might see generics in a future release, as the authors have shown openness to generics, but they did not rush through an important design decision.

The next criticism often heard is the lack of exceptions. The developer must explicitly handle or ignore each error. Personally, I found this to be a refreshing change. It's not really that much more work, and you have full control over the code flow. Sometimes with exceptions you are not positive where it will get caught as it bubbles up. With Go, you can easily follow the error-handling code.

Go has a garbage collector that handles memory cleanup. The garbage collector has been upgraded over time and continues to improve. The garbage collector does have a minor performance impact, but saves the developer a lot of thinking and worrying. Go was originally described as a systems programming language, and the lack of control over the memory was restrictive for very low-level applications. Since then, they have pivoted away from calling Go a systems programming language. If you need low-level control over memory, then you will have to write portions of code in C.

主站蜘蛛池模板: 如东县| 分宜县| 含山县| 灯塔市| 淳安县| 宜都市| 连州市| 洞头县| 奇台县| 志丹县| 松原市| 大石桥市| 郓城县| 公主岭市| 平山县| 个旧市| 府谷县| 那坡县| 宜丰县| 宿松县| 镇江市| 安新县| 克东县| 华池县| 临沂市| 宝鸡市| 桂阳县| 石楼县| 长岛县| 金昌市| 瑞安市| 河南省| 定西市| 阿克陶县| 宜春市| 邵东县| 格尔木市| 晋中市| 贵定县| 莒南县| 八宿县|