Live data from Hacker News

Introducing Go by Example

mmcgrana.github.com

21–30 of 37 posts

Re: Introducing Go by Example

#21
I really like the way this is set up with lengthy examples next to the explanatory text. I look forward to reading through it. Thanks!

In the meantime, mind a quick comment on the typography? The Palatino Linotype body text renders poorly on Windows. Italics are particularly hard to read.

I tried changing it to Georgia and it made a world of difference:

http://mg.to/images/go-by-example-palatino.png

http://mg.to/images/go-by-example-georgia.png

Re: Introducing Go by Example

#22

I really like the way this is set up with lengthy examples next to the explanatory text. I look forward to reading through it. Thanks! In the meantime, mind a quick comment on the typography? The Palatino Linotype body text renders poorly on Windows. Italics are particularly hard to read. I tried changing it to Georgia and it made a world of difference: http://mg.to/images/go-by-example-palatino.png http://mg.to/imag…

Great feedback - thanks. Georgia also works well on Mac, so I just shipped this as the default.

Re: Introducing Go by Example

#23
post #19

I've never experimented with go, until now. I just ran all of the examples (found the mt=>fmt typo which I believe has been fixed). I think this is a great way to start, thank you for building it. I have a few suggestions. Make the code easily copyable. Under Chrome, at any rate, if you select the code you can't help but select your comments to the left of the code. I think that people running through the examples sh…

I totally agree re: copy-paste. I wasn't clever enough with CSS to do this straight away but it's high on my list: https://github.com/mmcgrana/gobyexample/issues/12.

Also agree that a learn more section could be good - I'll noodle on it.

Re: Introducing Go by Example

#24

I really like the way this is set up with lengthy examples next to the explanatory text. I look forward to reading through it. Thanks! In the meantime, mind a quick comment on the typography? The Palatino Linotype body text renders poorly on Windows. Italics are particularly hard to read. I tried changing it to Georgia and it made a world of difference: http://mg.to/images/go-by-example-palatino.png http://mg.to/imag…

Great feedback - thanks. Georgia also works well on Mac, so I just shipped this as the default.

May I throw a word in? Copying the example source doesn't work properly; I can't select source code without the descriptive text on the left. Would be nice to have that ability.

Re: Introducing Go by Example

#25

Earlier quoted context omitted.

Great feedback - thanks. Georgia also works well on Mac, so I just shipped this as the default.

May I throw a word in? Copying the example source doesn't work properly; I can't select source code without the descriptive text on the left. Would be nice to have that ability.

Yep it's a bummer - this is discussed in a comment below.

Re: Introducing Go by Example

#29
post #20

Quick Go question. I haven't done much go coding at all, but play around with the language. I've been reading a lot about it (thanks to HN). So I was now looking at the Slices section and noticed a slice being initalize as: t := []int{1, 2, 3, 4, 5} What makes that a slice and not an array? EDIT: Ok, found that answer on google go's blog. Apparently leaving out the length makes it one.

Arrays are a fixed size. eg. t:=[5]int{1,2,3,4,5}

Go can also do the counting for you. eg. t:=[...]int{1,2,3,4,5}

Re: Introducing Go by Example

#30

This is an old media presentation of something inherently interactive -- Alan Kay complains about how the wikipedia pages' code examples aren't executable. There is already the well-developed http://tour.golang.org/ , which can be used freely.

I really liked the Go Tour, which I checked out 3 weeks ago. Then I was a bit disappointed to see that the UI changed some, making it less user-friendly. (Everything used to fit on one page, except for longer examples, for instance.) Still like it overall, though.
Post reply on HN