我应该学习哪些编程基础知识?

时间:2022-09-11 10:28:00

I've had a very odd learning experience in programming. I was sort of taught C++, but I didn't get a lot out of it. Here's what I did get out of it: headers and variable declaration. And I tried to teach myself PHP, in which I learned a lot of. The problem is, a lot of my knowledge is widespread, random, and designed for specific situations.

我在编程方面有一个非常奇怪的学习经历。我有点教C ++,但我没有从中得到很多。这是我从中得到的:标题和变量声明。我试着自学PHP,其中我学到了很多东西。问题是,我的很多知识都是广泛的,随机的,并且针对特定情况而设计。

So, my questions is: What basics are there to programming in most languages?

所以,我的问题是:在大多数语言中编程有哪些基础知识?

7 个解决方案

#1


The term "basics" implies a short list, but to be an effective programmer you have to learn a LOT of concepts. Once you do learn them, though, you'll be able to apply many of the same concepts across languages.

术语“基础”意味着一个简短的列表,但要成为一名有效的程序员,您必须学习很多概念。但是,一旦你学会了它们,你就可以跨语言应用许多相同的概念。

I've compiled a (long!) list of concepts that are important in several, if not most, programming languages.

我已经编译了一个(很长的!)概念列表,这些概念在几种(如果不是大多数)编程语言中很重要。

  • Language syntax

    • Keywords
    • Naming conventions
    • Operators
      • Assignment
      • Arithmetic
      • String
      • Other
    • 运算符赋值运算字符串其他

    • Literals
    • Conditionals
      • If/else
      • Switch/case
      • What is considered true or false (0? Empty String? Null?)
      • 什么被认为是真或假(0?空字符串?空?)

    • 条件If / else Switch / case什么被认为是真或假(0?空字符串?空?)

    • Looping constructs
      • for
      • foreach/iteration
      • while
      • do-while
    • 循环结构为foreach / iteration而do-while

    • Exception handling
    • importing/including code from other files
    • 导入/包含其他文件的代码

  • 语言语法关键字命名约定运算符赋值算术字符串其他文字条件语句if / else切换/大小写什么是真或假(0?空字符串?空?)循环构造foreach / iteration而do-while异常处理导入/包含代码来自其他文件

  • Type system

    • Strong/weak
    • Static/dynamic
  • 类型系统强/弱静态/动态

  • Memory management

  • Scoping

    • What scopes are available
    • 有哪些范围可用

    • How overlapping scopes are handled
    • 如何处理重叠范围

  • 范围可用的范围如何处理重叠范围

  • Language constructs/program organization

    语言结构/程序组织

    • Variables
    • Methods
    • Functions
    • Classes
    • Closures
    • Packages/Modules/Namespaces
  • Data types and data structures

    数据类型和数据结构

    • Primitives
    • Objects
    • Arrays/Lists
    • Maps/Hash/Associative Array
    • Sets
    • Enum
    • Strings
      • String concatenation
      • String comparison and equality
      • 字符串比较和相等

      • Substring
      • Replacement
      • Mutability
      • Syntax for creating literal strings
      • 用于创建文字字符串的语法

    • 字符串字符串连接字符串比较和相等子字符串替换可变性用于创建文字字符串的语法

  • Functions, Methods, Closures

    功能,方法,闭包

    • Method/function overloading
    • Method/function overriding
    • Parameter passing (pass-by-value/pass-by-reference
    • 参数传递(按值传递/按引用传递

    • Returning values (single return/multiple return)
    • 返回值(单次返回/多次返回)

  • Language type (not mutually exclusive)

    语言类型(不相互排斥)

    • Scripting
    • Procedural
    • Functional
    • Object-oriented
  • Object-oriented principles

    • Inheritance
    • Classical vs Prototypical
    • 经典与原型

    • Single, Multiple, or something else
    • 单个,多个或其他

    • Classes
    • Static variables/global variables
    • 静态变量/全局变量

    • access modifiers (private, public, protected)
    • 访问修饰符(私有,公共,受保护)

  • 面向对象原则继承经典与原型单一,多个或其他类静态变量/全局变量访问修饰符(私有,公共,受保护)

  • API (or how to do basic stuff)

    API(或如何做基本的东西)

    • Basic I/O
    • Print to Standard Out
    • 打印到标准输出

    • Read from Standard in
    • 阅读标准版

    • File I/O
      • Read a file
      • 读一个文件

      • Write a file
      • 写一个文件

      • Check file attributes
      • 检查文件属性

    • 文件I / O读取文件写入文件检查文件属性

    • Use of regular expressions
    • 使用正则表达式

    • Referencing environment variables
    • 引用环境变量

    • Executing system commands
    • 执行系统命令

    • Threading model
      • Create threads
      • Thread-safety
      • Synchronization primitives
    • 线程模型创建线程线程安全同步原语

    • Templating

#2


Another important thing not mentioned here yet is just Object Oriented Programming. The ideas revolving around classes, inheritence, interfaces, etc.

此处未提及的另一个重要事项是面向对象编程。围绕类,继承,接口等的想法。

#3


A very important basic programming skill is the ability to think at many different levels of abstraction and to know when and which level of abstraction is the most appropriate for a particular programming task.

一个非常重要的基本编程技能是能够在许多不同的抽象级别进行思考,并知道何时以及哪个抽象级别最适合特定的编程任务。

#4


Pointers. Because so few people actually understand them.

指针。因为很少有人真正理解它们。

Recursion and iteration, plus what the difference is, and when you use them.

递归和迭代,加上差异,以及何时使用它们。

Get an algorithms book and work through the exercises -- you won't be disappointed.

获取算法书并完成练习 - 您不会失望。

#5


Testing! (unit testing, integration testing, fixtures, mock objects, ...)

测试! (单元测试,集成测试,夹具,模拟对象,......)

And not a programming skill, but surely a development skill: using revision control, and learning to commit sets of changes that handle one (or a few related) requirement, or bugfix, and will always result in a source tree that compiles without errors. This will teach you to organize your work :-)

而不是编程技能,但肯定是一种开发技能:使用修订控制,并学习提交处理一个(或几个相关)需求或错误修复的更改集,并且总是会导致编译时没有错误的源树。这将教你组织你的工作:-)

And last but not least: English... :-) Again, this is not a programming skill, and I know some may disagree, but I feel that any programming language that uses English keywords, should also be programmed in English. So: use English variable names, and so on. I'd even say that the code comments should be in English, but I am sure even more people would disagree about that... So: learn how others describe their code, and adhere to that.

最后但并非最不重要的是:英语...... :-)同样,这不是编程技巧,我知道有些人可能不同意,但我觉得任何使用英文关键词的编程语言也应该用英文编程。所以:使用英文变量名,依此类推。我甚至会说代码注释应该是英文的,但我相信更多的人会不同意这一点......所以:了解别人如何描述他们的代码,并坚持这一点。

#6


If I were you, I'd go back and learn the C programming language from the class K&R book.

如果我是你,我会回去学习K&R课程中的C编程语言。

#7


Find out what sort of thing you want to program for first - e.g. web, PC applications, Java based applications, mobile devices, reports, system interfaces, business to business interfaces, etc. then go from there.

找出你想要首先编程的东西 - 例如web,PC应用程序,基于Java的应用程序,移动设备,报告,系统接口,企业对企业界面等,然后从那里开始。

#1


The term "basics" implies a short list, but to be an effective programmer you have to learn a LOT of concepts. Once you do learn them, though, you'll be able to apply many of the same concepts across languages.

术语“基础”意味着一个简短的列表,但要成为一名有效的程序员,您必须学习很多概念。但是,一旦你学会了它们,你就可以跨语言应用许多相同的概念。

I've compiled a (long!) list of concepts that are important in several, if not most, programming languages.

我已经编译了一个(很长的!)概念列表,这些概念在几种(如果不是大多数)编程语言中很重要。

  • Language syntax

    • Keywords
    • Naming conventions
    • Operators
      • Assignment
      • Arithmetic
      • String
      • Other
    • 运算符赋值运算字符串其他

    • Literals
    • Conditionals
      • If/else
      • Switch/case
      • What is considered true or false (0? Empty String? Null?)
      • 什么被认为是真或假(0?空字符串?空?)

    • 条件If / else Switch / case什么被认为是真或假(0?空字符串?空?)

    • Looping constructs
      • for
      • foreach/iteration
      • while
      • do-while
    • 循环结构为foreach / iteration而do-while

    • Exception handling
    • importing/including code from other files
    • 导入/包含其他文件的代码

  • 语言语法关键字命名约定运算符赋值算术字符串其他文字条件语句if / else切换/大小写什么是真或假(0?空字符串?空?)循环构造foreach / iteration而do-while异常处理导入/包含代码来自其他文件

  • Type system

    • Strong/weak
    • Static/dynamic
  • 类型系统强/弱静态/动态

  • Memory management

  • Scoping

    • What scopes are available
    • 有哪些范围可用

    • How overlapping scopes are handled
    • 如何处理重叠范围

  • 范围可用的范围如何处理重叠范围

  • Language constructs/program organization

    语言结构/程序组织

    • Variables
    • Methods
    • Functions
    • Classes
    • Closures
    • Packages/Modules/Namespaces
  • Data types and data structures

    数据类型和数据结构

    • Primitives
    • Objects
    • Arrays/Lists
    • Maps/Hash/Associative Array
    • Sets
    • Enum
    • Strings
      • String concatenation
      • String comparison and equality
      • 字符串比较和相等

      • Substring
      • Replacement
      • Mutability
      • Syntax for creating literal strings
      • 用于创建文字字符串的语法

    • 字符串字符串连接字符串比较和相等子字符串替换可变性用于创建文字字符串的语法

  • Functions, Methods, Closures

    功能,方法,闭包

    • Method/function overloading
    • Method/function overriding
    • Parameter passing (pass-by-value/pass-by-reference
    • 参数传递(按值传递/按引用传递

    • Returning values (single return/multiple return)
    • 返回值(单次返回/多次返回)

  • Language type (not mutually exclusive)

    语言类型(不相互排斥)

    • Scripting
    • Procedural
    • Functional
    • Object-oriented
  • Object-oriented principles

    • Inheritance
    • Classical vs Prototypical
    • 经典与原型

    • Single, Multiple, or something else
    • 单个,多个或其他

    • Classes
    • Static variables/global variables
    • 静态变量/全局变量

    • access modifiers (private, public, protected)
    • 访问修饰符(私有,公共,受保护)

  • 面向对象原则继承经典与原型单一,多个或其他类静态变量/全局变量访问修饰符(私有,公共,受保护)

  • API (or how to do basic stuff)

    API(或如何做基本的东西)

    • Basic I/O
    • Print to Standard Out
    • 打印到标准输出

    • Read from Standard in
    • 阅读标准版

    • File I/O
      • Read a file
      • 读一个文件

      • Write a file
      • 写一个文件

      • Check file attributes
      • 检查文件属性

    • 文件I / O读取文件写入文件检查文件属性

    • Use of regular expressions
    • 使用正则表达式

    • Referencing environment variables
    • 引用环境变量

    • Executing system commands
    • 执行系统命令

    • Threading model
      • Create threads
      • Thread-safety
      • Synchronization primitives
    • 线程模型创建线程线程安全同步原语

    • Templating

#2


Another important thing not mentioned here yet is just Object Oriented Programming. The ideas revolving around classes, inheritence, interfaces, etc.

此处未提及的另一个重要事项是面向对象编程。围绕类,继承,接口等的想法。

#3


A very important basic programming skill is the ability to think at many different levels of abstraction and to know when and which level of abstraction is the most appropriate for a particular programming task.

一个非常重要的基本编程技能是能够在许多不同的抽象级别进行思考,并知道何时以及哪个抽象级别最适合特定的编程任务。

#4


Pointers. Because so few people actually understand them.

指针。因为很少有人真正理解它们。

Recursion and iteration, plus what the difference is, and when you use them.

递归和迭代,加上差异,以及何时使用它们。

Get an algorithms book and work through the exercises -- you won't be disappointed.

获取算法书并完成练习 - 您不会失望。

#5


Testing! (unit testing, integration testing, fixtures, mock objects, ...)

测试! (单元测试,集成测试,夹具,模拟对象,......)

And not a programming skill, but surely a development skill: using revision control, and learning to commit sets of changes that handle one (or a few related) requirement, or bugfix, and will always result in a source tree that compiles without errors. This will teach you to organize your work :-)

而不是编程技能,但肯定是一种开发技能:使用修订控制,并学习提交处理一个(或几个相关)需求或错误修复的更改集,并且总是会导致编译时没有错误的源树。这将教你组织你的工作:-)

And last but not least: English... :-) Again, this is not a programming skill, and I know some may disagree, but I feel that any programming language that uses English keywords, should also be programmed in English. So: use English variable names, and so on. I'd even say that the code comments should be in English, but I am sure even more people would disagree about that... So: learn how others describe their code, and adhere to that.

最后但并非最不重要的是:英语...... :-)同样,这不是编程技巧,我知道有些人可能不同意,但我觉得任何使用英文关键词的编程语言也应该用英文编程。所以:使用英文变量名,依此类推。我甚至会说代码注释应该是英文的,但我相信更多的人会不同意这一点......所以:了解别人如何描述他们的代码,并坚持这一点。

#6


If I were you, I'd go back and learn the C programming language from the class K&R book.

如果我是你,我会回去学习K&R课程中的C编程语言。

#7


Find out what sort of thing you want to program for first - e.g. web, PC applications, Java based applications, mobile devices, reports, system interfaces, business to business interfaces, etc. then go from there.

找出你想要首先编程的东西 - 例如web,PC应用程序,基于Java的应用程序,移动设备,报告,系统接口,企业对企业界面等,然后从那里开始。