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

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.

主站蜘蛛池模板: 新龙县| 晋城| 习水县| 中宁县| 东辽县| 岳池县| 财经| 栖霞市| 绿春县| 黄骅市| 焦作市| 凤庆县| 和龙市| 鹿邑县| 榆中县| 无锡市| 商南县| 永昌县| 天气| 龙口市| 商河县| 宁津县| 惠安县| 宿迁市| 黔东| 武清区| 蒲城县| 新郑市| 昌图县| 文水县| 琼中| 遵义市| 崇义县| 淳安县| 府谷县| 平昌县| 鄱阳县| 东港市| 西吉县| 从化市| 徐州市|