golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.99k stars 17.67k forks source link

Please get rid of those ugly and stupid stuffs? #4164

Closed gopherbot closed 9 years ago

gopherbot commented 12 years ago

by Alexander.Luya:

Golang gets rid of some bad things in java,but kept some ugly things in "old"
languages that java have gotten rid of long,long ago,for example,"for
range","interface{}",and map definition syntax are ugly and
stupid(sorry),why not just using:for(item:collection),interf(then it will not conflict
with key word:interface),and map<key,value>.
    And golang's class definition is very verbose and ugly also.I am not sure whether other language's are better than java,but I am sure Java's class related syntax is far more beautiful and concise than golang,enforing 
one class per file is not so bad,saving a lot of typing,make source directory more
readable.Please do not inherit c's inhabitation to mix all stuff one a file,it is
messing. 
    Haven't you guys never checked existing "products",when you prepare to create a new one.And If you guys want to keep galang in a small developers forever,it is ok,I can just say google is rich....But if you want to make it popular and let more people benifit from your work.Please do consider to get rid of that ugly,verbose and stupid syntaxs.
    I think this syntax chanaging will not hurt deep thing of golang,and relative easy to change.Take a poll,somebody will get aganist it,but more people will welcome it.After all,sciense is not politcal,the better can  defeat the bad more easily.
    In the end,don't be borned as old man,born as Benjamin Button.Don't hesitate until is too late to change.
    Forgive my agreesive.
remyoudompheng commented 12 years ago

Comment 1:

* interface{} is litterally the interface keyword. No conflict and no need for a new
keyword.
* map is 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.
ianlancetaylor commented 12 years ago

Comment 2:

To be honest I don't understand all your suggestions, but in any case the Go 1 syntax is
fixed.

Status changed to WorkingAsIntended.

gopherbot commented 12 years ago

Comment 3 by Alexander.Luya:

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
remyoudompheng commented 12 years ago

Comment 4:

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.
rsc commented 12 years ago

Comment 5:

I'm sorry but the issue tracker is not a mailing list. If you'd like to discuss further
please use golang-nuts@googlegroups.com. Thanks.

Labels changed: added restrict-addissuecomment-commit.