You like radish, we like meat.

在 2013年9月21日星期六 UTC+8下午10:04:09,Michael Daconta写道:
>
> Hi Remy,
>
> So, in the original program, to test the exact theory you mention, I added 
> all the semi-colons myself.
> Like so:
>
> package main;
>
> import "fmt";
>
> func main() 
> {
>     fmt.Printf("hello, world!\n");
> }
>
> As you can see, the code has semi-colons in each required location.  So, I 
> ask you - why is the above code illegal?
> All I've heard so far, is that "it is because the automatic insertion of 
> semi-colons requires this stupid behavior".  Given the above code should 
> require NO automatic insertion of semi-colons - why the stupid behavior?
>
> As for the folks on the thread saying "get over it" - sorry, I would turn 
> the question back to you and say - why are you blindly accepting something 
> so foolish?  There are things in a programming language that MUST be 
> enforced, this should not be one of them.  So, either the language 
> designers must admit their language is poorly designed, or they need to fix 
> the problem!  Ignoring the problem or flippantly asserting there is no 
> problem, is the worst thing they can do as it goes against the very reasons 
> you design a new language for in the first place.
>
> - Mike
>
> On Saturday, September 21, 2013 9:49:42 AM UTC-4, Rémy Oudompheng wrote:
>>
>> Compiler laziness is a minor argument. Humans must also understand 
>> semicolon insertion rules, justifying the choice of simple rules. 
>>
>> The choice of a standard formatting also makes the use of grep easier. 
>>
>>
>> 2013/9/21, Michael Daconta <michael...@gmail.com>: 
>> > I assume you say this with tongue-in-cheek; however, I cannot believe 
>> this 
>> > design decision was made.  For something to borrow so liberally from C 
>> only 
>> > 
>> > to enforce "one-true" bracing style is frankly ridiculous. 
>> > When someone has coded for a long time using their favorite bracing 
>> style, 
>> > the numerous hours of frustration to learn this new language become not 
>> > worth it.  Just due to inadvertent, habitually return to a bracing 
>> style 
>> > the language designers deemed improper - which, in fact, is actually 
>> due to 
>> > 
>> > the laziness of their compiler.  I believe they could improve the 
>> compiler 
>> > to correct this.  So, while I could write my own compiler for this - 
>> there 
>> > is actually an easier solution, just ignore this language until the 
>> > language designers do the right thing.  And if not, ignore it all 
>> together. 
>> > 
>> > Though I like many features of the language from looking at the "go 
>> tour", 
>> > I can take it or leave it. 
>> > 
>> > While I new this post could be flame bait, I actually had to post it 
>> > because I was so shocked that Google would make such a foolish error. 
>> > Really, lose adoption over compiler laziness?  Give me a break... 
>> > 
>> > - Mike 
>> > 
>> > On Saturday, September 21, 2013 12:45:58 AM UTC-4, Dave Cheney wrote: 
>> >> 
>> >> I, For One, welcome the One True Brace style. 
>> >> 
>> >> On Sat, Sep 21, 2013 at 11:58 AM, Michael Daconta 
>> >> <michael...@gmail.com <javascript:>> wrote: 
>> >> > Hi Go fans, 
>> >> > 
>> >> > I frankly was shocked to learn that a program like: 
>> >> > 
>> >> > package main; 
>> >> > 
>> >> > import "fmt"; 
>> >> > 
>> >> > func main() 
>> >> > { 
>> >> > fmt.Printf("hello, world!\n"); 
>> >> > } 
>> >> > 
>> >> > ... is currently illegal in go with the error: 
>> >> > 
>> >> > # command-line-arguments 
>> >> > .\hello.go:6: syntax error: unexpected semicolon or newline before { 
>> >> > 
>> >> > From reading the newsgroups, I see that this is illegal due to the 
>> >> automatic 
>> >> > insertion of semi-colons; however, what if I added my own 
>> semi-colons 
>> >> into 
>> >> > the code as in the above.  From a language perspective the above 
>> should 
>> >> > 
>> >> be 
>> >> > legal Go code.  To me, it seems like a hack for convenience (making 
>> >> > semi-colons optional) has forced a K&R style on everyone. 
>> >> > For me, this is a show-stopper.  Frankly, I am surprised that Google 
>> >> would 
>> >> > enforce a coding style (K&R) while saying that "go fmt" frees you 
>> from 
>> >> > worrying about divergent coding styles.  Sorry, google - you cannot 
>> have 
>> >> > 
>> >> it 
>> >> > both ways.  Unless the Allman-style code above is illegal in the 
>> >> language 
>> >> > (which makes no sense from a language semantics point of view) - get 
>> the 
>> >> > 
>> >> > compiler to accept it. Period. 
>> >> > 
>> >> > Yes, I know I can write my own translator - but why?  Heck, I can 
>> just 
>> >> stick 
>> >> > with Java... 
>> >> > 
>> >> > C'mon Google, when trying to pitch a new language, you can (and 
>> should) 
>> >> > 
>> >> do 
>> >> > better than this... 
>> >> > 
>> >> > - Mike 
>> >> > 
>> >> > -- 
>> >> > 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...@googlegroups.com <javascript:>. 
>> >> > For more options, visit https://groups.google.com/groups/opt_out. 
>> >> 
>> > 
>> > -- 
>> > 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...@googlegroups.com. 
>> > For more options, visit https://groups.google.com/groups/opt_out. 
>> > 
>>
>

-- 
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.

Reply via email to