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

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.

主站蜘蛛池模板: 拉萨市| 祁门县| 安泽县| 临夏市| 成安县| 托克逊县| 平昌县| 新和县| 务川| 临汾市| 凤台县| 扶余县| 布尔津县| 乡城县| 沾化县| 泰州市| 乌拉特中旗| 丘北县| 潞西市| 平南县| 双鸭山市| 辽阳县| 景泰县| 广东省| 绥化市| 繁峙县| 铅山县| 灵台县| 黎川县| 遂宁市| 容城县| 高青县| 延吉市| 化州市| 怀远县| 武平县| 黎川县| 砀山县| 寿光市| 黄石市| 永兴县|