Welcome to this Programming Megathread!
WHAT IS PROGRAMMING?Programming is one of the most important aspects of a Computer, because without Programming, Computers cant do much! By itself, Programming is a digitally written set of instructions that instructs the computer to do what the code tells the computer to do.
WHAT IS A COMPUTER?A computer is in its base form is a calculator of instructions that perform an output based upon the Input and what happens to the input to become Output. Please refer to the Personal Computer Megathread for more!
http://forum.blockland.us/index.php?topic=218177.0GENERATIONS OF PROGRAMMING LANGUAGESProgramming Generations are simply a way to classify programming languages by complexity
Generation I: Machine Code. This code is very complex and is executed directly by the CPU to produce the specified output. Very hard to read and write with, but simple for a CPU to process
Generation II: Assembly Languages are low level languages more complex but requires a assembler to be useful. Each language is specific to an individual system.
Generation III: These languages are high level ones. Whereas Generation IIs are machine dependent, Generation IIIs are more programmer friendly and easier to write with. Examples are COBOL, Fortran, and more popular ones like Java, C++, BASIC, and Pascal.
Generation IV: These languages have narrower uses but are still common, like Database accessing. These languages are closer to human lanaguages than Generation IIIs.
Generation V: These languages are mostly used for Neural Networking and AI.
LIST OF COMMON LANGAUGES:
ASSEMBLY
BASIC
10 Cls
20 Print "Hello, world!"
30 Sleep
40 End
Bash (example code is a basic Bash Hello World script)
[code]
#!/bin/bash
echo Hello World
Batch / .BAT (example code shows a Hello World Script in a BAT file)
@ECHO off
ECHO Hello World!
PAUSE
C (Example code is a Hello World script)
//C hello world example
#include <stdio.h>
int main()
{
printf("Hello world\n");
return 0;
}
C++ (Again a Hello World Script)
// my first program in C++
#include <iostream>
int main()
{
std::cout << "Hello World!";
}
C#
// Hello1.cs
public class Hello1
{
public static void Main()
{
System.Console.WriteLine("Hello, World!");
}
}
Clojure
(def hello (fn [] "Hello world"))
-> #'user/hello
(hello)
-> "Hello world"
COBOL
Identification Division.
Program-ID. sampleCOBOL.
Data Division.
Procedure Division.
Main-Paragraph.
Display "Hello World!"
Stop Run.
Java
public class HelloWorld {
public static void main(String[] args) {
// Prints "Hello, World" to the terminal window.
System.out.println("Hello, World");
}
}
Lua
print("Hello World")
Javascript
console.log("Hello World!");
Perl
#!/usr/bin/perl
#
# The traditional first program.
# Strict and warnings are recommended.
use strict;
use warnings;
# Print a message.
print "Hello, World!\n";
PHP
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World</p>'; ?>
</body>
</html>
Python
print('Hello world!')
Ruby
puts "Hello World"
SQL
SELECT * FROM Customers;
main = putStrLn "Hello World!"
Here's a quick implementation of quick sort just for fun:
quickSort :: (Ord a, Eq a) => [a] -> [a]
quickSort [] = []
quickSort (x:xs) = smallerList ++ [x] ++ largerList
where smallerList = quickSort $ filter (<=x) xs
largerList = quickSort $ filter (>x) xs
[/quote]
More to be added on request
Just what can programming do?All sorts of things, from simple database querys to massive websites like Facebook to sattelite behaviour.
And as seen here, even functional Prototype AIs!
https://youtu.be/UIWWLg4wLEY
CONTRIBUTIONSHave something to add to the topic? Please post or PM me the content you want to add and Ill try and add to this post
Thanks for stopping by![/code]