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

  • 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.

主站蜘蛛池模板: 莎车县| 衡阳市| 阜新市| 靖远县| 福海县| 江川县| 邯郸县| 和林格尔县| 黎平县| 报价| 长白| 项城市| 长春市| 弥渡县| 武汉市| 利辛县| 米脂县| 武陟县| 谢通门县| 庆安县| 黎平县| 萨迦县| 陈巴尔虎旗| 商城县| 福建省| 五指山市| 财经| 邯郸县| 左云县| 永济市| 五寨县| 中宁县| 麦盖提县| 读书| 贵州省| 汶川县| 渑池县| 铜鼓县| 齐河县| 万荣县| 八宿县|