Learning to Programを進める

Introduction - What, Why, Who etc.
What do I need?
What is 'Programming'?

>>We already said that programming was the art of making a computer do what you want, but what is a program?

>>In fact there are two distinct concepts of a program. The first is the one perceived by the user - an executable file that is installed and can be run repeatedly to perform a task. For example users speak of running their "word processor program". The other concept is the program as seen by the programmer, this is the text file of instructions to the computer, written in some programming language, that can be translated into an executable file. So when you talk about a program always be clear about which concept you mean.

IDLE

>> 'line 1 in ?' means line 1 in the command we are typing. If it were a longer program stored in a source file the would be replaced by the file name.

>>Basically there are three types of error you will encounter. The first of these is a syntax error which basically means that Python didn't recognise what you typed as a valid program, it's like missing out punctuation in an English sentence or spelling a word wrongly. The next category of errors is a runtime error which is where the program looks valid but for some reason cannot be executed, you have tried to perform an illegal, or unavailable operation. Trying to read a file that did not exist would be an example. The final type of error is a semantic error which is where the program appears to have worked in that there are no error messaages but it produces the wrong output. For example if you wrote a word counter program that reported that this file only contained 5 words, it would obviously be wrong, so the program has a semantic error. Most of the errors you will come across initially will be syntax errors or runtime errors, later, as you start to design your own programs, you will make semantic errors and need to fix them. This process is called debugging and the errors so found are called bugs for historic reasons - one of the first computer faults was due to a real insect-type bug getting stuck inside the machine!

>>In case you are wondering, the mistake I made was trying to add a number to a character string which is a semantic error but in this case is one which also generates a runtime error.. You're not allowed to do that so Python objected and told me there was a TypeError. You'll need to wait till we get to the topic on the Raw Materials to understand what types are all about....

まず例示されているJavascriptソースコードを書いてみようかなと思ったけど、Emacsの-nwを使うか、それともPython書くのにIDLEを使っていくことにするかとかIcewieselはよく落ちるみたいだから表示にはFirefox使うかとか考えてみた。
Icewieselはとりあえずaptitude install firefoxとかやって、firefoxってやったらIcewiesel様が出てきたので諦めるwDebian(笑)現段階では別にJavascriptとか表示するだけだしなー。つうことで当面はDebian様の思想に従ってIcewiesel様を使う。本気で困ったらFirefoxにすればいいが、とりあえずよく落ちることを除いてはFirefoxと同じだろうのでブラウザとしてはIcewieselを採用。
エディタをどうするか。Emacs -nwでやっていってもいいが、DebianLinux環境の勉強のために適当なエディタから学んでいってもいい。
Emacs -nwの使い方を覚えるのも時間が掛かってしまいそうなので。
とりあえず適当な付属エディタでJavascriptVBなんかは書いてみて、Pythonはその適当なエディタやIDLEを使いながら・勉強しながらやってみたい。

さて、Javascriptを書くか。
Gnome Terminalから何を起動しよう。とりあえずeditorとか打ってみれば何か出てくるんじゃね?うおおおでてきたぁぁ!←今ここ
GNU nanoとかいうエディタが端末上に登場。登場の仕方まで格好いいぜGNU様!
GNU謹製とかいうだけで憧れる。のでこれを使っていくことにしよう。
使い方覚える。フォントとか表示の仕方とか結構かっこういいな。いつかはEmacs使うつもりだがおまいも愛してやるぜよ。
とりあえず例文を打ち込んでみた、なかなかいい感じにするすると打ち込む。Saveの仕方がわからない、^ってCtrlっぽいのでCtrl+GでHelp見てみる。今ここ。Autohotkeyでも^ってCtrlだったな。
WikipediaGNU nano調べてたらCtrl+Oでセーブって書いてあったのでHelpを読む前に実行。ファイル名をhello.htmにして保存。
Firefox hello.htm
Hello World
うむ。

VBScriptの方も作った。けどFirefox(Icewiesel)じゃVBScriptは動かないので、Winに戻ってIEでチェック。おk

おぉー、Gnome TerminalとGnu nanoたんでこれから進んでいけるのか。はじまったな。