by Matt Adesanya

马特·阿德桑亚(Matt Adesanya)

Gentler编程简介 (A Gentler Introduction to Programming)

This write-up captures what I teach when I get coaching requests. I won’t jump into the code or a setup of any sort. I will teach concepts.

这篇文章记录了我在得到指导请求时所教的内容。 我不会跳入代码或任何形式的设置。 我将教授概念。

If you work in a software development company as a non-programmer, you may wonder what the programmers do. And you hear new buzzwords everyday. This post was written with you in mind. Whether you are a sales person, a medical doctor, attorney, a business lead, or an accountant, if you’ve ever had it in mind to learn how to code, this is a good place to start.

如果您以非程序员的身份在软件开发公司工作,您可能会想知道程序员会做什么。 而且您每天都会听到新的流行词。 这篇文章是为您写的。 无论您是销售人员,医生,律师,业务主管还是会计师,如果您曾想过要学习编码,那么这是一个很好的起点。

本文的组织方式 (How this article is organized)

This write-up is divided into 4 parts. After reading through each part, you will find a quiz section to help you better recall what you’ve read. Then you’ll find a “going forward” section and answers to the quiz.

本文分为四个部分。 阅读完每个部分后,您将找到一个测验部分,以帮助您更好地回忆起已阅读的内容。 然后,您将找到“前进”部分并回答测验。

Note that each buzzword introduced in this series is in bold , such as algorithm.

请注意,本系列中介绍的每个流行词都是粗体的 ,例如algorithm

第1部分-什么是编程? (Part 1 — What is Programming?)

A simple answer would be, “Programming is the act of instructing computers to carry out tasks.” It is often referred to as coding.

一个简单的答案就是:“编程是指示计算机执行任务的行为。” 它通常称为编码

So then, what is a computer program? A computer program is a sequence of instructions that the computer executes.

那么,什么是计算机程序 ? 计算机程序是计算机执行的一系列指令。

Computer in the definition above is any device that is capable of processing code. This could be smartphones, ATMs, the Raspberry Pi, Servers to name a few.

上面定义中的计算机是任何能够处理代码的设备。 这可能是智能手机,ATM,Raspberry Pi,服务器等。

一个很好的编程类比 (A Good Analogy for Programming)

First, there are patterns to our every day lives. The universe operates in a somewhat predictable way; For example — day and night, seasons, sunrise and sunset. People go through routines such as rising in the morning, going to school or to work. We get instructions from other people such as our superiors at work. How we cook certain recipes can be explained in finite steps.

首先,我们的日常生活有多种模式。 宇宙以某种可预测的方式运行; 例如,白天和黑夜,季节,日出和日落。 人们经历着例行公事,例如早晨起床,上学或上班。 我们从工作上司等其他人那里得到指示。 我们如何烹饪某些食谱可以用有限的步骤来解释。

Second, every time we use smart devices, some code is running in the background. Moving a mouse pointer from one part of your computer screen to the other may seem like a simple task, but in reality, so many lines of code just ran. An act as simple as typing letters into Google Docs leads to lines of code being executed in the background. It’s all code everywhere.

其次,每次我们使用智能设备时,都会在后台运行一些代码。 将鼠标指针从计算机屏幕的一部分移动到另一部分似乎很简单,但是实际上,运行了很多行代码。 像在Google文档中键入字母一样简单的操作导致在后台执行代码行。 到处都是代码。

Computer programs are also referred to as code. Do not use the word ‘codes’ (code should be used as an uncountable noun). Okay, this is not an English class, let’s get back to business.

计算机程序也称为代码不要使用“代码”一词 (代码应作为不可数名词使用)。 好吧,这不是英语课,让我们重新开始吧。

计算机的自然语言 (The Natural Language of the Computer)

Machines have their natural language like humans do. Computers do not understand the human language. The natural language of computers is the binary code — 1 and 0. These represent two states: on (1) and off (0).

机器具有人类一样的自然语言。 计算机不懂人类的语言。 计算机的自然语言是二进制代码1和0。它们表示两种状态: 开(1)关(0)

That is the natural language of electronic equipment. It would be hectic for us as humans to communicate with the computer in binary.

那是电子设备的自然语言。 作为人类,以二进制形式与计算机进行通信对于我们而言将是非常忙碌的。

输入编程语言 (Enter Programming Languages)

To communicate with machines who speak binary, we do so in a language that’s closer to our own natural language. Such as English, French, Swahili or Arabic. Programming languages are close to our natural languages. But they are more structured and must be thoroughly learned.

为了与会说二进制的机器进行通信,我们会使用一种更接近我们自然语言的语言进行通信。 例如英语,法语,斯瓦希里语或阿拉伯语。 编程语言与我们的自然语言很接近。 但是它们更加结构化,必须彻底学习。

They could be high level or low level languages. High level programming languages are farther away from the machine language than low level languages. This “farther away” is usually called an abstraction , but we will not go into that in this series. Let’s not get distracted :)

它们可以是高级或低级语言。 高级编程语言比低级语言离机器语言更远。 这种“更远的距离”通常称为抽象 ,但是在本系列文章中我们将不再赘述。 让我们不要分心:)

The computer needs a way to understand our human language. To do this, we’ll need a translator.

计算机需要一种理解我们的人类语言的方式。 为此,我们需要一个翻译器。

什么是翻译员 (What are Translators)

Source code refers to code written in a particular programming language. More of this in Part 2.

源代码是指以特定编程语言编写的代码。 第2部分中的更多内容。

Translators have the responsibility of converting your source code to the machine language. This is also known as binary. Remember ones and zeros. We may refer to the binaries as Object Code , the Program or a common word today: App.

译者有责任将您的源代码转换为机器语言。 这也称为二进制 。 记住一和零。 今天,我们可以将二进制称为目标代码 ,程序或通用词: App

Translators can be any of:

译者可以是以下任何一位:

  • Interpreters口译员
  • Compilers编译器
  • A hybrid of Interpreters and Compilers口译和编译器的混合体
  • Assemblers组装工

口译员 (Interpreters)

Some languages are interpreted. The translator processes the source code line by line and runs every line in the final program or app. This means that interpreted source code starts running until it encounters an error. Then the interpreter stops to report such errors. More of this in detail in Part 3.

一些语言会被解释。 转换器逐行处理源代码,并在最终程序或应用程序中运行每一行。 这意味着解释的源代码开始运行,直到遇到错误为止。 然后,解释器停止报告此类错误。 在第3部分中将对此进行详细介绍。

Python is a good example of an interpreted programming language.

Python是解释型编程语言的一个很好的例子。

编译器 (Compilers)

Compilers function differently. They convert the source code in its entirety via a compilation process to binary. The binary is then executed. If there were errors in the source code, they are detected during the compilation time and flagged. This interrupts the compilation process, and no binary is generated.

编译器的功能有所不同。 他们通过编译过程将源代码完整地转换为二进制。 然后执行二进制文件。 如果源代码中存在错误,则在编译期间将对其进行检测并进行标记。 这会中断编译过程,并且不会生成二进制文件。

Interpreters translate line by line and execute the line before going on to the next line. Compilers translate all lines of a program to a file (binary) and execute the whole file.

解释器逐行翻译并执行该行,然后继续下一行。 编译器将程序的所有行转换为文件(二进制)并执行整个文件。

Remember the definition of computer program? It’s a sequence of instructions that is executed by a computer.

还记得计算机程序的定义吗? 这是由计算机执行的一系列指令。

An executing program is usually called a process. Such programs use certain resources on the computer system or smartphone such as memory, disk space and the file system. An executing program can also be said to be running.

执行程序通常称为进程。 此类程序使用计算机系统或智能手机上的某些资源,例如内存,磁盘空间和文件系统。 也可以说正在执行的程序正在运行

We use the word ‘run’ when we execute a computer program. The time it takes to run such programs is known as the run-time of the program.

在执行计算机程序时,我们使用“运行”一词。 运行此类程序所花费的时间称为该程序的运行时

It is common to see programs referred to as Apps. We also associate programs with the platforms or environment in which they run, or are designed for. There are web apps, which run on web browsers, such as Google Spreadsheet. There are mobile apps, which run on smartphones such as CandyCrush. There are also desktop apps such as the Evernote desktop app.

通常会看到称为Apps的程序。 我们还将程序与运行或设计用于它们的平台或环境相关联。 有些网络应用程序可以在网络浏览器上运行,例如Google Spreadsheet。 有些移动应用程序可以在CandyCrush等智能手机上运行。 还有一些桌面应用程序,例如Evernote桌面应用程序。

Again, interpreted source code is executed directly from the source file. Compiled source code is converted to a binary file. The binary file is then executed. Compiled source code may fail during run-time even after successfully compiling. See Part 3.

同样,解释后的源代码直接从源文件执行。 编译后的源代码将转换为二进制文件。 然后执行二进制文件。 即使成功编译后,编译后的源代码也可能在运行时失败。 参见第3部分。

混合翻译器 (Hybrid Translators)

A hybrid translator is a combination of the Interpreter and Compiler. A popular hybrid programming language is Java. Java first compiles your source code to an intermediate format known as the Bytecode.

混合翻译器是解释器和编译器的组合。 流行的混合编程语言是Java 。 Java首先将源代码编译为称为Bytecode的中间格式。

The Bytecode is then interpreted and executed by a runtime engine also known as a Virtual machine. This enables the hybrid translators to run the bytecode on various operating systems.

然后,由运行时引擎(也称为虚拟机)解释并执行字节码。 这使混合转换器可以在各种操作系统上运行字节码。

组装工 (Assemblers)

There’s the Assembler as well for translating low-level Assembly language to binary.

还有将低级汇编语言转换为二进制的汇编程序。

For this series, we will only focus on the High level languages.

在本系列中,我们将仅专注于高级语言。

A good way to look at Translators is to see them as a program in themselves. You need to download or get them, install them on your computer system and understand their basic workings.

查看翻译器的一个好方法是将它们视为自己的程序。 您需要下载或获取它们,将它们安装在计算机系统上并了解其基本工作原理。

常见问题 (An Often Asked Question)

Here’s a question beginners usually ask.

这是初学者通常会问的一个问题。

What language do I learn first?

我首先要学习哪种语言?

There are hundreds of programming languages. They are ranked by popularity, community, long term support, pedagogy, business use. They can also be ranked by technicality, such as whether they are functional, imperative, static, strong, or loosely typed.

有数百种编程语言。 他们按照受欢迎程度,社区,长期支持,教学法和商业用途进行排名。 也可以按技术性对它们进行排序,例如它们是功能性,命令式,静态,强类型还是松散类型。

Some languages are more pedagogical than others. Some languages are for educational purposes and not for business use. There are languages written, for example, for kids to learn how to code.

有些语言比其他语言更具教学性。 有些语言是出于教育目的,而不是用于商业目的。 例如,有一些语言供孩子们学习如何编码。

There are very powerful languages that are easy to setup and learn. Python is one such programming language. I usually recommend it to beginners.

有非常强大的语言,易于设置和学习。 Python是一种这样的编程语言。 我通常将它推荐给初学者。

If you are interested in exploring more on your options for “first language,” here’ssome good research by Philip Guo.

如果您有兴趣探索更多关于“第一语言” 的选择 ,那么Philip Guo 的一些很好的研究。

When you want to learn a new language, you know now that you would need that language translator. This is a program you install and setup on your computer system.

现在,当您想学习一种新语言时,您将需要该种语言翻译器 。 这是您在计算机系统上安装和设置的程序。

I recommend that you start learning how to use a CLI (Command Line Interface). The CLI is the terminal or shell. Think of the terminal as an alternative to a GUI (Graphical User Interface).

我建议您开始学习如何使用CLI (命令行界面)。 CLI是终端或外壳。 将终端视为GUI(图形用户界面)的替代。

In GUIs, you interact with the computer through the mouse pointer. You also depend on visual renditions of directories, and about everything you do.

在GUI中,您可以通过鼠标指针与计算机进行交互。 您还依赖于目录的可视化形式以及所做的一切。

But, when using a CLI you interact with the computer using commands which you type at the prompt or a blinking cursor

但是,在使用CLI时,您将使用在提示符下或光标闪烁时键入的命令与计算机进行交互

$_

In Windows, the shipped-in terminal is the command prompt. For Mac and Linux users, you already have a default Bash terminal. To get the same experience on Windows, install Git Bash OR PowerShell.

在Windows中,附带的终端是命令提示符。 对于Mac和Linux用户,您已经具有默认的Bash终端。 要在Windows上获得相同的体验,请安装Git Bash或PowerShell 。

向前走 (Going Forward)

Now that you’ve been mildly introduced to what programming is. You need to prepare yourself for your first line of code :)

现在已经向您简要介绍了什么是编程。 您需要为第一行代码做好准备:)

To get started you will need the following:

要开始使用,您将需要以下内容:

  • A computer system

    电脑系统

    At this point, you do not need a sophisticated or very expensive one, you only need a computer that works well.

    在这一点上,您不需要一台复杂的或非常昂贵的计算机,只需要一台运行良好的计算机即可。

  • Install the CLI

    安装CLI

    I recommend

    我建议

    this crash course to get you started on how to use the CLI.

    本速成课程可帮助您开始使用CLI。

  • Install a text editor

    安装文本编辑器

    We will come back to this in Part 2

    我们将在第2部分中回到这一点

  • Learn a programming language

    学习编程语言

    In this series you will learn the basic elements that make up the fundamental knowledge of most programming languages.

    在本系列中,您将学习构成大多数编程语言基础知识的基本元素。

测验 (Quiz)

  • What basic tools do you need to start programming?您需要什么基本工具来开始编程?
  • What command would you use for the following in bash (CLI)?您将在bash(CLI)中使用以下命令吗?
  • Check your current directory检查您的当前目录
  • Change to a directory named ‘bin’ (bin is in your current directory)切换到名为“ bin”的目录(bin在当前目录中)
  • make a new directory called ‘lib’新建一个名为“ lib”的目录
  • create a new file called ‘book.py’创建一个名为“ book.py”的新文件
  • list all the contents the current directory列出当前目录中的所有内容

摘要 (Summary)

We have gone through the basics of programming, with an introduction to Translators. The word “source code” is no longer strange to you. We will examine what a source code is in detail in the next part.

我们已经学习了编程的基础知识,并介绍了翻译器。 “源代码”一词对您而言不再陌生。 在下一部分中,我们将详细检查源代码。

测验答案 (Answers to the Quiz)

What basic tools do you need to start programming?A computer, a text editor, the shell(terminal), and a compiler/interpreter

您需要哪些基本工具来开始编程?计算机,文本编辑器,shell(终端)和编译器/解释器

What command would you use for the following in bash(CLI)?

在bash(CLI)中,您将对以下命令使用什么命令?

  • Check your current directory: pwd

    检查当前目录: pwd

  • Change to a directory named ‘bin’ : cd bin

    转到名为“ bin”的目录: cd bin

  • make a new directory called ‘lib’: mkdir lib

    新建一个名为“ lib”的目录: mkdir lib

  • create a new file called ‘book.py’: touch book.py

    创建一个名为“ book.py”的新文件: touch book.py

  • list all the contents the current directory: ls

    列出当前目录中的所有内容: ls

第2部分-源代码 (Part 2 — Source Code)

Now that you understand the concept of programming, we will examine source code.

现在您已经了解了编程的概念,我们将研究源代码。

A source code is basically a file, just like a Microsoft (.doc) file, but slightly different. It is a raw text file, written on very simple editors, like the Windows Notepad. You will recall from the previous section that you need either interpreters or compilers to convert your source code to binary. The source code must be saved in a file, which is passed as an input to the translator.

源代码基本上是一个文件,就像Microsoft(.doc)文件一样,但是略有不同。 这是一个原始文本文件,用非常简单的编辑器(例如Windows记事本)编写。 您将在上一节中回忆到,您需要解释器或编译器才能将源代码转换为二进制。 源代码必须保存在文件中,该文件作为输入传递到翻译器。

Depending on the language you are writing, there are designated extensions for saving your source code file. Python’s extension is ‘.py’. Java is ‘.java’. Php is ‘.php’ and PERL is ‘.pl’ to name a few.

根据您所写的语言,有一些指定的扩展名可以保存您的源代码文件。 Python的扩展名为'.py'。 Java是“ .java”。 php是“ .php”,PERL是“ .pl”。

When you are done writing your source code, you must run it through the translator. As an example, here’s how to run your Python source code using the pythoncommand.

完成编写源代码后,必须通过转换器运行它。 例如,以下是使用python命令运行Python源代码的方法。

入门:您的第一个程序 (Getting Started: Your First Program)

  • Follow the instructions here to setup Python on your computer system.

    请按照此处的说明在计算机系统上设置Python。

  • Install a simple editor to type in your source code. You can use sublime text editor for a start.

    安装一个简单的编辑器以键入您的源代码。 您可以使用崇高的文本编辑器作为开始。

  • Open a new file on your editor, and type in the following:在编辑器上打开一个新文件,然后键入以下内容:
print ‘Hello Python!’
  • Remember to save the file as main.py记住将文件另存为main.py
  • Find the path to the file on your CLI, and type the command below:在CLI上找到文件的路径,然后在下面键入命令:
$ python main.py

The result should look like this:

结果应如下所示:

典型源代码剖析 (The Anatomy of a Typical Source Code)

We will now examine the content of a typical source code file. Below are the regular components:

现在,我们将检查典型源代码文件的内容。 以下是常规组件:

关键词 (Keywords)

Short, human readable words, usually known as keywords. They are peculiar to the language you are learning, and they are special. We’ll come back to this in a jiffy. You need to learn some of the keywords by heart. Here’s the set of keywords recognized and used in Python.

简短易读的单词,通常称为关键字 。 它们是您正在学习的语言所特有的,并且很特殊。 我们将立即回到这个问题。 您需要认真学习一些关键字。 这是在Python中识别和使用的一组关键字 。

https://www.programiz.com/python-programming/keyword-list

https://www.programiz.com/python-programming/keyword-list

身份标识 (Identifiers)

Words invented by You — Yes You, the programmer. These words are generally referred to as Identifiers. They could be created by you or other programmers. They are packaged in form of plugins, better known as Libraries.

您发明的话-是的,您是程序员。 这些词通常称为“ 标识符” 。 它们可以由您或其他程序员创建。 它们以插件的形式打包,通常称为Libraries

An example of a library is the Math library. It lets you access functions like the square root (Math.sqrt), used in Javascript.

数学库是一个示例库。 它使您可以访问Java语言中使用的平方根(Math.sqrt)之类的函数。

Many programming languages ship with loads of libraries. These are generally referred to as their SDK s (Software Development Kits). You will download them together with the compiler to start building technologies, apps and projects. Besides these, there are frameworks , designed to help with building on a particular platform such as web or mobile.

许多编程语言附带了许多库。 这些通常称为其SDK (软件开发套件)。 您将与编译器一起下载它们,以开始构建技术,应用程序和项目。 除了这些,还有一些框架 ,旨在帮助在特定平台(例如Web或移动平台)上构建。

Some identifiers are bundled with a language you’re using and may not be used as a user-named identifier. An example is the word string in java. Such identifiers, together with keywords are known as Reserved Words. They are not keywords, but like keywords, they are also special.

某些标识符与您使用的语言捆绑在一起,因此可能无法用作用户命名的标识符。 一个示例是java中的单词字符串 。 此类标识符与关键字一起被称为保留字 。 它们不是关键字,但是像关键字一样,它们也很特殊。

All keywords are reserved words, the inverse is not true.

所有关键字均为保留字,反之则不正确。

The words you choose should be meaningful to whoever sees them at first glance.

您选择的字词对乍一看的人都应该是有意义的。

A common use of identifiers is in naming variables , we will look into this in a bit.

标识符的常见用法是命名变量 ,我们将对此进行一些研究。

基本数据类型 (Basic Data Types)

You will also find data of different types in a source code, numbers (3, 5.7, -100, 3.142) and characters (M, A). In some programming languages, numbers are further broken down into their own types such as integers.

您还将在源代码中找到不同类型的数据, 数字 (3、5.7,-100、3.142)和字符 (M,A)。 在某些编程语言中,数字进一步细分为它们自己的类型,例如整数

Integers can be Signed or Unsigned , big integers, and small integers. Big or small actually depends on the amount of memory space reserved for such numbers. There are numbers with decimal parts, usually called double and float , depending on the language you are learning.

整数可以是有符号无符号的整数和整数。 大小实际上取决于为此类数字保留的存储空间量。 有些数字带有小数部分,通常称为doublefloat ,具体取决于您正在学习的语言。

We also have boolean data types which evaluate to true or false.

我们还有布尔数据类型,其结果为true或false。

复杂数据类型 (Complex Data Types)

The data types explained above are known as the elementary, primary or basic data types. We can build more complex data types from these basic data types.

上面说明的数据类型称为基本,主要或基本数据类型。 我们可以从这些基本数据类型构建更复杂的数据类型。

An Array is the simplest form of the complex data type. A String is an Array of characters. We cannot do without these complex data types and often use them when writing our source code.

数组是复杂数据类型的最简单形式。 字符串字符数组。 我们离不开这些复杂的数据类型,并且在编写源代码时经常使用它们。

A combination of characters is a string. To use an analogy, a string is to a computer what a word is to a human being. The word ‘Thermometer’ is made up of 11 characters — we simply call it a string of characters. String processing is a broad topic in itself to learn, and must be studied by every aspiring programmer.

字符的组合是字符串。 用类比来说,字符串对计算机而言就像一个字对人类一样。 “温度计”一词由11个字符组成-我们简单地称它为字符串。 字符串处理本身就是一个广泛的学习主题,每个有抱负的程序员都必须学习它。

Complex data types are shipped with most programming languages you use. There are others that we build ourselves as programmers, such as the Class systems. These are also known as ( OOP ) Object Oriented Programming.

您使用的大多数编程语言都随附了复杂数据类型。 我们还以程序员的身份建立了自己的团队,例如Class系统。 这些也称为( OOP )面向对象编程。

变数 (Variables)

Variables are simply named memory locations. We sometimes want to keep data in our source code in a place where we can recall the data, to use again. This is usually a memory location which our compiler/interpreter reserves for us. We need to name these memory locations to recall them later. Consider the Python code snippet below:

变量简称为内存位置。 有时,我们希望将数据保留在源代码中的某个位置,以便我们可以重新调用该数据。 这通常是我们的编译器/解释器为我们保留的内存位置。 我们需要命名这些存储位置,以便以后调用它们。 考虑下面的Python代码段:

pet_name = 'Hippo'print pet_name

pet_name is an example of a variable. Because the type of data stored in pet_name is a string. It is known as a string variable. There are numeric variables as well. Variables are categorized by their data types.

pet_name是变量的示例。 因为存储在pet_name的数据类型是字符串。 它被称为字符串变量。 也有数字变量。 变量按其数据类型分类。

常数 (Constants)

Constants are values that do not change throughout the lifetime of the program. We use capital letters to enforce that some values are to be constant values. Some languages provide a way to create constant values, while others do not.

常数是在程序的整个生命周期中都不会改变的值。 我们使用大写字母来强制将某些值设为常量。 有些语言提供了创建常量值的方法,而另一些则没有。

Some languages provide the luxury of declaring types that variables should be. We often call these strongly typed languages. Java is a good example.

某些语言提供了声明变量应为的类型的豪华方式。 我们经常称这些强类型语言。 Java是一个很好的例子。

Others do not provide these features. They are loosely typed or dynamic programming languages . Python is a good example.

其他人不提供这些功能。 它们是松散类型动态编程语言 。 Python是一个很好的例子。

Here’s how to declare constant values in JavaScript.

这是在JavaScript中声明常量值的方法。

const petName = 'Hippo'

文字 (Literals)

In every source code, there are data types you use everywhere around your code that will only change if you edit them yourself. We call these literals, which are not to be confused with variables or constants. Literals can be seen once you glance through the source code. They could be strings, numbers, decimals, or other data types.

在每个源代码中,在代码中到处都有您使用的数据类型,这些数据类型只有在您自己编辑时才会更改。 我们称这些文字,不要与变量或常量混淆。 浏览源代码后即可看到文字。 它们可以是字符串,数字,小数或其他数据类型。

In the source code snippet above, the word ‘Hippo’ is a literal — a string literal. It will always be ‘Hippo’ until you edit the source code. As you learn to code, you will learn how to manage literals in your source code in a way that is easy to maintain without changing much of your source code.

在上面的源代码片段中,单词“ Hippo”是一个文字-字符串文字。 在您编辑源代码之前,它将始终是“ Hippo”。 在学习代码时,您将学习如何在不更改大量源代码的情况下以易于维护的方式管理源代码中的文字。

标点/符号 (Punctuations/Symbols)

In most source code, you will generally find different punctuation marks depending on the programming language. Java has more punctuation marks, for example than Python.

在大多数源代码中,通常会根据编程语言找到不同的标点符号。 例如,Java比Python具有更多的标点符号。

Common punctuation marks include the comma (,), semi-colon(;), colon(:), braces ({}), Brackets (()), square braces ([]), quotation marks (“ ”), pipe (|), slash (\), period (.), question mark (?), caret(^) and percentage (%).

常用的标点包括逗号( , ),分号( ; ),冒号( : ),括号( {}支架( ()方括号( []引号( “ ”管( | ,斜杠( \ ),句点( . ),问号( ? ),脱字号( ^ )和百分比( % )。

Welcome to the world of coding, where punctuation marks are your best friends. You will find yourself typing them a lot.

欢迎来到编码世界,标点符号是您最好的朋友。 您会发现自己经常键入它们。

经营者 (Operators)

The chances that you will write code to perform an operation is very high. In the slightest way, you will perform an assignment operation in your source code. We are presented with a large number of operators by the programming languages we use. Examples include addition(+), division(/) multiplication(*), subtraction(-) and greater than(>).

您编写代码来执行操作的机会非常高。 以最小的方式,您将在源代码中执行赋值操作。 我们使用的编程语言为我们提供了大量的运算符。 示例包括加法( + ),除法( / )乘法( * ),减法( - )和大于( & gt;)。

Operators can generally be classified as follows:

运营商通常可以分类如下:

  • Assignment Operators

    赋值运算符

    This is sometimes misconstrued as equal-to. Equal to is used to compare two values. Assignment Operator puts a value in a variable, such as

    有时这被误解为等于。 等于用来比较两个值。 赋值运算符将值放入变量中,例如

    pet_name = 'Hippo'

    pet_name = 'Hippo'

  • Arithmetic Operators

    算术运算符

    Comprises operators for carrying out arithmetic tasks such as addition, and subtraction. Some languages provide some arithmetic operators which others may not have. For example the modulus operator (

    包括用于执行算术任务(例如加法和减法)的运算符。 一些语言提供了一些其他算术运算符可能没有的算术运算符。 例如,模运算符(

    %) returns the remainder value in division operations.

    % )返回除法运算中的余数。

  • Relational Operators

    关系运算符

    are used for comparing values. They include greater than, less than, equal-to, not-equal-to. Their representation varies as well depending on what programming language you are learning.

    用于比较值。 它们包括大于,小于,等于,不等于。 它们的表示形式也根据您正在学习的编程语言而有所不同。

    <> is not equal-to in some languages, while in others, it’s != or !==.

    &l吨;>不等于对某些语言中,而在其他国家, i T的!= o - [R = =!

  • Logical Operators

    逻辑运算符

    are used to compute logical operations. The commonly used logical operators are and , or , not. Some languages represent these operators with symbols such as

    用于计算逻辑运算。 常用的逻辑运算符是和或,不是。 一些语言用诸如

    && for and , || for or , and ! for not. Logical Operation values usually evaluate to Boolean valuestrue or false.

    &&和, || 为或,和! 不。 逻辑运算值通常评估为布尔值truefalse

注释 (Comments)

Documentation will be an important aspect of your coding activities. It is how you explain your code to other programmers. This is done via comments that are occasionally added to parts of your code. Through comments, you can guide other programmers through what kind of data your code works with and the kind of output that it generates.

文档将是您的编码活动的重要方面。 这是您向其他程序员解释代码的方式。 这是通过偶尔添加到代码部分的注释来完成的。 通过注释,您可以指导其他程序员选择您的代码使用哪种数据以及生成的输出类型。

Usually, the compiler ignores lines of code that are comments.

通常,编译器会忽略作为注释的代码行。

Comments vary across languages. The #is used to introduce comments in Python.

注释因语言而异。 #用于在Python中引入注释。

Here’s an example of a comment in Python.

这是Python中的注释示例。

# program snippet to compute fibonacci of N numbers

In Java, C and C++ , there are comments for a single line just like the # in Python, but the // symbol is used instead. There are multi-line comments as well /**/. You can read more about comments in the language that you have chosen to learn.

在Java,C和C ++中,单行都有注释,就像Python中的#一样,但是使用//符号代替。 还有多行注释/**/ 。 您可以使用您选择的学习语言来阅读有关注释的更多信息。

空格和制表符 (Whitespace and Tabs)

These are spaces created between the code you are writing. This is done when you hit the space-bar or the tab key on your keyboard.

这些是在您编写的代码之间创建的空间。 当您按下键盘上的空格键或Tab键时,便可以完成此操作。

向前走 (Going Forward)

Ensure you correctly setup the Python on your computer system, and run your first program.

确保在计算机系统上正确设置了Python,然后运行第一个程序。

测验 (Quiz)

Here’s a simple quiz for you. Identify the different elements we have studied so far in the Java source code snippet below:

这是一个简单的测验。 在下面的Java源代码片段中确定我们到目前为止研究的不同元素:

// a recursive implementation of Factorialimport java.util.Scanner;class RecursiveFactorial {  public static void main(String[] args) {    Scanner input=new Scanner(System.in);    System.out.print("Find the Factorial of: ");    int num=input.nextInt();    System.out.println("Factorial of "+num+" = "+fact(num));  }
static long fact(int n) {  if(n<2) return 1;  return n*fact(n-1); }}

摘要 (Summary)

You have been introduced to what a source code is, and have examined the content of a typical source code.

向您介绍了什么是源代码,并检查了典型源代码的内容。

Compiled or translated, your code might possibly fail to run due to a number of reasons. These reasons are commonly related to errors in your source code. These errors are known as bugs.

编译或翻译后,由于多种原因,您的代码可能无法运行。 这些原因通常与源代码中的错误有关。 这些错误称为错误。

The act of finding and removing these bugs is called debugging and is a skill you must learn as a programmer. We will look into what bugs are in the next part.

发现和消除这些错误的行为称为调试,这是您作为程序员必须学习的技能。 我们将在下一部分中研究哪些错误。

测验答案 (Answers to the Quiz)

Identify the different elements we have studied so far in the Java source code snippet below:

在下面的Java源代码片段中确定我们到目前为止研究的不同元素:

Keywords:import, class, public, static, void, new, int, long, if, return

关键字:import,class,public,static,void,new,int,long,if,return

Identifiers:java, util, Scanner, RecursiveFactorial, main, String, args, input, System, in, out, print, println, num, nextInt, fact, n

标识符:java,util,Scanner,RecursiveFactorial,main,String,args,input,System,in,out,print,println,num,nextInt,fact,n

Literals:String Literals — “Factorial of ” = “Find the Factorial of: ”Integer Literals — 2, 1

Literals:String Literals —“ Fatorial of” =“查找以下因子:” Integer Literals — 2,1

Operators:Assignment Operator =Concatenator + (for joining strings together)less than &lt;multiply *subtract -

算:赋值运算符=串接+ (接合在一起字符串)小于& LT; MULTIP l Y * subtra c吨-

Punctuation and Symbols{ } [] ( ) ; .

标点符号{ } [] ( ) ; . { } [] ( ) ; .

Comment//a recursive implementation of Factorial

评论//阶乘的递归实现

第3部分-调试 (Part 3 — Debugging)

Once you start trying out code snippets or you are trying to solve actual problems with code, you will soon realize that there will be moments when your program breaks, is interrupted and stops running.

一旦开始尝试代码段或尝试解决代码的实际问题,您很快就会意识到,有时程序会中断,被中断并停止运行。

This is often caused by errors, known as bugs or exceptions in run-time. The act of finding and removing bugs from our code is debugging. You get better at debugging code as you try doing it more. We do not only debug our own code, we can also debug code written by other programmers.

这通常是由错误引起的,这些错误被称为运行时错误异常 。 从我们的代码中查找和删除错误的行为是调试 。 尝试做得更多,您将在调试代码方面变得更好。 我们不仅调试自己的代码,还可以调试其他程序员编写的代码。

To get started, we need to identify the common bugs likely to surface in our source code.

首先,我们需要确定源代码中可能会出现的常见错误。

句法错误 (Syntactic Errors)

These errors will not allow your source code to compile in compiled programming languages. They are detected at compile-time or during the interpretation of your source code. They can also be detected easily by linters. We will learn a little more about linters later.

这些错误将不允许您的源代码以已编译的编程语言进行编译。 在编译时或在解释源代码期间会检测到它们。 短绒还可以很容易地检测到它们。 稍后我们将学习有关短毛绒的更多信息。

They are mostly caused when you break the expected form or structure of the language you are coding in. An example is missing a closing bracket in an equation.

它们主要是由于您破坏了所编码语言的预期形式或结构而引起的。一个示例缺少方程式中的右括号。

语义错误 (Semantic Errors)

Semantic errors also known as logical errors are the most troublesome of all errors. They cannot be easily detected. A sign that there’s a semantic error is when the program runs successfully but does not produce the desired output.

语义错误(也称为逻辑错误)是所有错误中最麻烦的。 无法轻易检测到它们。 当程序成功运行但没有产生所需的输出时,就表明存在语义错误。

Consider this example:

考虑以下示例:

3 + 5 * 6

By order of precedence, popularly called BODMAS, in Mathematics, we expect the multiplication part to be evaluated first, and then final result will be 33. If the programmer wanted the addition to evaluate first instead, this will give a different output than the desired output. Errors such as this are semantic errors, having more to do with meaning than structure (syntax).

按照优先顺序(在数学中通常称为BODMAS),我们期望首先对乘法部分求值,然后最终结果将为33。如果程序员希望加法运算的结果首先为求值,则输出结果将与期望的结果不同输出。 诸如此类的错误是语义错误,与意义有关的多于结构(语法)。

Parenthesis around 3 + 5 will give the desired output of 48 instead.

括号在3 + 5左右将得到期望的输出48。

(3 + 5) * 6

运行时错误 (Run-time Errors)

Like semantic errors, run-time errors are never detected at compile time. Unlike semantic errors, run-time errors interrupt the program and prevents it from executing further. They are usually caused by unexpected result of some computation within the source code.

像语义错误一样,运行时错误永远不会在编译时检测到。 与语义错误不同,运行时错误会中断程序并阻止其进一步执行。 它们通常是源代码中某些计算的意外结果引起的。

Here’s a good example:

这是一个很好的例子:

input = 25x = 0.8/(Math.sqrt(input) - 5)

The code snippet above will compile successfully, but an input of 25 will result in ZeroDivisionError. This is a run-time error. Another popular example is the StackOverflowError or IndexOutofBoundError. What is really important is that you identify these errors and learn how to deal with them.

上面的代码段将成功编译,但是输入25将导致ZeroDivisionError. 这是运行时错误。 另一个流行的示例是StackOverflowErrorIndexOutofBoundError 真正重要的是识别这些错误并学习如何处理它们。

There are errors caused by how your source code makes use of memory and space on the platform or environment in which it is run. They are also run-time errors. Such errors as OutOfMemoryErrorand HeapError are usually caused by how much your source code use up resources. A good knowledge of algorithms will help you write code that better makes use of resources.

源代码如何利用其运行平台或环境上的内存和空间会导致错误。 它们也是运行时错误。 诸如OutOfMemoryErrorHeapError类的错误通常是由您的源代码消耗了多少资源引起的。 精通算法,将有助于您编写更好地利用资源的代码。

The process of rewriting your code for better performance is called optimization , and a not-so-related word is refactoring. As you spend more time coding, you should have these in mind as well.

重写代码以提高性能的过程称为优化 ,而与此无关的词就是重构 。 随着您花费更多的时间进行编码,您也应该牢记这些。

调试 (Debugging)

Here are a few tips on how to go about debugging your code:

以下是有关如何调试代码的一些提示:

  • Use Linters

    使用短绒

    Linters are tools that help

    短绒是帮助的工具

    read through your source code to check if they conform the expected standard in the language you are coding in. There are linters for many programming languages. Be sure to get one for the language you are learning.

    通读您的源代码,以检查它们是否符合您所使用的编码语言中所期望的标准。许多编程语言都存在一些问题。 请确保为您正在学习的语言提供一种。

  • IDEs over simple editors

    简单编辑器上的IDE

    You could opt for an

    您可以选择

    IDE designed for the language you are learning. IDE stands for Integrated Development Environment. They are software built for writing, debugging, compiling and running code. They usually come with powerful debugging kits, for watching or stepping through your code.

    针对您正在学习的语言而设计的IDE 。 IDE代表集成开发环境。 它们是为编写,调试,编译和运行代码而构建的软件。 它们通常带有功能强大的调试工具包,用于观看或单步执行代码。

    Jetbrains make great IDEs such as the Webstorm, and IntelliJ. There’s NetBeans, Komodo, Qt editor, Android Studio, XCode (shipped with Mac) to name a few.

    Jetbrains是出色的IDE,例如Webstorm和IntelliJ。 还有NetBeans,Komodo,Qt编辑器,Android Studio,XCode(Mac附带)等。

  • Reading your code aloud

    大声阅读代码

    This is usually useful when you are looking for a semantic error. While reading your code aloud, there is a high chance you will read out the error as well. That might jump at you as what was probably wrong.

    当您寻找语义错误时,这通常很有用。 大声阅读代码时,很有可能也会读出错误。 这可能会激怒您,因为可能出了什么问题。

  • Read error logs

    读取错误日志

    When the compiler flags an error, be sure to look at the line number or the part of your code flagged.

    编译器标记错误时,请务必查看被标记的行号或部分代码。

向前走 (Going Forward)

As a beginner, you will be learning to code from books, online tutorials or from videos. You will often type down code as you see them.

作为初学者,您将学习书籍,在线教程或视频中的编码。 看到代码时,您通常会键入代码。

Here’s something you should do, when you are done writing or running such code, learn to break them. How do you do this?

在完成编写或运行此类代码后,您应该做一些事情, 学会破坏它们 。 你怎么做到这一点?

Change something to see how the code behaves. Do this so that you don’t make assumption about anything and you are pretty sure you understand what is going on.

更改一些内容以查看代码的行为。 这样做是为了避免对任何事情做任何假设,并且可以确定自己了解发生了什么。

测验 (Quiz)

1 . What’s the likely bug in the Python code snippet below:

1。 以下Python代码段中可能存在的错误是:

items = [0,1,2,3,4,5]print items[8]
//hint: items here is an Array, with 6 items. To retrieve the 4th item for example, you will use items[3]. We start counting from 0.

2. What is the likely bug in the Python code snippet below:

2.以下Python代码段中可能存在的错误是:

input = Hippo'if input == 'Hippo':  print 'Hello, Hippo'

本节摘要 (Section Summary)

Congratulations! The bug word is no longer a strange one to you, and picking out bugs now should not be either. Next, we will look into the common flow of the code that we write everyday.

恭喜你! 错误的单词对您而言已不再是一个陌生的单词,现在也不应该选择错误。 接下来,我们将研究每天编写的代码的通用流程。

测验答案 (Answers to the Quiz)

What’s the likely bug in the Python code snippet below:(1) Runtime Error: Index Out of Range Error(2) Syntax Error: Missing starting quotation mark on line 1

下面的Python代码片段中可能有哪些错误:(1)运行时错误:索引超出范围错误(2)语法错误:第1行缺少起始引号

第4部分-基本编码流程 (Part 4 — Basic Coding Flows)

代码行,表达式和语句 (Line Of Code, Expressions and Statements)

The unit of any source code is the LOC (Line of Code). The simplest program is a line of Code. A LOC could be a keyword, a symbol, or a statement. It’s a Line of Code as long as it’s on a separate line of its own.

任何源代码的单位都是LOC(代码行) 。 最简单的程序是一行代码。 LOC可以是关键字,符号或语句。 只要是单独的一行,它就是一条代码行。

Let us consider a simple line of code:

让我们考虑一下简单的代码行:

area = 0.5 * base * height

area = 0.5 * base * height

0.5 * base * height is an expression. An expression is a combination of operators and operands. In the example given here, the operands are 0.5, base, height. You will recall that 0.5 is a floating point literal, base and height are variables. The operator is the *(multiplication).

0.5 * base * height是一个表达式。 表达式是运算符和操作数的组合。 在此处给出的示例中,操作数为0.5baseheight 。 您会回想起0.5是浮点文字, baseheight是变量。 运算符是* (乘法)。

Expressions may not be meaningful staying on their own as a LOC. When we assign the value of an expression to another variable, in the case above the area, what we have is called a statement. It is still a statement when we attach expressions to keywords, example: return 0.5 * base * height

表达式作为LOC单独保留可能没有意义。 当我们将表达式的值分配给另一个变量时,在area上方的情况下,我们拥有的称为语句。 当我们将表达式附加到关键字时,它仍然是一条语句,例如: return 0.5 * base * height

For the rest of this section, we will represent a statement as the symbol S. The nth statement will be Sn amongst a sequence (or set) of statements

在本节的其余部分,我们将用符号S表示语句。 第n条语句将在语句序列(或集合)中为Sn

To grasp programming quickly, a good starting point is understanding basic coding flows. Basic flows are also referred to as control flows. Once you understand these flows, you will find them in many of the programming languages you learn.

为了快速掌握编程,一个好的起点是理解基本编码流程。 基本流程也称为控制流程 。 一旦理解了这些流程,就可以在学习到的许多编程语言中找到它们。

Note that the examples given in this write-up are purely basic. You need to refer to the language you are learning to get an in-depth knowledge of the keywords it provides.

注意,本文中给出的示例纯粹是基本示例。 您需要参考所学的语言,以深入了解其提供的关键字。

Also the basic flows introduced here are different from design patterns in programming. Understand these basic flows first. You catch up later with common design patterns in programming as you learn more.

同样,此处介绍的基本流程与编程中的设计模式不同。 首先了解这些基本流程。 当您了解更多信息时,您将在以后了解编程中的常见设计模式。

Here are the basic programming flows:

以下是基本的编程流程:

  • Sequential顺序的
  • Conditional/Branching有条件/分支
  • Iteration/Repetition/Loops迭代/重复/循环

顺序的 (Sequential)

This is the most basic flow, where one statement is executed after the other. In the actual sense, every other flow resolves to a sequential flow (more on this later).

这是最基本的流程,其中一个语句在另一个语句之后执行。 从实际意义上讲,所有其他流程都解析为顺序流程(稍后将对此进行详细介绍)。

S1S2S3...Sn

In some programming languages like JavaScript, it is possible for S3 to execute before S1. This happens if S1 is blocked by some tasks that might take more time such as Data Base or File operations, known as asynchronous tasks. There are ways around cases like this. Not to worry, it will be a breeze to learn when you pick up the programming language to learn.

在某些编程语言(例如JavaScript)中,S3可以在S1之前执行。 如果S1被某些可能花费更多时间的任务(例如,数据库任务或文件操作)阻塞(称为异步任务) ,则会发生这种情况。 有很多方法可以解决这种情况。 不用担心,当您学习编程语言时,学习起来会很容易。

有条件/分支 (Conditional/Branching)

The statement that executes is determined by conditions. The key keyword here is the if keyword. It’s one of the most used coding flow.

执行的语句由条件决定。 这里的关键关键字是if关键字。 这是最常用的编码流程之一。

Here’s the simplest conditional pattern:

这是最简单的条件模式:

if (condition) then:   S1

In the example above, either S1 executes or nothing happens. S1 is executed only if the condition given is true.

在上面的示例中,执行S1或不执行任何操作。 仅在给定条件为真时才执行S1

Here’s another conditional pattern:

这是另一种条件模式:

if (condition) then:  S1  S2else:  S3  S4

That can be read as either running of S1-S2 or S3-S4 based on the condition given. If the condition is true, S1 and S2 will be processed. Otherwise the statements S3 and S4 will be processed. This in actual sense is a sequential flow:

根据给定的条件,这可以理解为S1 - S2S3 - S4的运行。 如果条件为真,则将处理S1S2 。 否则,将处理语句S3S4 。 实际上,这是一个顺序流:

S1S2

We also have the multi-conditional style:

我们还具有多条件样式:

if (condition1) then:  S1else if (condition2) then:   S2else:  S3

Here if condition1 is true, then S1 is processed. Otherwise condition2 is tested, and if true, S2 is processed. This can go on and on.

在这里,如果condition1为true,则处理S1 。 否则,将对condition2进行测试,如果为true,则处理S2 。 这可以继续下去。

For the multi-conditional style, many programming languages provide the switchstatement. Here’s the pattern for the switch statement:

对于多条件样式,许多编程语言都提供了switch语句。 这是switch语句的模式:

switch value:  case condition1:    S1    break    case condition2:    S2    break
default:    S3

The condition1 and condition2 are compared with the value in the switch statement. If any of them is true to the value, then the statement in the case block is executed.

condition1condition2与switch语句中的值进行比较。 如果它们中的任何一个符合该值,那么将执行case块中的语句。

There are other choices for conditional flow. Some are specific to the language you decide to learn such as the conditional operator (: ?), and other keywords that facilitate branching such as cycle and break. Be sure to spend sometime understanding the condition/branching flow.

条件流还有其他选择。 有些特定于您决定要学习的语言,例如条件运算符( : ? ),以及其他有助于分支的关键字,例如cyclebreak 。 确保花一些时间了解情况/分支流程。

迭代/重复/循环 (Iteration/Repetition/Loops)

The iteration/repetition flow keeps statement(s) running for as long as some conditions are met, and stops executing the statement(s) once the condition is no longer true.

只要满足某些条件,迭代/重复流程就会使语句保持运行,并且一旦条件不再成立,就停止执行该语句。

Here’s the pattern:

这是模式:

while (condition):  S1  S2

In the example above, statements S1 and S2 may execute once, multiple times, or may not execute at all. If the condition given is true the first time the whilestatement is encountered, then S1 and S2 will be processed. The while condition is checked again, and S1and S2 will be executed for as long as the condition is true.

在上面的示例中,语句S1S2可以执行一次,多次或完全不执行。 如果第一次遇到while语句时给定的条件为true,则将处理S1S2 。 再次检查while条件,只要条件为真,就会执行S1S2

The moment the condition becomes false the execution of S1 and S2 stops.

条件变为假时,将停止执行S1S2

The result of statement above if condition is true thrice will be:

如果条件为真三次,则以上语句的结果将是:

S1S2S1S2S1S2

What coding flow is that? If you answered sequential, you are very correct. Still as we can see, the other flows resolve to the sequential flow.

那是什么编码流程? 如果按顺序回答,那是非常正确的。 仍然如我们所见,其他流程解析为顺序流程。

Here’s another iteration pattern:

这是另一个迭代模式:

do:  S1  S2while (condition)

In this example, S1 and S2 will execute at lease once or multiple times. This is because they will execute before the condition is tested.

在此示例中, S1S2将至少执行一次或多次。 这是因为它们将在测试条件之前执行。

In many programming languages, keywords like the do andwhile are provided for implementing the repetition flow. Another common keyword is the for keyword. Here’s the common pattern for the for statement.

在许多编程语言中,都提供了dowhile类的关键字来实现重复流程。 另一个常见的关键字是for关键字。 这是for语句的常见模式。

for (initialvalue; condition; decrement/increment initialvalue):  S1  S2

Many languages have foreach used for working through each items in a complex object such as an array, or struct.

许多语言都使用foreach来处理复杂对象(例如数组或结构)中的每个项目。

测验 (Quiz)

Identify the coding flows in the following Python code snippet:

在以下Python代码片段中确定编码流程:

numlist=[]cnt=0while cnt >= 0:  m=int(raw_input())  if m < 0:    break  numlist.append(m)  cnt=cnt+1

摘要 (Summary)

The flows covered here are the basic flows. There’s a way to group a bunch of code together and give them a name. This way you may call this bunch of code whenever you need them at once. This is referred to as a procedure. In the case where the bunch of code perform some operation and return a value, you have a function.

这里介绍的流程是基本流程。 有一种方法可以将一堆代码组合在一起并命名。 这样,您可以在需要时立即调用这些代码。 这称为过程。 在那堆代码执行某些操作并返回一个值的情况下,您就有一个函数。

How procedures and functions are implemented vary with different languages. You cannot skip these to get the basics of any language. They are highly important for organizing your code. In fact, this is where the building blocks of your code starts also known as modular programming.

程序和功能的实现方式随语言的不同而不同。 您不能跳过这些以获得任何语言的基础知识。 它们对于组织代码非常重要。 实际上,这就是您的代码构建块开始的地方,也称为模块化编程。

There are other flows that you will learn the moment you understand functions, one that comes to mind is recursion.

了解函数后,您还将学习其他流程,其中一个是递归

Yet, you will find that within procedures and functions are still the awesome coding flows we have covered here — sequential, conditional and loops/iterative flow.

但是,您会发现过程和函数中仍然是我们在此处介绍的出色的编码流程-顺序,条件和循环/迭代流程。

向前走 (Going Forward)

Now you’ve learned the most basic concepts of programming your computer. If you desire to learn more, or want to make a career out of software development, then all you need to do is dive deeper into the deeper waters. There are so many resources to help you learn. Knowing which to pick up based on your level of experience matters a lot.

现在,您已经学习了对计算机编程的最基本概念。 如果您想了解更多或希望从事软件开发事业,那么您要做的就是深入研究。 有太多资源可以帮助您学习。 根据您的经验水平确定选修哪个课程非常重要。

Try not to get overwhelmed by the new words you hear from the more experienced programmers in your circle of friends. You could keep a pad to note down these terms, but do not be under pressure to find out what they mean. You will catch up as you learn and practice.

尽量不要被朋友圈中经验丰富的程序员所听到的新单词所淹没。 You could keep a pad to note down these terms, but do not be under pressure to find out what they mean. You will catch up as you learn and practice.

Here are a few resources to help jump-start your coding career, and to help build on the foundation you got from here:

Here are a few resources to help jump-start your coding career, and to help build on the foundation you got from here:

  • https://www.codecademy.com/

    https://www.codecademy.com/

    Pick the Python course

    Pick the Python course

  • https://app.pluralsight.com/library/courses/what-is-programming/table-of-contents

    https://app.pluralsight.com/library/courses/what-is-programming/table-of-contents

    Free Course on Pluralsight

    Free Course on Pluralsight

NOTE: I don’t recommend over-reading on the same topic. I believe in acting on the little you’ve learned, that is, practicing. This is why I’m not dumping too many links here for your learning. Feel free to google up or find others based on what you already know if you are not a first-timer.

NOTE: I don't recommend over-reading on the same topic. I believe in acting on the little you've learned, that is, practicing. This is why I'm not dumping too many links here for your learning. Feel free to google up or find others based on what you already know if you are not a first-timer.

Final Challenge (Final Challenge)

I hereby challenge you to:Take up any of these challenges:

I hereby challenge you to:Take up any of these challenges:

  • Find any simple app online and reproduce it in the programming language you have learnedFind any simple app online and reproduce it in the programming language you have learned

OR

要么

  • Think of any idea even if it’s as simple as a bucket list app

    Think of any idea even if it's as simple as a bucket list app

    build an app around this idea.

    build an app around this idea.

I’ll recommend this article from codementor to get you started on this.

I'll recommend this article from codementor to get you started on this.

Answers to the Quiz (Answers to the Quiz)

Identify the coding flows in the following Python code snippets.

Identify the coding flows in the following Python code snippets.

  • Sequential flowSequential flow
  • Iteration

    迭代

    the

    while statement

    while statement

  • Conditional

    Conditional

    the

    if statement

    if statement

Special thanks to Maya Neria, Joshua Ugba and Mohini Ufeli for reviewing this write-up, Surajudeen Akande for urging me to publish it, the Editorial team at Andela for the reviews, John Adesanya for the illustrations and to ‘Kunmi — these lessons started with her desire to learn how to code.

Special thanks to Maya Neria , Joshua Ugba and Mohini Ufeli for reviewing this write-up, Surajudeen Akande for urging me to publish it, the Editorial team at Andela for the reviews, John Adesanya for the illustrations and to 'Kunmi — these lessons started with her desire to learn how to code.

If you liked this, click on the clap icon so other people will see this here on medium. Also, if you have any questions or observations, use the comment section to share your thoughts.

If you liked this, click on the clap icon so other people will see this here on medium. Also, if you have any questions or observations, use the comment section to share your thoughts.

翻译自: https://www.freecodecamp.org/news/a-gentler-introduction-to-programming-1f57383a1b2c/

Gentler编程简介相关推荐

  1. 自动售货机编程_Rosmaro中基于视觉自动机的编程简介

    自动售货机编程 by Łukasz Makuch 通过ŁukaszMakuch Rosmaro中基于视觉自动机的编程简介 (An introduction to visual automata-bas ...

  2. 《jQuery与JavaScript入门经典》——第 1 章 动态Web编程简介 1.1理解Web服务器浏览器范式...

    本节书摘来自异步社区<jQuery与JavaScript入门经典>一书中的第1章,第1.1节,作者:[美]Brad Dayley著,更多章节内容可以访问云栖社区"异步社区&quo ...

  3. linux下多进程编程简介

    两年前的文章,拿过来充充门面. ------------------------ linux下多进程编程简介 ( 作者:mikespook | 发布日期:2002-12-8 | 浏览次数:272 ) ...

  4. 运动控制器编程_快速入门 | 篇二十一:运动控制器ZHMI组态编程简介一

    点击上方"正运动小助手",随时关注新动态! 运动控制器ZHMI组态编程简介一  今天我们来学习一下,运动控制器的ZHMI组态编程简介.本文主要从产品概述.控制器连接触摸屏使用.HM ...

  5. OpenCV 1.x 2.x 编程简介(矩阵/图像/视频的基本读写操作)

    OpenCV 编程简介(矩阵/图像/视频的基本读写操作) Introduction to programming with OpenCV OpenCV编程简介 作者: Gady Agam Depart ...

  6. SVG脚本编程简介(转)

    SVG脚本编程简介 本文主要介绍SVG的脚本编程,并分别给出放大.缩小,查询,鼠标事件等实例. 一.            SVG简介 SVG,全称为Scalable Vector Graphics( ...

  7. [Qt教程] 第31篇 网络(一)Qt网络编程简介

    [Qt教程] 第31篇 网络(一)Qt网络编程简介 楼主  发表于 2013-8-28 17:04:17 | 查看: 515| 回复: 0 Qt网络编程简介 版权声明 该文章原创于作者yafeilin ...

  8. Persistent Memory编程简介

    Persistent Memory编程简介 编程 libpmem 持久化函数 libpmemobj 跟对象 root object 例程 事务支持 type safety 线程安全 管理工具 ipmc ...

  9. linux c read函数返回值,Linuxc - GNU Readline 库及编程简介

    GNU Readline 库及编程简介 简介 用过 Bash 命令行的一定知道,Bash 有几个特性: TAB 键可以用来命令补全 ↑ 或 ↓ 键可以用来快速输入历史命令 还有一些交互式行编辑快捷键: ...

最新文章

  1. jsp 中forward 和 Redirect 的用法区别
  2. 实时事件日志记录和聚合的平台——Sentry
  3. Java 8日期和时间
  4. Meteor项目实战 -- Next 0.0.2
  5. (57)UART外设驱动波特率(二)(第12天)
  6. php revel,试用revel-一个基于golang的web框架
  7. List集合取交集、并集、差集
  8. SSH复用代码最终版
  9. 公路护栏设计技术简析
  10. 7. 堆(宋红康笔记)
  11. Echarts实现可视化大屏
  12. 精准医学:NGS和MFC方法在多发性骨髓瘤MRD评估中的比较|预后监测
  13. TI DSP BootLoader技术要点概述
  14. Springcloud微服务概述
  15. 美国大学的交流访问学者怎样申请?
  16. ABAP 系统变量SY-INDEX与SY-TABIX
  17. 人到中年才懂10个“潜”规则,过来人:除了生死,其他都是闲事
  18. Abaqus2017 安装后启动失败_51CAE_新浪博客
  19. 研究生专业课计算机科学基础,计算机学科专业基础综合科目408综合教程及历年真题详解(最新版全国硕士研究生招生考试计算机科学与技术学科联考)...
  20. python出试卷_python期中考试试卷(最新整理)

热门文章

  1. 阿里程序员不小心把服务器CPU打到100%,淡定展示教科书排查过程
  2. Python报错pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool解决方法
  3. Android之蚂蚁森林能量水滴效果
  4. ecs服务器网站目录,ecs云服务器的根目录
  5. 校园网的实现 java_北科校园网开机自动登录的JAVA实现(已修正)
  6. 非科班出身的人学习编程不负责任指南
  7. Network学习11_Pcap包拆分工具pkt2flow介绍
  8. 如何判断一家公司靠不靠谱
  9. Elixir - case, cond, and if
  10. 潜心十年,修炼成编程高手