Advent of code

as you know advent of code is coming up:

now i did a few of the puzzles and thought they were great fun, but i was A LOT :smile: slower, than those guys and gals who made it to the leaderboard. but you know, so far, in due time, i was able to figure them all out, - eventually -. :smile:

…anyway, this advent of code business got me thinking, got me thinking about the preface of HTDP:

No, this book won’t turn anyone into a master painter. But, we would not have spent fifteen years writing this edition if we didn’t believe that

everyone can design programs


everyone can experience the satisfaction that comes with creative design.

Indeed, we go even further and argue that

program design—but not programming—deserves the same role in a liberal-arts education as mathematics and language skills.

now personally i couldn’t agree more!

but also i would like to point out, that often when we think about the practical skills involved in / needed for solid programming, perhaps we do tend to ( erroneously? ) have those kinds of puzzles in mind too much?

now if one thinks about it, to solve such a puzzle takes only a few minutes, perhaps a few hours, but it certainly is not gonna be relevant to you for years and decades to come, right?

now compare this to what you find in real world programming projects! if you go with a quick and dirty solution, it may work for right now, but you are going to have deal with that ( accumulating ) technical debt somewhere down the road. ( or the people who come after you will :smile: )

( then again:


anyway, the point is, that often times i feel like we underestimate the importance of diligence and such qualities in programmers. For example, think about the importance of tests and documentation. those things do matter a great deal over the long haul, yet, and let’s be honest here, they ain’t exactly fun!

coming back to the advent of code type of puzzle, because they are such small and short lived problems, it really doesn’t matter too much how you solve them, right? still, i hear it is not uncommon for such things to be used in job-interviews. maybe they will ask you to take part in a pair-programming thing?.. solving a number of those problems…

again, personally i do have sort of mixed feelings about that logic, ( i suppose subconsciously i might be drawn to that attitude / conclusion since, and again, i tend to perform rather poorly at these :smile: - fortunately i got my job regardless :smile: - ) for would it not make more sense to focus on the work that people have done on larger projects in the past? something that they worked on for a substantial amount of time?

hmm… idk… anyway… what do you think about those kinds of finger exercises?

1 Like

Because each puzzle consists of 2 parts it allows me to practice refactoring. Usually, after solving both parts I review the code and try to find common concepts. I’ve learned to write more unit tests than necessary to solve the puzzle because they help me to refactor code later.

Also after refactoring sometimes I profile the code if I don’t like how slow it works. This is another design exercise of trying to keep functionality but improve the speed. It also helps to build my intuition on how fast the code should run.

Last year of AOC was a bit different because of an IntCode Computer that we have developed across 25 days. This time I have also practiced API design because the same computer was used for different purposes in different puzzles.

In general, after solving the puzzle I spend another 15min to a couple of hours exploring alternatives. I find it very productive to learn new approaches without the pressure of deadlines and code reviews.


first of all i would like to thank you for sharing your very interesting take on things.

second of all, seams to me that your post provides us with a perfect example of what is meant by such expressions as:

  • you will get out, what you put in!
  • if you’re in pursuit of excellence, you gotta go that extra mile!

also, after reading about how methodically you hone your programming skills, i found myself all pumped up and ready for another puzzle! :wink: :+1:


so, i have been doing a few more of these puzzles. :smile:

also, have done a little bit of “research” about this sort of thing… and so i thought, maybe i could share two findings that seamed fairly interesting to me.

so for example,… because of advent of code, i have found out about this super INCREDIBLE and AWESOME person:

but also, i have stumbled across the following on youtube:

I wouldn’t find that too surprising. Generally to get better at something you need to do the thing multiple times over and over. And Competitive Programming works great for that.

The issue is that in Competitive Programming you are practicing:

  • Basic Algorithm Skills
  • Basic Math Skills
  • Basic Programming Skills
  • Typing Speed Skills
  • Basic Debugging Skills

That’s what you do over and over in order to get faster at it.

And I think it probably works to become better at those skills. But look how each skill is focused only on a basic understanding, and how it’s missing critical skills for software engineering, such as:

  • Leadership
  • Communication (written and spoken) (in person and to a group) (with other technical experts as well as layman)
  • Dependability
  • Teamwork
  • Humbleness (and ability to take feedback and criticism positively)
  • Attention to Details
  • Code structure
  • Code readability
  • Code adaptability over changing requirements
  • Code evolvability
  • Code testability
  • Code reuse
  • Software Operational delivery, maintainance, servicing and design
  • Software Integration
  • Software Design around constraints of costs, time, scale, and resources (human and hardware).
  • Requirements gathering and building the right thing
  • Opportunity Cost
  • Etc.

So my take is, Competitive Programming are great for people getting basic competencies in computer science fundamentals, and so high school students, college students maybe. But at some point, your practice should shift to things that cover other skills, there’s no real need to get really fast at coding, for coding is one of those discipline where the adage: “work smart not hard” really applies. Slow and steady is often the pace that leads to the best results.

So you’ll want to transition in intermediate and advance algorithms, like distributed systems algorithms, ML algorithms, advance data-structures like Clojure’s persistent collections, or thread-safe collections, etc. If you want to push the envelope in finding new solutions to hard problems, you’ll probably need to push your math skills to be pretty advance in some areas. Your programming skills will need to start to focus on larger piece of software that have user interfaces and maybe run on multiple nodes, with thousands if not million of lines of code worked by different people. You’ll need to not just have good typing skills, but learn higher level developer tools and their shortcuts, get acquainted with IDEs, REPLs, Linters, Source Control, Issue Trackers, Sprint Boards, etc. You’ll want your debugging skills to include root cause analysis, logging, metrics, debugging Garbage Collection issues, thread races, issues due to the running environment, etc.

And all the other skills I listed above as well.

And from what I know of Competitive Programming, it does not have you practice those. So if I go back to my student days, it feels a lot like spending too much time studying the early chapters, at the detriment of the later (and often harder) ones.

Edit: But due to the interview process in industry, it sure does help to land a job!

1 Like

What’s HTDP?

From what I’ve seen of contest problems, that’s not always true. There tends to be some NP complete thing or some tricky graph traversal nested in the problem somewhere. The top competitors seem to need to have a pretty extensive bag of algorithm tricks at their disposal.

The telling thing for me is reading about why so many competitors prefer C++. They abuse preprocessor macros to reduce typing errors and increase speed of typing. They end writing overly terse, clever code that nobody else would be able to understand. To the point it seems like standard practice to rename commonly used types and syntaxes. You’ll see for loops written like f(i,0,10,1){} and types like “long long” written as ll.

I’m not sure what the underlying theory is, but I feel like being a good competitive programmer is like being a long drive competitor in golf. It seems like it should translate well to the real game, but for some reason just doesn’t.


@plexus How to design programs

1 Like

yeah that one. wonderful book! ( imho )

1 Like

so… i have given this topic quite some thought now, :smile: … still:

Da steh’ ich nun, ich armer Tor,
Und bin so klug als wie zuvor!

i mean, clearly this matter of discussion does invite one to ponder the relevance of one’s performance at school on one’s performance on the actual job one has been trained for. ( :frowning: such a tricky question!!! :frowning: )

in any case, for me personally, i have found those puzzles to be super useful for brushing up certain types of programming skills. so, not only are they fun, but they can also be highly instructive!

in fact i have even found now an entire programming course held at MIT, that is build on this very concept of learning about programming by solving puzzles:

so… what is the daily bread of the JS/07 M 378 programmer?.. and would doing that course be terribly beneficial to his / her career? …again… irdk… BUT! does it even matter that much?

i mean, doesn’t this kind of rational about “usefulness” all too often end up misused as part of an attack on the liberal arts / basic research?

so what if the word school derives from the Greek word σχολή? ( meaning “leisure” )
so what if competitive programming isn’t necessarily gonna maximize the GDP?

bottom line. this stuff is super fun and well worth spending some on time on! imho.

p.s. you may have seen that i did a post on Darwin earlier, but deleted it again, because, although i don’t believe it was utter rubbish, unfortunately, i had to realize, that it suffered from a painful lack of sophistication in certain areas of the argument. :frowning: ( just in case you were wondering. )

now youtube is already suggesting to me that i should check out the following:

i guess that it would know that… - SPOT ON - hmm… that is both cool and scary at the same time :smile:

anyway, just thought you might also be interested.

( Happy third Sunday of advent! )

@plexus come on!!! why would you not mention this?!

anyway,… THIS IS AWESOME!!! thank you for doing these! :+1:

1 Like

I kind of did :slight_smile:

Advent of Code Live Stream

1 Like