Please don’t rely on this Gitea instance being around forever. If any of your build scripts use my (kageru’s) projects hosted here, check my Github or IEW on Github for encoding projects. If you can’t find what you’re looking for there, tell me to migrate it.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
6.9 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<a href="/blog">
{% load static %}
<div class="bottom_right_div"><img src="{% static '2hu.png' %}"></div>
<div class="wrapper_article">
<p class="heading" style="line-height: 1.1em">Challenges for the Advent of Code or<br>“How to Bite Off More Than You Can Chew, but not too much”</p>
<div class="content">
<p class="subhead"><a href="#c_introduction" id="c_introduction">Introduction</a></p>
Humans love challenges.<br>
We want to prove something to our friends, our coworkers, our peers, or even just ourselves.<br>
We want to push ourselves to our limits, maybe even beyond them, and grow into more than what we are.<br>
We want to show the world that we can do something, whatever that may be.<br>
We want to get just a tiny bit closer to the optimal version, to the person we could become.<br>
Thats one reason to do Advent of Code. The other — and much more common — is probably just boredom.<br>
For those unaware: Advent of Code is like an advent calendar where theres a coding task hidden behind each door. You receive a randomized input (actually a randomly selected one from a precomputed set because they cant store and solve a new puzzle for every user), and you have to enter your solution on the website. How you get that solution doesnt matter. That should give you a basic idea. Onto the actual content of this.
<p class="subhead"><a href="#c_leaning" id="c_leaning">Learning From Past Experiences</a></p>
Last year, I failed the Advent of Code. And not just a little bit. I really mean I failed.
I wanted to use it as an opportunity to learn Haskell, so my plan was to implement all 24 tasks in Haskell.
This should, in theory, give me enough practice to understand the basics and become at least reasonably comfortable in the language.
Reality was… not quite that.<br>
Not only did I not finish even <em>a single</em> puzzle in Haskell, but it deterred me from even trying to learn any functional language for quite a while (that is, until today and ongoing).
I then switched to Nim because reasons, but I didnt finish all 24 in that either. I ended up skipping ~70% of all days.
What do we learn from that?<br>
Well, for one, we shouldnt just plan tasks of completely unknown complexity. “It will be alright” is not how you approach software. Ive done that, and it works more often than it should, but this is really a case where it was just silly.
For two, (I know thats not how english works; dont @ me) I needed variety. Just picking one language may work for other people and its certainly useful if you want to learn that language, but it wasnt enough to keep me motivated.
<p class="subhead"><a href="#c_forward" id="c_forward">Going Forward</a></p>
So what did I change this year? Simple.
<li title="yes, I still cant into functional programming">I will not use programming paradigms that are completely alien to me</li>
<li>I will use more than just one language to keep things interesting</li>
<li>I will brag as openly as possible about my plans so people can publicly shame me for not following them</li>
I know that there are people who try “24 days, 24 languages”, but Im not quite that insane. For me, 8 languages should be enough. Im giving myself three tickets for each language. It is up to me which language I will use for any given day, as long as I have at least one ticket left for that language.<br>
Ive created a git repo for this challenge <a href="">here</a>.<br>
The number of remaining tickets for each language can be tracked in the <code></code> file.<br>
Edit: looks like there are 25 Days, and I misjudged a few things, so I had to change my plans here on day one. Still keeping this section, just because.<br>
The languages I have chosen are (in alphabetical order):
That puts us at 6 compiled and 2 interpreted languages. Out of these, I would rate myself the most proficient in Python and the least proficient in C. Contrary to popular belief, you can be a software developer <span title="Just for the sake of the stupid pun, I just opened a terminal and ran “touch c”. Kill me pls.">without ever having touched C</span>.<br>
<br>I would like to add that Im not necessarily a fan of all of these, especially Java. However, since Im currently working on a ~1,000,000 loc Java project as my fulltime job, not including it here just felt wrong.<br>
To show my remorse and to give me a very early impression of the suffering that this decision will bring with it, Im typing this paragraph in <a href="">ed, the default editor</a>.
It really is quite the experience. The creativity of the people who wrote it is admirable. You wouldnt believe how many convenience features you can add to an editor that only displays one line at a time. (Let me also remind you that ed was used before monitors were a thing, so printing lines wasnt free either.)
This is, unironically, a better editor than most modern default editors (referring mostly to Windows Notepad and whatever OS X uses).<br>
Oh, and ed supports regex. Everything is better if it supports regex. But I digress.
Apart from the JVM languages, Ill write all of the solutions in vim, using only Syntastic and the languages respective command line compilers.
Java is just too verbose to be used without introspection and autocompletion. At least for my taste.
vim can be really cool to use, and I love it for most languages, but Java is just not one of them. Still typing this in ed, btw. :^)
If I come across a solution that seems particularly interesting to me, I might share it here, but I doubt that will happen.
Lets see how far I can get this year. Expect a recap of this years inevitable failure here around the end of the year.
Edit: after finding out that JS has basically no consistent way of reading files, I removed that from the list. Its garbage anyway, and Im not writing node.js. Since all of this doesnt really work with 25 days either, Ive also decided to drop two more languages to get me to 5x5.<br>
That left me with C, Go, Kotlin, Python, and Rust. 5 days each.
<span class="ninjatext">I thought about including Haskell in this list, but I decided not to repeat history… at least for now</span>