tag:blogger.com,1999:blog-320445182023-11-15T05:52:19.987-08:00Journal of the Brave Tin SoldierTinSoldierhttp://www.blogger.com/profile/10102961967020940353noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-32044518.post-53322765640766021452015-03-30T11:58:00.001-07:002015-03-30T11:58:22.594-07:00Lessons learned from the <a href="http://golang-challenge.com/go-challenge1/">First Go Challenge</a>. The winning entries were <a href="https://github.com/golangchallenge/GCSolutions/tree/master/march15/normal/luke-champine">Luke Champine</a> and <a href="https://github.com/golangchallenge/GCSolutions/tree/master/march15/extra/jeremy-jay/stridatum-go-challenge-1-8f32f9a76497">Jeremy Jay</a>. Runner up was <a href="https://github.com/golangchallenge/GCSolutions/tree/master/march15/normal/doug-cichon">Doug Cichon</a>.
<br />
<ul>
<li>Simplify by using methods, interfaces and composition.
<ul>
<li>Luke created a <code>Decoder</code> type (which sounds more like an interface) which was a wrapper around an <code>io.Reader</code>. That enabled him to create a composition such as <code>err = NewDecoder(file).Decode(p)</code>. I find that to be very elegant.</li>
<li>Jeremy implemented a <code>read</code> method for both the <code>Pattern</code> type and the <code>Track</code> types. I like Jeremy's method better because it adds extenisbility if the <code>read</code> method had to be exported.</li>
</ul>
</li>
<li>If I implemented this again, I would implement both <code>read</code> and <code>decode</code> methods on <code>Pattern</code> and <code>Track</code> types.
<code>Reader</code> and <code>Decoder</code> are common interfaces in Go and it wouldn't take much to make <code>Pattern</code> and <code>Track</code> conform to those interfaces.</li>
<li>An <code>os.File</code> is an <code>io.Reader</code>. This should have been obvious.</li>
<li><code>binary.Read</code> requires fields to be exported, but you can define structs with exportable fields within a function, in which the structs themselves are still essentially private to the package (see Luke's solution in the <code>readHeader</code> and <code>readTrack</code> methods).</li>
</ul>
See also this <a href="http://golang-challenge.com/evaluator-feedback/">critique</a>. I made a lot of these mistakes and it almost seems like several of the criticisms were pointed directly at <a href="https://github.com/golangchallenge/GCSolutions/tree/master/march15/normal/jason-a-gade">my code</a>!TinSoldierhttp://www.blogger.com/profile/10102961967020940353noreply@blogger.com0tag:blogger.com,1999:blog-32044518.post-82443332288555460152007-03-21T22:18:00.000-07:002018-02-20T20:33:27.967-08:00Response to "Room 219 Revisted"From a previous <a href="http://bravetinsoldier.blogspot.com/2006/08/they-have-their-own-thoughts-room-219.html">post</a> here, I found that Melanie Plesh has <a href="http://pleshblog.blogspot.com/2006/09/tinsoldier.html">responded</a> to me. I am moved.<br /><br />I posted a comment to this six-month-old blog post:<br /><br />"I'm sorry it took me so long to get back to you... thanks for responding.<br /><br />I started my own blog and then quit, going back to web forums instead. I'm glad to hear the school has reopened, even if for limited times per day.<br /><br />Being at that school and reading your blog have really opened my eyes to a lot of things. Thank very much for being there and being an inspiration for kids. I'm 37 now, with my own kids in school, but I still remember most of my teachers and how big an influence on my life they were."<br /><br />If you could read her blog and not be moved, then nothing can move you. If you could have seen the condition of that neighborhood when I was there, where the damage before the storm was still very apparent, and still not be moved, then you are inhuman indeed.TinSoldierhttp://www.blogger.com/profile/10102961967020940353noreply@blogger.com0tag:blogger.com,1999:blog-32044518.post-1156302983794260862006-08-22T20:16:00.000-07:002018-02-20T20:33:41.932-08:00They Have Their Own Thoughts: room 219 revisitedI was searching through my Katrina pictures on my laptop, and I decided to Google "frederick douglass high school new orleans oregon national guard" and I found this blog post apparently by a teacher at the school where we stayed when I was there:<br /><a href="http://pleshblog.blogspot.com/2005/11/room-219-revisited.html#links">They Have Their Own Thoughts: room 219 revisited</a><br /><br />I plan on posting some pictures later...TinSoldierhttp://www.blogger.com/profile/10102961967020940353noreply@blogger.com0