programming

Information related to computer programming

A definition of DRY in programming

Last night I was reading the classic old book, The Pragmatic Programmer, and came across this definition of DRY, an acronym that stands for Don’t Repeat Yourself:

“Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.”

That’s well stated, especially after a recent experience in which I found some code where I created an “Add Widget” dialog in a different way than I created its related “Edit Widget” dialog. I created the main pane of the dialog the same way, but I managed the details of the two dialogs that contained that pane differently, and I realized what I had done when I decided to make the dialog resizable. When I discovered what I had done, I refactored the code so both the Add and Edit dialogs were created by a single method.

AlphaZero generalized to learn more games by itself

From this Cornell University page, Google’s AlphaZero algorithm has been generalized to learn new games given only the game rules: “In this paper, we generalise this approach into a single AlphaZero algorithm that can achieve, tabula rasa, superhuman performance in many challenging domains.

Programmer’s Christmas

Programmers can celebrate Christmas on Halloween:

31 oct = 25 dec

(3*8 + 1) == (2*10 + 5)