Go的劣势

huangapple go评论89阅读模式
英文:

Go's Disadvantage

问题

我已经学习Go一段时间了,发现它有很多好的特性(简洁清晰的语法,快速编译/执行,良好的并发支持,一等公民函数等)。但是很少有流行的项目是用Go开发的。

我只是想知道是什么主要缺点限制了Go成为主流语言?有人能提出一种明显不适合使用Go的程序/项目吗?

英文:

I've been learning Go for a while and found that it has a lot of good features (simple and clean syntax, fast compilation/execution, good support for concurrency, first class functions, etc). But very few popular projects are developed in Go.

I'm just wondering what are the main disadvantages that restricts Go from becoming a mainstream language? Can someone come up with a kind of program/project for which Go is obviously not suitable to be used?

答案1

得分: 10

Go只有3年历史。C语言已经有40多年历史了。C++已经有30多年了。Perl有25年历史。Ruby接近20年。Java是一个相对年轻的语言,有17年历史,而C#则相对年轻,有10年历史(或者12年,这取决于如何计算)。Java和C#在成为主导语言方面投入了大量资源,Sun和Microsoft投资了各种工具和库,并培训了人员。相比之下,3年几乎什么都不是。谷歌在Go开发人员上花了一些钱,但远远不及C#和Java的规模。而且3年对于使用Go编写和发布真正重要的产品来说并不多。

再给它几年时间。用Go编写一些代码。也许你的项目会成为下一个重要的项目。

至于它不适合的领域,它不适合需要非常成熟的语言和工具集的任何领域。如果你想要高级的重构IDE、大量现成的库以及许多教程和在线信息,你可能还找不到。我最后一次检查时,它的垃圾回收器有点弱;由于它是一种保守的收集器,可能会因为将整数误认为指针而导致内存泄漏。这个问题可能已经修复了,但这表明了Go实现的相对不成熟;在其他语言中可能已经解决了某些问题(或者有已知的解决方案),而在Go中仍然存在一些问题。

英文:

Go is only 3 years old. C is more than 40 years old. C++ more than 30. Perl 25. Ruby almost 20. Java is a relatively young language at 17, and C# quite young at 10 (or 12, depending on how you count it). And Java and C# had a lot of resources thrown at making them dominant, with Sun and Microsoft investing in all kinds of tools and libraries and getting people trained in them. Compared to that, 3 years is almost nothing. Google spends some money on developers for Go, but at nowhere near the scale of C# and Java. And 3 years isn't a lot of time for really prominent products to be written and released in Go.

Give it a few years. Write some code in Go. Maybe yours will become the next prominent project.

As far as what it's not suited for, it's not suited for anything that requires a really mature language and toolset. If you want fancy refactoring IDEs, tons of off the shelf libraries, and lots of tutorials and information online, you probably won't find that yet. The last I checked, its garbage collector was a little weak; it's possible to get leaks due to mistaking integers for pointers, since it's a conservative collector. This could be fixed by now, but its indicative of the relative immaturity of the Go implementation; there are certain things that may be solved problems in other languages (or have well-known workaround patterns), which are still a bit up in the air for Go.

huangapple
  • 本文由 发表于 2012年11月14日 09:36:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/13371811.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定