Introduction to programming

DON'T post new tutorials here! Please use the "Pending Submissions" board so the staff can review them first.
Post Reply
User avatar
leetnigga
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 447
Joined: 28 Jul 2009, 16:00
14

Introduction to programming

Post by leetnigga »

I started working on a tutorial today (see below) and I figured I would post it here to motivate myself to complete it and get any feedback if that's even possible at this stage. It's woefully incomplete, so I apologize in advance if it's not in the right section or if it's inappropriate to post.

It's meant to be a general introduction to programming without teaching any actual language. The idea here is to answer a lot of the questions that people have before they start. Without further ado:

Introduction to programming

What is programming?
Programming is the act of developing computer programs. You do this by writing, testing and debugging source code. This source code is written in a programming language, a language that the computer can understand.

What is a programming language?
A programming language is a machine-readable language used to tell a computer what to do.

Code: Select all

Show the text "Hello World" on the screen
If English were a programming language, this could be valid source code for a program. However, human languages are often too ambiguous and not strict enough to be succesfully interpreted by a computer, so instead we have programming languages. In a programming language, the previous program would look more like this:

Code: Select all

show "Hello World"
This is much easier for the computer to understand. For one, it's a lot more concise; it only says what's necessary. For two, the structure is a lot simpler. The first part tells the computer what to do and the second tells it what to do it to. In a lot of programming languages, writing a program to put text on the screen really is that simple.

What makes a programming language?
There are many different programming languages. If there was one programming language that worked best in every case and everybody agreed on, there wouldn't be so many. There is just no end all-be all programming language (yet). So what makes a programming language, exactly?

Compilation/interpretation
There are different ways to run a program. Programs can be compiled, which means they are made into an executable file, or they can be run with the help of an interpreter. An interpreter

Type system
Programs deal with a lot of data. The previous example showed one form of data: text, another example is a number. Most languages are typed. This means that the language makes a distinction between different types of data. For example, they won't allow you to divide a number by text. There are different approaches to this:
  • Statically typed languages
    In static typing, all data has their type determined before the program is run. If there is an error such as a number being divided by text, the program is simply invalid and it won't run at all.

    Manifestly typed: all types have to be written out explicitly
    Type-inferred: the

    Dynamically typed languages
    In dynamic typing, types are determined at runtime. If you divide a number by text somewhere in your program, you won't be alerted of it until it happens.
High-level, low-level
In a high level language you could say "Bitch, make me a sandwich", while in a low level language you would have to define who you are, who the bitch is, what a sandwich is and how to make one.

Some languages are designed to be easily understood by humans, others are designed to be easy for the computer to interpret.

Paradigm

What do I do now?
Now that you know what a programming language is, you may learn one.

User avatar
computathug
Administrator
Administrator
Posts: 2693
Joined: 29 Mar 2007, 16:00
17
Location: UK
Contact:

Post by computathug »

Nice post buddy :D

Moved to tutorials section :wink:
The devil can cite Scripture for his purpose.
-- William Shakespeare, "The Merchant of Venice"
https://tshirt-memes.com

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Post by ayu »

Lovely! :D
"The best place to hide a tree, is in a forest"

Post Reply