Closed gopherbot closed 9 years ago
* interface{} is litterally the interface keyword. No conflict and no need for a new keyword. * mapis the Java syntax, you said it was old and ugly * Go has no classes * Java classes are as verbose as Go structs: class T { int a, b; } versus type T struct { a, b int } * Go is a lot less messy than C * Java's one-class-per-file often results in illogical organization. * Go is not limited to a small number of people, it is already popular. * Go is not a product. * Many Go users including me like the syntax very much * Go 1 syntax is frozen. * don't be aggressive on a issue tracker, instead of being aggressive and apologizing at the same time.
interface{} is literally the interface keyword. No conflict and no need for a new keyword. This unnecessary "{}" is ugly and stupid,and make code verbose.I think the reason "{}" was added is because "interface" has been used as key word. * map<key,value> is the Java syntax, you said it was old and ugly Maybe other languages do better then java,but <key,value> is far more better than [key]value.People will be easy to know "<key,value>" is a pair at first glance,because it is symmetric,but when seeing "[key]value",take a while to recognize it,or must be told. * Java classes are as verbose as Go structs: class T { int a, b; } versus type T struct { a, b int } I don't mean this but function declaration:func (s *StructName) funcNames(){...},this "(s *StructName)" must be repeated in every function,make code verbose.But if this style can benefit other aspects,it is fine,but if not,consideration should be token to how to reduce this repetition. * Go is a lot less messy than C Take a look this sequence:"..C,X................java...".You are just saying X is a lot less messy than C,Yes,you are right,but please take a look at this long "................".In many aspects,golang do well,but there are also some unbelievable funny designs,I think it is,primary,because of C background of designers.For performance,stare at c,but for syntax,never stay at c,take a look at java,c#,and ruby or other betters. * Java's one-class-per-file often results in illogical organization. one-class-per-file makes code structure more clear.First,at the first glance at directory,users will know what files or even function may include it in a package,they are implied by file name.Second,if user want to find some "element",check package view(or directory if no IDE used),then open,it is linear operations,but for current golang file "element" organizing style,it make source file long and messy,hard to find "element".Remember many people is IDE guys not vi guys.But honestly,I don't know the drawback of one-class-per-file,can you give examples. * Go is not limited to a small number of people, it is already popular. First of all,face the truth,directly and directly.I have tried to persuade my colleagues and friends to give golang a try.Few of them tried,and told me this language is verbose,ugly,awkward.And I told them its performance is better,and they got this:http://shootout.alioth.debian.org/u32/which-programming-languages-are-fastest.php,so I can just close my mouth.I still used golang,because currency and performance are my primary concerns,even I am not sure whether it do perform better than java,but I think big direction is right:compilation will perform better than byte code.But I must still endure verbose syntax and lonely.Thank goodness,golang's IRC is very good. * Many Go users including me like the syntax very much Maybe,you aren't sure of this,take a look at:http://uberpython.wordpress.com/2012/09/23/why-im-not-leaving-python-for-go/ and http://news.ycombinator.com/item?id=4562211. Even I take you are right,take a look at http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html. I think this shamed ranking is still primarily because of google,if not google,golang may have been garbage collected. * Go 1 syntax is frozen. I am not sure whether any syntax changes have been made from its birth,or never changed before.I mean syntax,but API Science isn't about political,even not habit,it is about productive and beautiful.please,take an investigate and do changes: Interface{}-------------------to------------------>Interf or more simple words map[key]value-----------------to------------------>map<key,value> or more beautiful syntax for item rang collection------to------------------>for(item::collection),for example for(string::[]string{"item0","item1"}) or more simple form I am sure these three changes will attract more users,but for enforcing one class per file,I am not sure about it,if you guys can give acceptable reasons,it is fine,if you can't,repeating "(s *StructName)" in every funcation is definitly unacceptable.And for error handling,it should be simpled,but you may give more workaround if it is hard to change
In "interface{}" the "{}" was not "added" for any reason. "interface{}" means the empty interface with no methods. Like struct{} is the struct with no fields. It's just completely regular syntax. You are free to define "type Interf interface{}". But "Interf" is ugly. And again, Java is really the worst example you could take to explain your concerns. You can already find a lot of blog posts explaining all of this (just like you post links to all those blogs), so I'm stopping here.
by Alexander.Luya: