Go 1.3



  • @Rob Pike said:

    <statement><keyword>if</keyword><condition><expression><variable>x</variable><operator>==</operator><expression>3</expression></condition><truebody><statement><keyword>return</keyword><expression>3</expression></statement></truebody><elsebody><statement><keyword>return</keyword><expression>4</expression></statement></elsebody></statement>

    Very clear, no ambiguity. We'll do this in Go 1.3.

    To be honest, typing this in clarified something for me about XML.

    -rob



  • I'm reading that thread through from the start. It's kind of funny in an exasperatingly sad sort of way.

    Michael Daconta comes across like one of those deluded Freemen On The Land types who thinks his own fractured and incomplete grasp of the law entitles him to avoid paying his income tax, which the court would totally have to agree with if only they would listen.



  • The awesome thing is that google decided to hijack 15% of my monitor height to display bullshit in the header, and hijacked the scrolling mechanism to scroll less than half as fast as the browser normally would.

     



  • ...and it seems that Rob was alluding to an actual thing, not just kidding around. Holy shit.



  • @dhromed said:

    The awesome thing is that google decided to hijack 15% of my monitor height to display bullshit in the header, and hijacked the scrolling mechanism to scroll less than half as fast as the browser normally would.

     


    Also, pushing j or k will bring you to different threads instead of moving down the line of messages (which it does in everything else that supports j and k ever).



  •  @Ben L. said:

    j or k

    I don't know of anything that supports j or k.

    I have Find As You Type on, which is handy, so j or k will start searching for j* and k*



  • @dhromed said:

     @Ben L. said:

    j or k

    I don't know of anything that supports j or k.

    I have Find As You Type on, which is handy, so j or k will start searching for j* and k*


    Google Reader supported it. GMail does too.



  • @Ben L. said:

    https://groups.google.com/d/msg/golang-nuts/rzLzp_Z74ik/JnK-rkPJtnMJ
    The same guy has started a new thread to continue beating the same dead horse.



  • ♿ (Parody)

    @El_Heffe said:

    @Ben L. said:

    https://groups.google.com/d/msg/golang-nuts/rzLzp_Z74ik/JnK-rkPJtnMJ
    The same guy has started a new thread to continue beating the same dead horse.

    I don't know enough about Go (or read enough of those threads) to know if I'm off base, but his message implies that there is a One True Way to format your braces, but semi colons are optional. None of the other anti-Go jeremiads around here were persuasive, but this combination of features scares me.



  • @boomzilla said:

    @El_Heffe said:

    @Ben L. said:

    https://groups.google.com/d/msg/golang-nuts/rzLzp_Z74ik/JnK-rkPJtnMJ
    The same guy has started a new thread to continue beating the same dead horse.

    I don't know enough about Go (or read enough of those threads) to know if I'm off base, but his message implies that there is a One True Way to format your braces, but semi colons are optional. None of the other anti-Go jeremiads around here were persuasive, but this combination of features scares me.

    I'll assume you know javascript for this analogy:

    function a() {
        return {
            foo: 'bar'
        }
    }
    
    function b() {
        return {
            foo: 'bar'
        };
    };
    
    function c()
    {
        return
        {
            foo: 'bar'
        }
    }

    a and b are identical. c is not.


  • ♿ (Parody)

    @Ben L. said:

    I'll assume you know javascript for this analogy:

    Yes, javascript is very stupid in this way, too.



  • @boomzilla said:

    @Ben L. said:
    I'll assume you know javascript for this analogy:

    Yes, javascript is very stupid in this way, too.

    Except Go doesn't have a problem with that. Valid doesn't mean suggested. We have a tool specifically for fixing ugly code. (click Format)


  • ♿ (Parody)

    @Ben L. said:

    @boomzilla said:
    @Ben L. said:
    I'll assume you know javascript for this analogy:

    Yes, javascript is very stupid in this way, too.

    Except Go doesn't have a problem with that. Valid doesn't mean suggested. We have a tool specifically for fixing ugly code. (click Format)

    I'm not sure what your point is. Maybe that at least Go doesn't fuck you over like javascript does? This doesn't invalidate my point, although it suggests that the designers of Go can at least learn something from others mistakes.



  • @boomzilla said:

    I don't know enough about Go (or read enough of those threads) to know if I'm off base, but his message implies that there is a One True Way to format your braces, but semi colons are optional. None of the other anti-Go jeremiads around here were persuasive, but this combination of features scares me.
    Semi-colons are "optional" in the sense that if you don't put them in Go will automatically insert them when parsing the code. Because of the way that Go inserts semi-colons it has a side effect of forcing you to format your braces in a certain way. The relevant explantion (*I think*) is here:  http://golang.org/doc/faq#semicolons  (emphasis added by me)

    Go uses brace brackets for statement grouping. Semicolons, however, are for parsers, not for people, and we wanted to eliminate them as much as possible. The semicolons that separate statements are injected automatically, without lookahead, by the lexer at the end of any line that could be the end of a statement. This works very well in practice but has the effect that it forces a brace style. For instance, the opening brace of a function cannot appear on a line by itself.
    That last part seems to be the thing that is giving some people heartburn. If you write:
    func main() 

    <font face="courier new,courier"></font>
    <font face="courier new,courier">{</font>
    <font face="courier new,courier">    fmt.Printf("hello, world!\n");</font>
    <font face="courier new,courier">}
    </font>Which appears perfectly normal to most people, but you get an error because Go inserts a semi-colon which results in:<font face="courier new,courier">
    func main()<font color="#FF0000" size="4">;</font></font>
    <font face="courier new,courier">{</font>
    <font face="courier new,courier"> fmt.Printf("hello, world!\n");</font>
    <font face="courier new,courier">}
    </font>So apparently the "correct" way is:
    <font face="courier new,courier">func main()</font><font face="courier new,courier">{</font>
     
    <font face="courier new,courier"> fmt.Printf("hello, world!\n");</font>
    <font face="courier new,courier">}
    </font>
    I have no interest in Go, but even if I did, this seems pretty trivial and not worth arguing over. This is how it was designed, just do it and shut up already.



  • Considered Harmful

    @El_Heffe said:

    I have no interest in Go, but even if I did, this seems pretty trivial and not worth arguing over. This is how it was designed, just do it and shut up already.

    I have no problem with it because that's where I prefer to put braces anyway. If they had required a new line for a brace, then I'd avoid the language. Which I already do, for reasons that have already been articulated elsewhere on these forums.


  • ♿ (Parody)

    @joe.edwards said:

    @El_Heffe said:
    I have no interest in Go, but even if I did, this seems pretty trivial and not worth arguing over. This is how it was designed, just do it and shut up already.

    I have no problem with it because that's where I prefer to put braces anyway. If they had required a new line for a brace, then I'd avoid the language. Which I already do, for reasons that have already been articulated elsewhere on these forums.

    Yes, that's how I like braces to be. But TRWTF is interpreting whitespace (outside of quotes, of course) as anything other than token separators. In the extreme, you end up with whitespace. Between Whitespace and Go you find javascript and python. I avoid all of these as much as possible.



  • @boomzilla said:

    @joe.edwards said:
    @El_Heffe said:
    I have no interest in Go, but even if I did, this seems pretty trivial and not worth arguing over. This is how it was designed, just do it and shut up already.

    I have no problem with it because that's where I prefer to put braces anyway. If they had required a new line for a brace, then I'd avoid the language. Which I already do, for reasons that have already been articulated elsewhere on these forums.

    Yes, that's how I like braces to be. But TRWTF is interpreting whitespace (outside of quotes, of course) as anything other than token separators. In the extreme, you end up with whitespace. Between Whitespace and Go you find javascript and python. I avoid all of these as much as possible.

    It's more concerning to me that you think newlines are semantically the same as spaces or tabs.

    Well, Community Server does, at least.


  • ♿ (Parody)

    @Ben L. said:

    It's more concerning to me that you think newlines are semantically the same as spaces or tabs.

    And the python guys are aghast that you lump tabs and spaces together. That's because you all have terrible taste in programming languages.

    Of course, also have an effect on line comments, if I may go pedantic dickweed on my previous post.



  • @boomzilla said:

    TRWTF is interpreting whitespace (outside of quotes, of course) as anything other than token separators.

    When I were a nipper we had to fit our statements on one card each. If it was good enough then it's good enough now.

    FORTRAN punch card

  • Considered Harmful

    @flabdablet said:

    @boomzilla said:
    TRWTF is interpreting whitespace (outside of quotes, of course) as anything other than token separators.

    When I were a nipper we had to fit our statements on one card each. If it was good enough then it's good enough now.

    FORTRAN punch card



  • ♿ (Parody)

    @flabdablet said:

    When I were a nipper we had to fit our statements on one card each. If it was good enough then it's good enough now.

    Bah! Then we can't confuse people who refuse to learn modern version control systems and get confused about adding and removing lines. They are the worst of the worst.



  • GIT SHUFFLED MY DECK


Log in to reply