我在编程方面有过一次很奇怪的学习经验。我被教会了一些C++,但我并没有从中得到很多东西。下面是我从其中得到的:标题和变量声明。我试着自学PHP,从中我学到了很多。问题是,我的很多知识是广泛的,随机的,并为特定的情况而设计的。
所以,我的问题是:用(大多数语言)编程有哪些基础知识?
发布于 2009-04-10 05:36:49
“基础”一词意味着一个简短的列表,但是要成为一个有效的程序员,你必须学习很多概念。但是,一旦您学习了它们,您就可以跨语言应用许多相同的概念。
我编了一个(长!)列出几种(如果不是大多数)编程语言中很重要的概念。
- Keywords
- Naming conventions
- Operators
- Assignment
- Arithmetic
- String
- Other
- Literals
- Conditionals
- If/else
- Switch/case
- What is considered true or false (0? Empty String? Null?)
- Looping constructs
- for
- foreach/iteration
- while
- do-while
- Exception handling
- importing/including code from other files
- Strong/weak
- Static/dynamic
management
- What scopes are available
- How overlapping scopes are handled
- Variables
- Methods
- Functions
- Classes
- Closures
- Packages/Modules/Namespaces
- 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
- Method/function overloading
- Method/function overriding
- Parameter passing (pass-by-value/pass-by-reference
- Returning values (single return/multiple return)
- Scripting
- Procedural
- Functional
- Object-oriented
- Inheritance
- Classical vs Prototypical
- Single, Multiple, or something else
- Classes
- Static variables/global variables
- access modifiers (private, public, protected)
- Basic I/O
- Print to Standard Out
- Read from Standard in
- File I/O
- Read a file
- Write a file
- Check file attributes
- Use of regular expressions
- Referencing environment variables
- Executing system commands
- Threading model
- Create threads
- Thread-safety
- Synchronization primitives
- Templating
发布于 2009-04-10 04:16:52
这里没有提到的另一件重要的事情就是面向对象编程。这些想法围绕着类、继承、接口等。
发布于 2009-04-10 04:52:18
一个非常重要的基本编程技能是能够在许多不同的抽象级别上进行思考,并知道何时以及哪个抽象级别最适合于特定的编程任务。
https://stackoverflow.com/questions/736668
复制相似问题