0207|09|
2007|09|10|12|
2008|01|02|03|
2009|01|05|08|10|11|12|
2010|01|02|03|04|09|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|03|04|05|06|07|08|10|11|12|
2013|01|02|03|04|05|06|07|08|09|10|11|12|
2014|01|02|03|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|08|09|10|11|12|
2016|01|02|03|04|05|06|07|08|09|10|11|12|
2017|01|02|03|04|05|06|07|08|09|10|11|12|
2018|01|02|03|04|05|06|07|08|09|10|11|12|
2019|01|02|03|04|05|06|07|08|09|10|11|12|
2020|01|02|03|04|05|06|07|08|09|10|11|12|
2021|01|02|03|04|05|06|07|08|09|10|11|12|
2022|01|02|03|04|05|06|07|08|09|10|11|12|
2023|01|02|03|04|05|06|07|08|09|10|11|12|
2024|01|02|03|04|

2019-02-25 // グローバル変数でいいじゃないか [長年日記]

毎年、この時期になると、追い込まれたかのようにコーディング(プログラミング)をやることになります。

Every year, at this time, I have to code (programming) as if I were driven.

最近は、毎日10時間くらい(週末も含めて)、ぶっつづけでディスプレイを睨みつけています。

Recently, I have been staring at the display for about 10 hours every day (including weekends).

しかし、私のコードは、製品開発を行うもの(製品プログラム)ではなく、自分の立てたシステムの仮説を検証(検証用プログラム)するもの、として使うことがほとんどです。

However, my code is not for a product development ("product program"). They are mostly used as one that verifies the hypothesis of your own system ("verification program").

検証用プログラムは、多くの場合、

The verification program, in many cases,

■多人数のチームで開発するものではなく、

- is not developed by a multi-player team,

■そのコードを使うのは自分だけで、

- is used by myself,

■多くの場合、過去のコードの再利用などはしない

- in many cases, nobody will reuse the past code

ということです。

特に「再利用」という観点では、「過去のコードの再利用」ではなく、「過去の私のコードの記憶」だけが頼りになります。

Especially, from the viewpoint of "reuse", not "reuse of past code" but only "past memories of my code" is reliable.

私のコードを、赤の他人が再利用するというケースは、ほとんどありえません。

It is a rare case to reuse my code by another red person.

という訳で、現在は時間優先、確認作業優先で、雑なコードを書きまくっています。

So, now I am making code with "writing priority", "time priority", and "confirmation priority".

「3日日で1000step越え」など、ザラです。

"Three days a day over 1000 steps", is normal for me.

-----

で、その「雑なコード」の後ろめたさが、私のコードのコメントの中に、山ほど埋めこまれています。

So, the backwardness of that "cumbersome code" makes me write many comments in my codes.

それらの「言い訳コメント」を、見るとなかなか楽しいです。

It is fun to watch those "excuses comments".

// グローバル変数でいいじゃないか

"Is there a problem with global variables?"

// 「なんでもサブルーチン」はやめよう

"Let's stop "anything subroutine""

// 引数の型探しで苦労するのは、時間の無駄

"Troublesome searching for argument types is wasting time"

// メインルーチンの中で、ループ作ったほうが、デバッグで楽できる

"In the main routine, making a loop makes is easier to debug"

// メモリ潤沢にあるんだから、スタティックに十分大きな領域を確保しておけはいいんじゃない

"Since memory is abundant, it is no problem to secure a sufficiently large area statically"

// 「コードを使いたい」という奴は山ほどいたけど、実際に「コード」の送付要求なんて、一度もなかったし

There were many people saying "I want to use the code", but there was never actually a request to send a "code"

-----

過去の(そして現在の)自分の仕事の「追い込まれっぷり」が見えて、なかなか楽しいです。

It is fun to watch past of (and the current) my driven work,