Changes

Jump to navigation Jump to search
1,683 bytes added ,  05:31, March 29, 2024
m
added category
Line 29: Line 29:  
In Pascal:
 
In Pascal:
 
<pre>
 
<pre>
−
     P := pos( HT, S ) + 1 ;
+
     P := Pos( HT, S ) + 1 ;
 
     while( S[ P ] <> HT ) do inc( P ) ;
 
     while( S[ P ] <> HT ) do inc( P ) ;
 
</pre>
 
</pre>
Line 51: Line 51:  
     mov edx,[ebp-8]
 
     mov edx,[ebp-8]
 
     cmp byte ptr [eax+edx-1],9
 
     cmp byte ptr [eax+edx-1],9
−
     jnz loop:
+
     jnz loop
 
</pre>
 
</pre>
   Line 70: Line 70:     
====Imperative programming====
 
====Imperative programming====
−
This is the most common type of programming language, and many of the other paradigms are derived from or build on this. When using an imperative language, the programmer is responsible for giving precise instructions as to exactly what has to be done and in what order. Note that some programs may have a random element included so that the results of a program are not necessarily predictable.  
+
Also known as '''Procedural Programming''', this is the most common type of programming language, and many of the other paradigms are derived from or build on this. When using an imperative language, the programmer is responsible for giving precise instructions as to exactly what has to be done and in what order. Note that some programs, such as games, may have a random element included so that the results of a program are not necessarily predictable.  
    
Early high-level programming languages were often intended for use in a particular problem domain:
 
Early high-level programming languages were often intended for use in a particular problem domain:
Line 131: Line 131:     
:[[FORTRAN]] showed that a useful high-level language was possible.  
 
:[[FORTRAN]] showed that a useful high-level language was possible.  
−
:[[COBOL]] provided a language especially for business use.
+
:[[Cobol|COBOL]] provided a language especially for business use.
−
:[[LISP]] provided a language suitable for symbol processing.
+
:[[Lisp|LISP]] provided a language suitable for symbol processing.
 
:Algol 60 was the first block-structured language and set a new standard in language definition (Backus-Naur form).
 
:Algol 60 was the first block-structured language and set a new standard in language definition (Backus-Naur form).
 
::Algol 60 was described by Edsger Dijkstra, as "a great improvement on many of its successors".
 
::Algol 60 was described by Edsger Dijkstra, as "a great improvement on many of its successors".
Line 139: Line 139:  
:[[C]] showed that operating systems and compilers could be written in a high-level language.
 
:[[C]] showed that operating systems and compilers could be written in a high-level language.
   −
==Programming Concepts==
+
==Basic Programming Concepts==
 
Certain concepts and constructs are common to most, if not all, programming languages.  The exact syntax and semantics will vary from language to language, but the basic concepts remain the same.  All languages support reserved keywords which define the vocabulary of the language.  Identifiers are user-specified words that can be used to name variables, functions, constants, and more.
 
Certain concepts and constructs are common to most, if not all, programming languages.  The exact syntax and semantics will vary from language to language, but the basic concepts remain the same.  All languages support reserved keywords which define the vocabulary of the language.  Identifiers are user-specified words that can be used to name variables, functions, constants, and more.
   Line 149: Line 149:     
===Data Types===
 
===Data Types===
−
[[Data type|Data types]] indicate both how much data is stored as well as how that data can be processed and represented.  Some languages (such as [[PHP]]) are typeless, indicating that variables can store any type of data.  Other languages (such as [[C++]]) are strictly typed, indicating that each variable can only store data of a given type.
+
[[Data type|Data types]] indicate both how much data is stored as well as how that data can be processed and represented.  Some languages (such as [[Python (programming language)|Python]]) are typeless, indicating that variables can store any type of data.  Some (such as [[PHP]]) are loosely typed, which means that variables can be given a defined type, but this is not always strictly enforced. Other languages (such as [[C++]]) are strictly typed, indicating that each variable can only store data of a given type.
    
===Literals===
 
===Literals===
Line 203: Line 203:  
===Pragmas/Directives===
 
===Pragmas/Directives===
 
Pragmas (aka directives) provide a way of changing options associated with a compiler.  For instance, a pragma may alter the memory alignment of data.  Conditional compilation is also provided by directives that enable or disable the inclusion of code depending upon external conditions (such as the platform that the program is being compiled upon).
 
Pragmas (aka directives) provide a way of changing options associated with a compiler.  For instance, a pragma may alter the memory alignment of data.  Conditional compilation is also provided by directives that enable or disable the inclusion of code depending upon external conditions (such as the platform that the program is being compiled upon).
 +
 +
==Advanced Programming Concepts==
 +
 +
===Synchronous vs. Asynchronous===
 +
Most programs operate in a synchronous manner: each statement is executed before the next statement is executed.  However, some languages have asynchronous abilities built into the language (such as Node.js) or there are optional libraries that can provide asynchronous behavior for other languages.  An asynchronous program is one that executes more than one statement concurrently.  The mechanism that provides the ability is sometimes called co-routines or, more often, threads.  A synchronous program is "single-threaded", while an asynchronous program is "multi-threaded".  Multiple threads can execute in parallel which can provide a performance benefit if used correctly.  For instance, while one thread is accepting input from the user, another thread can be writing data to a file, and yet another thread can be calculating the display of graphics.  Such an approach cannot be accomplished with synchronous code since each of these tasks must complete before the next one can start.
 +
 +
Multi-threading can provide benefits, but it also requires far more thought in program design, the use of exclusivity mechanisms (such as mutexes, spinlocks, and/or critical sections) to protect data from being updated at the same time by multiple threads, and multi-threaded code can be exceedingly difficult to maintain and debug.
    
==Prescient Quotes on Police State Programming Surveillance==
 
==Prescient Quotes on Police State Programming Surveillance==
Line 213: Line 220:  
[[Category:Information Technology]]
 
[[Category:Information Technology]]
 
[[Category:Computer Science]]
 
[[Category:Computer Science]]
 +
[[Category:Programming Languages|*]]
SkipCaptcha
843

edits

Navigation menu