category: apprenticeship

Nov 27, 2016

The Open-Closed Principle

From all the SOLID principles, I think that the “O” is the most difficult to understand. The definition of the Open-Closed Principle (OCP) says that Software entities (classes, modules, functions etc) should be open for extension, but closed for modification. We use the design principles in order to be able to adapt for future changes without having to modify existing code, so that definition seems redundant and unhelpful.

Oct 21, 2016

Negamax in Scala

The Scala evaluation method makes it more efficient to use immutable values, but it still give us the chance to easily deal with mutable data. It is possible to write a program following the Functional Programming paradigm while being able to rely on mutable variables. Thanks to that, it is reasonably easy to implement the negamax with alpha beta pruning algorithm, improving the performance of an unbeatable computer in a Tic Tac Toe game.

Sep 1, 2016

Getting started with Vim

I tried to use Vim a couple of times before and I never went very far. It felt overly complicated and other code editors would do the job just fine. None of the reasons to use it — it has a lot of plugins, you’ll be very fast when you get used to it — seemed good enough. Other editors also have tons of plugins and you can be fast when you get used to them. But then, the real reason to use it came up.