<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://www.kimballleavitt.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://www.kimballleavitt.com/" rel="alternate" type="text/html" /><updated>2026-04-04T18:19:55+00:00</updated><id>https://www.kimballleavitt.com/feed.xml</id><title type="html">Kimball Leavitt</title><subtitle>Silly musings of an overgrown oocyte</subtitle><entry><title type="html">My first brainf*** program</title><link href="https://www.kimballleavitt.com/first-brainf-program/" rel="alternate" type="text/html" title="My first brainf*** program" /><published>2022-12-05T00:00:00+00:00</published><updated>2022-12-05T00:00:00+00:00</updated><id>https://www.kimballleavitt.com/first-brainf---program</id><content type="html" xml:base="https://www.kimballleavitt.com/first-brainf-program/"><![CDATA[<p>Below you will find my first <a href="https://en.wikipedia.org/wiki/Brainfuck">brainf***</a> program ever.</p>

<p>This is how I wrote it in an attempt to keep track of what’s going on:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&gt; +++++ +++++ +++++
[
&lt; +++++
&gt; -
]
&gt;
&lt;
.
</code></pre></div></div>

<p>Here’s it without the spaces:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&gt;+++++++++++++++[&lt;+++++&gt;-]&gt;&lt;.
</code></pre></div></div>

<p>What does this program do, you might ask?</p>

<p>All it does is output the letter ‘K’.</p>

<p>EDIT (April 4, 2026): idk what happened but the above code doesn’t work.</p>

<p>The corrected version is:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&gt;+++++++++++++++[&lt;+++++&gt;-]&lt;.
</code></pre></div></div>]]></content><author><name></name></author><summary type="html"><![CDATA[Below you will find my first brainf*** program ever.]]></summary></entry><entry><title type="html">How I Graduated College Debt-Free</title><link href="https://www.kimballleavitt.com/debt-free/" rel="alternate" type="text/html" title="How I Graduated College Debt-Free" /><published>2020-08-22T00:00:00+00:00</published><updated>2020-08-22T00:00:00+00:00</updated><id>https://www.kimballleavitt.com/debt-free</id><content type="html" xml:base="https://www.kimballleavitt.com/debt-free/"><![CDATA[<p>A large measure of my success is because I’m lucky. I’m lucky to have been born when and where I was born, into the family I was born into, and so on and so forth.
My family’s definitely had some hardships, but we’ve never been wanting for anything.
I’m also a white male, which means I probably have it easier than most.
I wanted to acknowledge these facts, so keep those in mind, but now let’s move on to talking about what I did to manage my finances in college and graduate debt-free.</p>

<p>In general, the way I avoided debt in college was this:</p>

<ul>
  <li>I chose a college with pretty low tuition costs</li>
  <li>I got good grades (and a good ACT score)</li>
  <li>I worked</li>
</ul>

<p>Let’s go in order of that list.</p>

<p>First, I went to a college with low tuition costs: Brigham Young University (BYU). Their tuition for full tithe-paying members of the Church of Jesus Christ of Latter-day Saints is ridiculously low.
We’re talking $3/3.5K per semester, so less than 7 thousand bucks a year for full-time undergraduate students.
It really helps to go to a university with low tuition costs.
BYU is constantly ranked as one of the best value higher education institutions, so keep that in mind when you’re looking at colleges.</p>

<p>Next, I got good grades (and a good ACT score).
The first 3 semesters at BYU I got a half tuition academic scholarship based on my high school GPA/ACT (I had a 3.9 GPA and got a 32 on the ACT).
The last 4 semesters of my undergrad I got full tuition academic scholarship based on my GPA at BYU.
So basically I got good enough grades at BYU to make the cut-off for full tuition.</p>

<p>I must say, half tuition was alright, but full tuition was awesome.</p>

<p>Finally, I worked. I needed money. I got a job at Jiffy Lube right when I moved up to Provo.
I worked there for about a year and a half.
It was good to learn a few things about car maintenance and customer service.
But it was also good because I needed to pay the rent, foot the grocery bill, and come up with the other half of the tuition, which was about 3K a year.
My first semester of college was pretty easy, so I worked 28-30 hours a week.
Most of the time after that I worked significantly less (15-20 hours a week), but I did what I had to to pay for my expenses and not dig myself into a financial hole.</p>

<p>I left Jiffy Lube to go work in the laundry at the Provo City Center Temple.
It was awesome. I got really good at folding pants, socks, slips, nylons, and more.
(I also got paid like 2 or 3 dollars more per hour).</p>

<p>After six months, I got a job working on the content for language learning software through a friend of a friend.
That paid another 2 or 3 dollars an hour more per hour.
A few months went by and I finagled my way into a computer programming job working on the language learning software, and I got a raise for that as well.</p>

<p>I’ll stop there, since the point of this is that I always had a job, I was always working.
I never stopped working just so I could concentrate on my school work.
I know that might work for some people if their parents are paying for their school, or they were smart and saved enough to live on during school.
Working was a necessity for me if I wanted to continue going to school and living in my apartment and eating my food.</p>

<p>Besides low tuition,  another thing to consider is the difficulty (and length) of your major.
My major - Spanish translation - is pretty easy when compared to other majors like mechanical engineering or exercise science.
It also only had 37 required credit hours, which means I finished rather quickly while still having space in my class schedule to pursue other interests (e.g. a minor in computer science, which is what I did).</p>

<p>So there you have it. In summary:</p>

<ul>
  <li>Find a college with lower tuition costs.</li>
  <li>Get good grades (in high school and college).</li>
  <li>Work - get a job (or two).</li>
  <li>Also, choose an easy major if you can; otherwise, don’t.</li>
</ul>

<p>There’s my not-so-expert advice, but it’s the best I’ve got.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[A large measure of my success is because I’m lucky. I’m lucky to have been born when and where I was born, into the family I was born into, and so on and so forth. My family’s definitely had some hardships, but we’ve never been wanting for anything. I’m also a white male, which means I probably have it easier than most. I wanted to acknowledge these facts, so keep those in mind, but now let’s move on to talking about what I did to manage my finances in college and graduate debt-free.]]></summary></entry><entry><title type="html">Summary of learning foreign languages in my life</title><link href="https://www.kimballleavitt.com/language-learning/" rel="alternate" type="text/html" title="Summary of learning foreign languages in my life" /><published>2020-08-21T00:00:00+00:00</published><updated>2020-08-21T00:00:00+00:00</updated><id>https://www.kimballleavitt.com/language-learning</id><content type="html" xml:base="https://www.kimballleavitt.com/language-learning/"><![CDATA[<p>What sparked this post: the other day I set my browser’s default language to Spanish to test something out (honestly don’t even remember what it was).
Now I get emails alerting me <em>Tu ID de Apple se acaba de usar para descargar Xcode..</em>.
Lest anyone think I actually use Xcode or prefer Apple products, I’m just gonna say it now:</p>

<ul>
  <li>I don’t use Xcode. Okay, I’ve “used” it once, and that was tonight for like 5 seconds. Never again.</li>
  <li>I use a Mac for work because that’s what they gave me.</li>
  <li>My OS of choice is definitely Linux. I run Ubuntu 20.04 and use it for everything except work.</li>
  <li>I have an Android phone.</li>
</ul>

<p>Now that we’ve veered off course a bit, here’s a quick bulleted summary of my study of languages during the first 25 years of my life.</p>

<ul>
  <li>Had Spanish in home school, mostly remember singing</li>
  <li>2nd-4th grade, Spanish immersion program</li>
  <li>8th-10th grade, took German for three years.</li>
  <li>11th-12th grade, took Spanish 3 and AP Spanish. Scored a 3 on AP Spanish test</li>
  <li>Spent 2 years speaking and studying Spanish every day in Texas on a mission for the Church of Jesus Christ of Latter-day Saints.</li>
  <li>Studied Spanish Translation at BYU, graduated with B.A. in 2019</li>
</ul>

<p>In addition to the above, I’ve had many opportunities to practice speaking Spanish in almost every job I ever had.
For example, I had native Spanish-speaking coworkers in 4 of 7 jobs. I also took care of Spanish-speaking customers at Jiffy Lube.</p>

<p>I also have always made friends from other countries and cultures and tried to learn their languages, always asking how to say things, if I’m saying things right, etc.
As I’m writing this I realize I have had less interaction with non-native English speakers recently.
To be fair, I’ve had less interaction with literally everyone since coronavirus happened, besides my wife and son of course.
Another thing I realize is I don’t really have anything on the list after graduating from BYU.
I’m going to change that. Stay tuned.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[What sparked this post: the other day I set my browser’s default language to Spanish to test something out (honestly don’t even remember what it was). Now I get emails alerting me Tu ID de Apple se acaba de usar para descargar Xcode... Lest anyone think I actually use Xcode or prefer Apple products, I’m just gonna say it now:]]></summary></entry><entry><title type="html">Racquetball canceled, what next? RUNNING</title><link href="https://www.kimballleavitt.com/running/" rel="alternate" type="text/html" title="Racquetball canceled, what next? RUNNING" /><published>2020-07-24T00:00:00+00:00</published><updated>2020-07-24T00:00:00+00:00</updated><id>https://www.kimballleavitt.com/running</id><content type="html" xml:base="https://www.kimballleavitt.com/running/"><![CDATA[<p>I decided to start running just over a month ago.
In the past few years, I haven’t really done much exercise. 
The most regular routine I’ve had in the past 4 years is racquetball twice a week for a class at BYU.
TBH I’ve taken 4 racquetball classes and I would be taking another one soon if it weren’t for the COVID-19 situation. 
Back in March when it all went down and everything started closing, my racquetball class went remote, too.
Idk if you’ve ever tried it, but remote racquetball isn’t quite as good as in-person.</p>

<p>Since March, I have mostly just sat on my rear all day, gone on evening walks with my wife and kid,
and every so often join my wife for an arm or ab workout in the morning.
Then I decided to start running again. 
For about a month, I would get up Monday morning and go run a couple miles.
Then the rest of the week - nothing.</p>

<p>Then one Sunday afternoon I was talking to my brother in law.
He’d recently lost a decent bit of weight and was looking healthy.
I asked him how he did it, and he said it was watching his calories and macro nutrients (fats, carbs, proteins).
Well, I had tried counting calories before, but didn’t stick with it for super long.
This time I figured I’d give it another go.</p>

<p>I downloaded the MyFitnessPal calorie counter app and started keeping track of everything I ate (again).
I also downloaded MapMyRun to keep track of my running times and distances. 
Turns out I could also use Samsung Health for that, but I haven’t tried it out yet.
Anyway, I kept track of my calories for 2 or 3 weeks, then slowly stopped logging everything. 
BUT, I haven’t stopped running :grin:.</p>

<p>Running has been so great.
It’s been about six weeks now that I’ve been running 3 to 5 times a week.
I usually go about 6am, give or take a few minutes. 
Most mornings it’s around 62 degrees Fahrenheit, which is a beautiful temperature if you ask me.</p>

<h3 id="stats">Stats</h3>
<p>The farthest I’ve ran this month is 6 miles, took me just over an hour.</p>

<p>The fastest mile I’ve ran this month is 7 minutes and 35 seconds.</p>

<p>The fastest three miles I’ve ran this month is 26 minutes and 27 seconds (averages of 8:48 per mile).</p>

<p>The total distance I’ve ran this month so far is 46.2 miles.</p>

<p>The other day I saw someone on Twitter say they were running 100km to support some charitable cause.
I think that’s very noble. I’m not supporting any specific cause with my running, but I liked the idea of 100km.
It’s a nice even number.
So that’s my goal by the end of July 2020 - run at least 100km.
100km is about 62.something miles, so I have about 16 miles left to run in the next week.
I’ll make sure to come back and add a quick update about how I did, and my new stats and whatnot.</p>

<h1 id="update">Update</h1>

<p>I did it! (picture forthcoming, once I find it)</p>]]></content><author><name></name></author><summary type="html"><![CDATA[I decided to start running just over a month ago. In the past few years, I haven’t really done much exercise. The most regular routine I’ve had in the past 4 years is racquetball twice a week for a class at BYU. TBH I’ve taken 4 racquetball classes and I would be taking another one soon if it weren’t for the COVID-19 situation. Back in March when it all went down and everything started closing, my racquetball class went remote, too. Idk if you’ve ever tried it, but remote racquetball isn’t quite as good as in-person.]]></summary></entry><entry><title type="html">The Oddities of Go (compared to other programming languages)</title><link href="https://www.kimballleavitt.com/odd-go/" rel="alternate" type="text/html" title="The Oddities of Go (compared to other programming languages)" /><published>2020-07-19T00:00:00+00:00</published><updated>2020-07-19T00:00:00+00:00</updated><id>https://www.kimballleavitt.com/odd-go</id><content type="html" xml:base="https://www.kimballleavitt.com/odd-go/"><![CDATA[<p>I’ve been learning Go recently so I thought it’d be useful to write a bit about 
what has been new for me (and sometimes even strange).
Most of my prior experience has been Python, Javascript, C, C++, and Java,
so there are some things about Go that are very different from all of those.</p>

<p>For now, I’ll make a skeleton list and fill out each section when I have time.</p>

<h2 id="hello-world-in-go">Hello World in Go</h2>

<p>To get you familiar with the syntax of Go, here’s an example program that prints 
“Hello World!”</p>

<div class="language-go highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">package</span> <span class="n">main</span>

<span class="k">import</span> <span class="s">"fmt"</span>

<span class="k">func</span> <span class="n">main</span><span class="p">()</span> <span class="p">{</span>
  <span class="n">fmt</span><span class="o">.</span><span class="n">Println</span><span class="p">(</span><span class="s">"Hello World!"</span><span class="p">)</span>
<span class="p">}</span>
</code></pre></div></div>

<h2 id="packages">Packages</h2>

<p>Go is organized into packages. Every go file has to belong to a package.
If you’re wondering, this is much less irksome than Java’s requirement that everything belong to a class.
To say what package a Go file is in, you put <code class="language-plaintext highlighter-rouge">package &lt;packagename&gt;</code> at the top.
Every package is confined to a directory, meaning you can’t have .go files with different package names in the same directory.
The main package is called <code class="language-plaintext highlighter-rouge">main</code>, which is the oddest of all.</p>

<p>That’s all I’m going to say for now about packages.
Nothing too odd there, but it’s helpful background for the next section.</p>

<h2 id="privatepublic">Private/public</h2>

<p>Many languages have some kind of way to specify whether a variable, function, variable, or class
is public or private (or protected, etc).
In C++ and Java, you use key words like <code class="language-plaintext highlighter-rouge">private</code> and <code class="language-plaintext highlighter-rouge">public</code> to make this distinction. 
Python typically uses underscores to signify private, or at least you shouldn’t rely on it as part of
its public API, but it’s not enforced by the language. 
In Go, “private” things start with a lowercase letter, while “public” things start with uppercase letters.
A package only exports the identifiers (variables, functions, etc) that start with an uppercase letter.
All identifiers declared in a package are available throughout that package, whether they start with upper or lowercase.</p>

<p>Let’s do a little example.</p>

<p>Here are the contents of <code class="language-plaintext highlighter-rouge">example1.go</code>:</p>

<div class="language-go highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">package</span> <span class="n">example</span>

<span class="k">var</span> <span class="n">myPrivateThing</span> <span class="o">=</span> <span class="s">"asdf"</span>

<span class="k">var</span> <span class="n">MyPublicThing</span> <span class="o">=</span> <span class="s">"jkl;"</span>
</code></pre></div></div>

<p>In this case, <code class="language-plaintext highlighter-rouge">myPrivateThing</code> is available throughout <code class="language-plaintext highlighter-rouge">package example</code>.
If I had another file <code class="language-plaintext highlighter-rouge">example2.go</code>, I could access everything defined in <code class="language-plaintext highlighter-rouge">example1.go</code>.</p>

<div class="language-go highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">package</span> <span class="n">example</span>

<span class="k">import</span> <span class="s">"fmt"</span>

<span class="k">func</span> <span class="n">printSomething</span><span class="p">()</span> <span class="p">{</span>
  <span class="n">fmt</span><span class="o">.</span><span class="n">Println</span><span class="p">(</span><span class="n">MyPublicThing</span><span class="p">)</span> <span class="c">// success</span>
  <span class="n">fmt</span><span class="o">.</span><span class="n">Println</span><span class="p">(</span><span class="n">myPrivateThing</span><span class="p">)</span> <span class="c">// success</span>
<span class="p">}</span>
</code></pre></div></div>

<p><code class="language-plaintext highlighter-rouge">MyPublicThing</code> could be accessed from any package that imports <code class="language-plaintext highlighter-rouge">package example</code>, but <code class="language-plaintext highlighter-rouge">myPrivateThing</code> cannot.
Here’s an example of that in a theoretical <code class="language-plaintext highlighter-rouge">main.go</code>:</p>

<div class="language-go highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">package</span> <span class="n">main</span>

<span class="k">import</span> <span class="p">(</span>
  <span class="s">"fmt"</span>
  <span class="s">"some/path/to/example"</span>
<span class="p">)</span>

<span class="k">func</span> <span class="n">main</span><span class="p">()</span> <span class="p">{</span>
  <span class="n">fmt</span><span class="o">.</span><span class="n">Println</span><span class="p">(</span><span class="n">example</span><span class="o">.</span><span class="n">MyPublicThing</span><span class="p">)</span> <span class="c">// succeeds</span>
  <span class="n">fmt</span><span class="o">.</span><span class="n">Println</span><span class="p">(</span><span class="n">example</span><span class="o">.</span><span class="n">myPrivateThing</span><span class="p">)</span> <span class="c">// error</span>
<span class="p">}</span>
</code></pre></div></div>

<h2 id="declaring-variables">Declaring variables</h2>

<p>When you declare a variable in C or C++, it might look something like this:</p>

<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
</code></pre></div></div>
<p>In Go, you can achieve the same like so:</p>

<div class="language-go highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">var</span> <span class="n">i</span> <span class="o">=</span> <span class="m">1</span>
</code></pre></div></div>
<p>In this case, the Go compiler is smart enough to figure out that <code class="language-plaintext highlighter-rouge">i</code>is an <code class="language-plaintext highlighter-rouge">int</code>.
There are a few other ways to declare variables in Go.
For example, you can declare the type explicitly:</p>
<div class="language-go highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">var</span> <span class="n">i</span> <span class="kt">int</span>
</code></pre></div></div>
<p>and then define it later:</p>
<div class="language-go highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">i</span> <span class="o">=</span> <span class="m">1</span>
</code></pre></div></div>
<p>There’s also this nice shorthand operator you can use that you’ll likely see more often than not in Go source code:</p>
<div class="language-go highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">i</span> <span class="o">:=</span> <span class="m">1</span>
</code></pre></div></div>
<p>This means something like <em>declare the variable *i*, and make it equal to 1</em>.</p>

<h2 id="semi-colons">Semi-colons?</h2>
<p>Unlike C, C++, and Java, you almost never need to use semi-colons in Go (but you can).
Technically, Go uses semi-colons to terminate statements, but <a href="https://golang.org/doc/effective_go.html#semicolons">the lexer inserts most of them for you</a>.
This takes some getting used to.
Semi-colons are probably the thing I mess up the most often when switching between languages.</p>

<h2 id="function-signatures">Function signatures</h2>
<p>The signature of a function is basically what you would include in a C or C++ header file.
It defines the return type of the function (<code class="language-plaintext highlighter-rouge">void</code>, <code class="language-plaintext highlighter-rouge">int</code>, <code class="language-plaintext highlighter-rouge">char *</code>, etc), the function’s parameters (if any), and the name of the function.</p>

<p>For example, here’s a C function that tells you if one number is divisible by another number:</p>
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">int</span> <span class="nf">isDivisibleBy</span><span class="p">(</span><span class="kt">int</span> <span class="n">dividend</span><span class="p">,</span> <span class="kt">int</span> <span class="n">divisor</span><span class="p">)</span>
<span class="p">{</span>
    <span class="k">return</span> <span class="n">dividend</span> <span class="o">%</span> <span class="n">divisor</span> <span class="o">==</span> <span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>
</code></pre></div></div>
<p>In Go, it would look like this:</p>
<div class="language-go highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">func</span> <span class="n">isDivisibleBy</span><span class="p">(</span><span class="n">dividend</span> <span class="kt">int</span><span class="p">,</span> <span class="n">divisor</span> <span class="kt">int</span><span class="p">)</span> <span class="kt">int</span> <span class="p">{</span>
    <span class="k">return</span> <span class="n">dividend</span> <span class="o">%</span> <span class="n">divisor</span> <span class="o">==</span> <span class="m">0</span>
<span class="p">}</span>
</code></pre></div></div>

<p>A few differences to note:</p>
<ul>
  <li>When you write a function in Go, you use the word <code class="language-plaintext highlighter-rouge">func</code>.</li>
  <li>The types of the parameters come <em>after</em> their names, whereas in C the types come before the names</li>
  <li>The return type of the function comes after the parameter list, and before the open curly brace.</li>
</ul>

<p>The above function could also be written like this:</p>
<div class="language-go highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">func</span> <span class="n">isDivisibleBy</span><span class="p">(</span><span class="n">dividend</span><span class="p">,</span> <span class="n">divisor</span> <span class="kt">int</span><span class="p">)</span> <span class="kt">int</span> <span class="p">{</span>
    <span class="k">return</span> <span class="n">dividend</span> <span class="o">%</span> <span class="n">divisor</span> <span class="o">==</span> <span class="m">0</span>
<span class="p">}</span>
</code></pre></div></div>
<p>Notice this time I didn’t include the first <code class="language-plaintext highlighter-rouge">int</code>. If you don’t include the type of a parameter, it will take the type of the next parameter to the right that has a type.
So if you have 100 parameters and they’re all of type <code class="language-plaintext highlighter-rouge">string</code>, you only have to write <code class="language-plaintext highlighter-rouge">string</code> for the very last (rightmost) one.</p>

<h2 id="naked-returns-and-named-return-parameters">Naked returns and named return parameters</h2>

<p>This is one of the oddest parts of Go syntax (or coolest, depending on your point of view).</p>

<p>Take the following function in Go:</p>
<div class="language-go highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">// Max takes a slice (a.k.a. a list) of ints, and returns the one with the largest value </span>
<span class="c">// If the slice is empty, it will return an error</span>
<span class="k">func</span> <span class="n">Max</span><span class="p">(</span><span class="n">numbers</span> <span class="p">[]</span><span class="kt">int</span><span class="p">)</span> <span class="p">(</span><span class="kt">int</span><span class="p">,</span> <span class="kt">error</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">var</span> <span class="n">max</span> <span class="kt">int</span>
    <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">numbers</span><span class="p">)</span> <span class="o">==</span> <span class="m">0</span> <span class="p">{</span>
        <span class="k">return</span> <span class="n">max</span><span class="p">,</span> <span class="n">errors</span><span class="o">.</span><span class="n">Error</span><span class="p">(</span><span class="s">"Slice is empty!"</span><span class="p">)</span>
    <span class="p">}</span>
    <span class="n">max</span> <span class="o">=</span> <span class="n">numbers</span><span class="p">[</span><span class="m">0</span><span class="p">]</span>
    <span class="k">for</span> <span class="n">_</span><span class="p">,</span> <span class="n">n</span> <span class="o">:=</span> <span class="k">range</span> <span class="n">numbers</span><span class="p">[</span><span class="m">0</span><span class="o">:</span><span class="p">]</span> <span class="p">{</span>
        <span class="k">if</span> <span class="n">n</span> <span class="o">&gt;</span> <span class="n">max</span> <span class="p">{</span>
            <span class="n">max</span> <span class="o">=</span> <span class="n">n</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="k">return</span> <span class="n">max</span><span class="p">,</span> <span class="no">nil</span>
<span class="p">}</span>
</code></pre></div></div>

<p>As the comment says, this is a simple (naive) function to get the max value of a slice (a slice is kind of like an array or a list).
It has multiple return values: an <code class="language-plaintext highlighter-rouge">int</code>, and the other is Go’s builtin <code class="language-plaintext highlighter-rouge">error</code> type.
Multiple return values in Go is very common.
It’s also very common for one of them to be <code class="language-plaintext highlighter-rouge">error</code>.</p>

<p>To illustrate what I mean by “naked returns” I’m going to rewrite the function slightly:</p>

<div class="language-go highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">func</span> <span class="n">Max</span><span class="p">(</span><span class="n">numbers</span> <span class="p">[]</span><span class="kt">int</span><span class="p">)</span> <span class="p">(</span><span class="kt">int</span><span class="p">,</span> <span class="kt">error</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">var</span> <span class="n">max</span> <span class="kt">int</span>
    <span class="k">var</span> <span class="n">err</span> <span class="kt">error</span>
    <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">numbers</span><span class="p">)</span> <span class="o">==</span> <span class="m">0</span> <span class="p">{</span>
        <span class="n">err</span> <span class="o">=</span> <span class="n">errors</span><span class="o">.</span><span class="n">Error</span><span class="p">(</span><span class="s">"Slice is empty!"</span><span class="p">)</span>
        <span class="k">return</span>
    <span class="p">}</span>
    <span class="n">max</span> <span class="o">=</span> <span class="n">numbers</span><span class="p">[</span><span class="m">0</span><span class="p">]</span>
    <span class="k">for</span> <span class="n">_</span><span class="p">,</span> <span class="n">n</span> <span class="o">:=</span> <span class="k">range</span> <span class="n">numbers</span><span class="p">[</span><span class="m">0</span><span class="o">:</span><span class="p">]</span> <span class="p">{</span>
        <span class="k">if</span> <span class="n">n</span> <span class="o">&gt;</span> <span class="n">max</span> <span class="p">{</span>
            <span class="n">max</span> <span class="o">=</span> <span class="n">n</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="k">return</span>
<span class="p">}</span>
</code></pre></div></div>

<p>You’ll notice I changed three lines:</p>
<ul>
  <li>I added the line that declared <code class="language-plaintext highlighter-rouge">err</code> (<code class="language-plaintext highlighter-rouge">var err error</code>)</li>
</ul>

<p>… Oops, out of time. I’ll finish this section later this week.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[I’ve been learning Go recently so I thought it’d be useful to write a bit about what has been new for me (and sometimes even strange). Most of my prior experience has been Python, Javascript, C, C++, and Java, so there are some things about Go that are very different from all of those.]]></summary></entry><entry><title type="html">A blog is born</title><link href="https://www.kimballleavitt.com/a-blog-is-born/" rel="alternate" type="text/html" title="A blog is born" /><published>2020-07-16T00:00:00+00:00</published><updated>2020-07-16T00:00:00+00:00</updated><id>https://www.kimballleavitt.com/a-blog-is-born</id><content type="html" xml:base="https://www.kimballleavitt.com/a-blog-is-born/"><![CDATA[<p>Welcome to my blog. Let me give a quick introduction.
I’m not planning on writing much today, so don’t get too excited.</p>

<p>If you’re interested in making your own blog and you like the look of this one,
I forked <a href="https://github.com/barryclark/jekyll-now/">jekyll-now</a> to get up and running with Github Pages.
It was super easy to setup, so thanks to everyone who’s worked on that.</p>

<s>Also, I felt like it would be nice to have some sort of tagging mechanism to make it easier to group posts into different categories.
After some quick googling, I found [this site](https://codinfox.github.io/dev/2015/03/06/use-tags-and-categories-in-your-jekyll-based-github-pages/)
that I ended up using as a reference.</s>
<p>I remove tagging, seemed kinda bloaty, especially for how often I post.</p>

<p>I may add some more styling to the blog as it goes on, and I haven’t decided about comments yet.</p>

<p>For now, expect to see some posts coming soon about <a href="https://golang.org">Go</a>, <a href="https://python.org">Python</a>, and the Domain Name System (DNS).
I’m also planning on posting about open source project ideas that I think of or hear about.</p>

<p>Stay tuned!</p>]]></content><author><name></name></author><summary type="html"><![CDATA[Welcome to my blog. Let me give a quick introduction. I’m not planning on writing much today, so don’t get too excited.]]></summary></entry></feed>