<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Colas.Nahaboo.net - go</title>
    <subtitle>Colas Nahaboo personal site, with discussions about programming code, web and computing topics, surfing and SUPing, and various musings.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://colas.nahaboo.net/tags/go/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://colas.nahaboo.net"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2022-03-03T00:00:00+00:00</updated>
    <id>https://colas.nahaboo.net/tags/go/atom.xml</id>
    <entry xml:lang="en">
        <title>Suntimes, a small shell utility</title>
        <published>2022-03-03T00:00:00+00:00</published>
        <updated>2022-03-03T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://colas.nahaboo.net/code/suntimes-a-small-shell-utility/"/>
        <id>https://colas.nahaboo.net/code/suntimes-a-small-shell-utility/</id>
        
        <content type="html" xml:base="https://colas.nahaboo.net/code/suntimes-a-small-shell-utility/">&lt;p&gt;I just made a small command-line utility to display the sunrise and sunset times at a location. It can be quite useful in shell scripts.&lt;&#x2F;p&gt;
&lt;p&gt;It is a minimal Go wrapper around the &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;nathan-osman&#x2F;go-sunrise&quot;&gt;nathan-osman&#x2F;go-sunrise library&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;You can find it at my repository: &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;ColasNahaboo&#x2F;suntimes&quot;&gt;GitHub - ColasNahaboo&#x2F;suntimes&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Completed the 2015 Advent of Code challenge in GO</title>
        <published>2022-02-24T00:00:00+00:00</published>
        <updated>2022-02-24T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://colas.nahaboo.net/code/completed-the-2015-advent-of-code-challenge-in-go/"/>
        <id>https://colas.nahaboo.net/code/completed-the-2015-advent-of-code-challenge-in-go/</id>
        
        <content type="html" xml:base="https://colas.nahaboo.net/code/completed-the-2015-advent-of-code-challenge-in-go/">&lt;p&gt;And I completed the 2015 challenge! (see my &lt;a href=&quot;&#x2F;code&#x2F;starting-the-2015-advent-of-code-challenge-in-go&quot;&gt;previous post&lt;&#x2F;a&gt;). You can read my notes on it on my  &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;ColasNahaboo&#x2F;advent-of-code-my-solutions&#x2F;tree&#x2F;main&#x2F;go&#x2F;2015&quot;&gt;GitHub&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;This was quite interesting, and I thing a great way to learn a language just after completing its tutorial, as this challenge as a feel of &quot;real life&quot; situations, and allow for a variety of solutions, so that you can put different approaches to the test.&lt;&#x2F;p&gt;
&lt;p&gt;I forced myself to not look at the solutions available on the net, except for two cases:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Using working code to generate more data to test against (random inputs + expected result number). I just ran the code of other solutions, without reading their source. I often used  solutions by &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;devjobe&#x2F;advent-of-code-2015-golang&quot;&gt;devjobe&lt;&#x2F;a&gt; and &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;schwern&#x2F;adventofcode.go&quot;&gt;schwern&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Once I had a working solution, browsing the source code of other solutions to compare with mine and see where I could improve, and discover cool tricks. I mostly used the &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;adventofcode&#x2F;wiki&#x2F;solution_megathreads&#x2F;#wiki_december_2015&quot;&gt;reddit megathread&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;I also tried to use only the standard Go packages, and not the ones available on the web. I am sure I will end up using 3rd party packages to replace the standard ones (the &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;pkg.go.dev&#x2F;flag&quot;&gt;flag package &lt;&#x2F;a&gt;  to parse options for instance is really too primitive). And I also didn&#x27;t create a separate module or package for my library of common useful functions. I will surely do it in the future, but I feel I should have more experience first.&lt;&#x2F;p&gt;
&lt;p&gt;Anyways, it has confirmed that Go was the language I have been waiting for all these years. On the one hand, I have a bit of regret not having jumped on it sooner, but on the other hand it was easier to just wait for my retirement (one year ago) to free myself from any work politics and constraints to be able to fully explore the programming language landscape with no strings attached.&lt;&#x2F;p&gt;
&lt;p&gt;I can see myself using 4 languages in the future:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;bash&lt;&#x2F;strong&gt; for any &quot;glue&quot; tooling and scripts.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;go&lt;&#x2F;strong&gt; for my main do-it-all language, and web backend.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;javascript&lt;&#x2F;strong&gt; (and&#x2F;or WebAssembly) for my web frontend, with pure modern HTML and CSS, but no framework, à la  &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;http:&#x2F;&#x2F;vanilla-js.com&#x2F;&quot;&gt;Vanilla JS&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;and maybe a higher performance, specialized language, if I encounter such needs: E.g: &lt;strong&gt;zig&lt;&#x2F;strong&gt; as a replacement of C for tasks where Go could be unsuited (if I encounter any), or &lt;strong&gt;julia&lt;&#x2F;strong&gt; for math-specific things, etc...&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Edit: I see that Neil Henning also enjoyed discovering a new language via AoC: &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.duskborn.com&#x2F;posts&#x2F;2021-aoc-zig&#x2F;&quot;&gt;A Review of the Zig Programming Language (using Advent of Code 2021)&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Starting the 2015 Advent of Code challenge in GO</title>
        <published>2022-02-09T00:00:00+00:00</published>
        <updated>2022-02-09T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://colas.nahaboo.net/code/starting-the-2015-advent-of-code-challenge-in-go/"/>
        <id>https://colas.nahaboo.net/code/starting-the-2015-advent-of-code-challenge-in-go/</id>
        
        <content type="html" xml:base="https://colas.nahaboo.net/code/starting-the-2015-advent-of-code-challenge-in-go/">&lt;p&gt;I discovered the &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;adventofcode.com&#x2F;&quot;&gt;advent of code&lt;&#x2F;a&gt; in 2021, and did it in &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;ColasNahaboo&#x2F;advent-of-code-my-solutions&#x2F;tree&#x2F;main&#x2F;bash&quot;&gt;bash&lt;&#x2F;a&gt; for the challenge. But since I started learning GO, I decided to code the previous AoC years in GO as a mean to practice it. So, although my bash code can be useful to see some tricks of a seasoned bash programmer, these GO solutions must be considered as &quot;student code&quot;.&lt;&#x2F;p&gt;
&lt;p&gt;So I started coding the 2015 year of AoC in GO, available on my GitHub: &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;ColasNahaboo&#x2F;advent-of-code-my-solutions&#x2F;blob&#x2F;main&#x2F;go&#x2F;2015&quot;&gt;advent-of-code-my-solutions&#x2F;go&#x2F;2015&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The code is in GO, with some housekeeping scripts in bash.&lt;&#x2F;p&gt;
</content>
        
    </entry>
</feed>
