18 ms·
From the release notes, arguably the best feature: "There are no substantive changes to the language." Seriously, Go is not a perfect language, but I have come
by sjellis 9y ago
From the release notes, arguably the best feature: "There are no substantive changes to the language."
Seriously, Go is not a perfect language, but I have come to really appreciate the stance that the Go team have taken on stability. Looking forward to Go 2, but very happy to keep on with Go 1.
- issaria 9y agoYeah, good luck getting generics.
- golergka 9y agoI don't know why you're downvoted. Generics is a feature that's holding back a lot of developers dealing with complicated business logic (and need for abstraction) from moving to Go. And at the same time, including generics into the language means that all libraries will add generics interfaces - and most probably, stop supporting the old, non-generic interfaces in some time into the future, breaking backwards compatibility at some point.
- _ph_ 9y agoI am one who downvoted that statement, because I considered it a snippy remark without any content. Especially, as the question of generics in Go has been mentioned and discussed often enough. And if one feels the need to restart that discussion with each Go release, one should do so with an insightful comment. I do not agree with your comment. I don't see how generics are needed to deal with "complex business logic". Yes, ultimately I would like to see generics added to the Go language. As does the Go development team. But, as they have clearly laid out, this is not a trivial undertaking. There hasn't yet been an implementation concept presented, which fits into the Go framework with its design goals. And until then, I am quite happy that they didn't implement some half-finished concept.
- pjmlp 9y agoAdding generics to Java and C after several years, shows how successfully the "wait and see" actually works, versus languages that have supported them from the get go. CLU was designed in 1975 and ML in 1973, several languages with support for some kind of generics have been born and died since then. So in 42 years, there wasn't a single generic implementation that could fit Go's design goals, other than not having generics at all?!
- owaislone 9y agoBut Go has not existed for 42 years. Fitting any of those models on Go is exactly what should be avoided unless one of those models magically was a perfect fit for Go which came out just a few years ago.
- pjmlp 9y agoThat is just hand waving, it is more than clear that //go:generate, 90's style is the the only way accepted by Go design team. There is nothing special in Go's type system that hasn't been tried out in 42 years of generics CS research.
- coldtea 9y agoMagically? It would take magic for one of these models to NOT be a perfect fit for Go. The fact that Go "has not existed for 42 years" is irrelevant -- almost all of its characteristics have been present for 3 to 5 decades, even altogether in the same language(s). E.g. http://cowlark.com/2009-11-15-go/ http://cowlark.com/2009-11-15-go/
- geodel 9y agoSeems author has added an update after 6 years: "..Updated 2015-09-25: So, about six years later, people are still reading this. I'm not sure how to feel about this; Looking at it now, it's incoherent, badly argued, and a lot of the details are simply wrong. But 1000 hits a month indicate that people still get value out of it." But this article link is still quite handy for random proof of Go badness.
- growse 9y agoI imagine the downvotes are because it doesn't really add anything insightful. It just looks like whining. Personally, I don't get the fuss. If you want generics, go use Java/Kotlin/something else. I don't see anyone complaining about the lack of generics in C or brainfuck, what makes golang special?
- pjmlp 9y agoBecause C actually has better support than Go for generics. They could be faked with macros since the early days, which was what Borland's BIDS framework in Borland C++ 2.0 for MS-DOS made use of, dropped when version 3.0 with initial template support was released (around 1992). Additionally, C now has basic language support for generics in C11 with _Generic.
- growse 9y agoFair enough, my C knowledge is a little behind the curve.
- jernfrost 9y agoExcept adding tools for doing some kind of macros is much simpler in Go than C because the language is easier to parse. What stops you from using a preprocessor in Go? It is not really part of the compiler in C either.
- pjmlp 9y agoSure it is, ANSI C11 (ISO/IEC 9899:2011) chapter 6.1 and section 6.5.1.1.
- threeseed 9y agoThis isn't a hard concept to understand. People like 90% of Go e.g. simplicity, build process, speed and feel that if they added features such as generics, decent error handling e.g. Option or Exceptions then it might go to 95%. Everyone is looking for that perfect development platform.
- 9y ago
- fpoling 9y agoPeople have been using Basic and similar for ages to successfully implement business logic without generics. What is necessary for business applications is good integration with databases and reading/writing in various data formats. That typically depends on reflection facilities provided by the language, not genetics. In fact genetics, unless done with extreme care, inevitably makes reflection API more complex. In turn that makes it harder to write readers/writers for typical business formats harming the case of business applications.
- pjmlp 9y agoBasic got generics long time ago in Visual Basic.NET. I have been coding since early 80's, naturally I have delivered lots of production code without generics. Oberon, one of my favorite language family and influence to Go, which I used for a while, also did not had generics. But that was in 1996, when generic programming was WIP in ANSI C++, ML compilers were starting to be adopted, Ada was too expensive, Java and .NET were yet to come. In 2017 I only use static typed languages without support for genericity when forced to do so.
- zimpenfish 9y agoIsn't there some fact about how COBOL (which I'm reasonably sure doesn't have generics) still handles more transactions and/or more $$ per year than anything else?
- jernfrost 9y agoUse another language then. What is the point of different languages if they are supposed to have the same feature set? If you want native code type safety and generics use Rust instead. If that is too complicated use a more friendly type safety focused language like Swift. Really you are spoiled for choice and there is no need to insist every language should follow your particular language philosophy.
- folago 9y agoAdding generics is being considered and might be happening. In the meantime you could write an Experience report[0]? [0]https://github.com/golang/go/wiki/ExperienceReports https://github.com/golang/go/wiki/ExperienceReports
- baby 9y agohell no, if generics get into go I'll have to find another favorite language.
- pjmlp 9y agoGood luck, even C11 has light generics nowadays.
- ComputerGuru 9y agoYeah, I can see how having features added to your favorite language while remaining fully compatible with the code you write today would warrant such a reaction. I mean, just having them in your language, even if you don’t have to use them is just so horrible.
- Skinney 9y agoI think it would be naive to believe that adding generics to Go would have no effect on the stdlib, third party packages, and ultimately how you write Go code.
- omginternets 9y agoIn his defense, just because you don't write generics yourself doesn't mean you don't encounter them.
- Shoothe 9y agoIt's interesting that generics are so important now but they were almost dropped from .NET schedule as being "academic only": https://blogs.msdn.microsoft.com/dsyme/2011/03/15/netc-generics-history-some-photos-from-feb-1999/ https://blogs.msdn.microsoft.com/dsyme/2011/03/15/netc-gener...
- willtim 9y agoC# was originally trying to copy Java, a language that took influence from C (weak types retrofitted) and Smalltalk (no static types at all). Industry has since learned a lot about the tremendous value that types bring. Other forms of static analysis are now gaining popularity too.
- pjmlp 9y agoLets not forget that was in 1999, 10 years before Go came into existence.
- Shoothe 9y agoFor the record I'm not trying to argue generics are not important, on the contrary having worked with them for years go seems to be too limiting in this matter for my practical use. But I agree they can be tricky to get right (compare e.g. declaration-site vs use-site variance [0]) or "accidentaly Turing-complete" TypeScript [1]. [0]: https://schneide.wordpress.com/2015/05/11/declaration-site-and-use-site-variance-explained/ https://schneide.wordpress.com/2015/05/11/declaration-site-a... [1]: https://gist.github.com/hediet/63f4844acf5ac330804801084f87a6d4 https://gist.github.com/hediet/63f4844acf5ac330804801084f87a...
- bonesss 9y ago> ...they were almost dropped from .NET schedule as being "academic only" For all the good that has come out of .NET, and the nice platform it is today, there are a lot of high level design decisions where the team decidedly landed on 'the wrong answer'. To their credit they've been moving towards 'the right answer' for a while now. Auto-wrapped properties instead of exposed value fields. Smart initialization. Safe default values. Generics. Anonymous functions. Nulls. Higher order functions. Still under way: pattern matching, DSL support, option type, type aliasing, etc. Related, but I also find it highly fascinating on those topics how much of Visual Basic's design they ignored, derided, and have then had to re-implement after-the-fact. A lot of babies got thrown out with the COM+/VB6/MFC bathwater.
- krzat 9y agoGenerics cause autism.
- dunkelsten 9y agoAutism causes vaccines.
- jrs95 9y agoSome people’s attitude about this would make you think they actually believe this
- justin66 9y agoSome people's attitude about this would make you think they are actually suffering from this.
- msie 9y agoYes, contrast this with Swift which has become unwieldy in my opinion.
- jrs95 9y agoI enjoy Swift a lot. Haven’t really ran into anything that made me feel this way except for the compile times which are fucking terrible
- oelmekki 9y agoMy biggest fear being that go-2 may be a major break, like symfony-2 and angular-2 were (as examples). Running old code and having it "just work" is something I really love with go. I hope go-2 new features won't come at the cost of breaking old code.
- bonesss 9y agoAre we too early for "Go-2 considered harmful" jokes?
- tmaly 9y agoThere is always the possibility that a go fix tool makes a transition to version 2 super simple.