simplicity is complicated: https://www.youtube.com/watch?v=rFejpH_tAHM needlessly complex: https://youtu.be/IRTfhkiAqPw?t=19m40s because i liked it very much: https://www.youtube.com/watch?v=QM1iUe6IofM
About code gen, as we know it in go1, i feel like it is a third class citizen. In its current form i think it is not able to perform as good as it need to be to become a first class citizen. being out of the language limits its capabilities. I need to find example about that. Also my understanding is that it was not designed to be used for the kind of code gen like go-derive does it, this usage seems to come from the community, as a workaround. On the principles code-gen is the most capable, in practice its un-natural. On Saturday, August 26, 2017 at 7:03:36 PM UTC+2, JuciĆ Andrade wrote: > > mhh: > >Why would you put generics on a method ? > > I.e.: I could have a container type and a element type to be contained. > > myStack.push(myElement) > > mhh: > >type Final notFinal<int, string> > > Maybe it is a good idea to require an intermediate type like that, to keep > things readable. > > mhh: > > none of this is as powerful as code gen. > > A lot of people consider code gen a second class solution when compared to > a more traditional generics implementation. I don't think so. Code > generation can be very effective. No major concerns about indecipherable > error messages. When in doubt you can inspect the generated code to > understand exactly what is the problem. > > Axel, I am very confident that no solution will be incorporated to Go > before deep thinking about all it's implications. Your points will be > considered, for sure. > > Jesper: > > if you don't get the above, you wouldn't have been able to pass the > first course at my university back in the day (around 2000). > > Generics user here, since Bjarne Stroustrup's CFront, the very first C++ > compiler. > > Whenever you use complex idioms you reduce the amount of people able to > understand your code and able to mantain it. The simpler the code, the more > people can help you. > > Abuse of generics is a common source of headaches in C++ code. I saw > seasoned developers fighting for hours or days to convince the compiler to > grasp new code. Due to the complexity explosion things get out of control > fast. For what? Just to throw that code away as soon as someone else needs > to mantain it. Write-only code. > > Been there, done that. I learned it the hard way. > > Today if you see a code of mine you surely will say I learned to program > yesterday. That's exactly the way I like. People are able to read my code > like it was a comic book. No secrets, no head scratching. I am happy, my > employer is happy, my coworkers are happy. A lot of developers can jump to > my project if the need/oportunity arises. > > Simplicity is the single most important Go asset in my opinion, due to the > broader audience it brings. > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.