Bỏ qua điều hướng
Thư viện từ vựng

Lập trình: những từ đầu tiên

25 từ gặp ngay từ bài học lập trình đầu tiên, từ biến, hàm, vòng lặp tới lỗi và gỡ lỗi.

25 từ · technology · programming · có bài đọc

My first program

Last month I decided to become a programmer. A friend who works as a developer told me to start with a small program, so I wrote a script that counts the words in a text.

First I learned the syntax of the language. A variable stores a value, for example a string of text or a number. An array keeps many values in order. A function is a block of code with a name: it takes an input and returns an output. A loop repeats the same steps, and a condition decides which step runs next. Later I met the idea of an object. Every object is built from a class, and a method is a function that belongs to that class.

My first try did not work. The computer has to compile the code before it can run it, and it stopped with an error on line twelve. After I fixed it, the program ran but gave the wrong answer: my first real bug. I spent a whole evening learning how to debug it, one step at a time. Now I write a small test for every function.

Next week I want to learn a popular library, and maybe a framework for building websites. My friend says the hardest part is not the code. It is thinking of a clear algorithm before you type anything.

Từ vựng

25 từ