… kann man gut beim Programmieren.

Wenn ich fertig bin mit einem Projekt, dann schaue ich mir alles nochmal an und kommentiere den Code.
Das hørt sich jetzt total vorbildlich an, aber ich muss mir selbst Motivationsnachrichten schreiben:

# Comment the program. Really! Please do this. I know it takes time,
# but it is good style and you know that you’ll regret it if you don’t do
# it! And you even did it for [insert long and tedious project here]!
# And most of it is just a short description of what the functions do, anyway.

Denn wenn etwas fertig ist, dann hab ich meist nicht so richtig Lust, mich mit dem Code noch viel laenger zu beschaeftigen, da alles Interessante ja schon fertig ist.

Bisher habe ich es aber dann doch immer gemacht. Bin ich doch auch immer stolz auf Projekte, die sich ueber mehrere Monate hingezogen haben.

Die Kommentare sind vor allem allgemeiner Natur, was eine Funktion, Klasse oder Methode macht.

„Programmiertricks“ hingegen kommentiere ich ueblicherweise schon wenn ich diese schreibe, ansonsten vergesse ich naemlich, was ich da mache.
Aber ab und zu vergesse ich das, oder es scheint mir total sinnvoll und nicht kommentierwuerdig zur Zeit des Schreibens des Codes.
Meist stimmt das auch, aber manchmal nicht. Und das fuehrt dann zu lustigen Kommentaren wie diesem hier:

# To be honest, while writing this comment I could not totally
# see through the algorithm here. I remember that it took me quite a
# while to figure that one out and it works. But don’t ask me
# any longer what I’m doing here.

Ebenso versuche ich Funktionen, Methoden und Klassen immer selbsterklaerende Namen zu geben, auch wenn die dann mal laenger werden.
Meistens klappt das. Manchmal aber nicht und das fuehrt dann auch zu lustigen Kommentaren:

# I don’t know why I gave this method such a name. It probably made
# total sense when I programmed it.

Tihihi … die Freuden des Programmiererlebens.

Leave a Reply