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

  • Security with Go
  • John Daniel Leon
  • 238字
  • 2021-06-30 19:06:39

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.

主站蜘蛛池模板: 二连浩特市| 德阳市| 滁州市| 从化市| 乌兰浩特市| 黄平县| 冀州市| 庆阳市| 岱山县| 蓬溪县| 盘山县| 金湖县| 桐城市| 绵竹市| 揭西县| 鹤庆县| 台北县| 鄂温| 建昌县| 阿拉善右旗| 平南县| 巧家县| 河南省| 邮箱| 鄂伦春自治旗| 瑞金市| 三门县| 大悟县| 西丰县| 巨鹿县| 乌拉特后旗| 天津市| 万州区| 利辛县| 阿合奇县| 恩施市| 温泉县| 尚志市| 宾阳县| 巴里| 威信县|