Off Topic > Off Topic
Programming Megathread
Becquerel:
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.0
GENERATIONS OF PROGRAMMING LANGUAGES
Programming 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
--- Code: ---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
--- End code ---
Batch / .BAT (example code shows a Hello World Script in a BAT file)
--- Code: ---@ECHO off
ECHO Hello World!
PAUSE
--- End code ---
C (Example code is a Hello World script)
--- Code: ---//C hello world example
#include <stdio.h>
int main()
{
printf("Hello world\n");
return 0;
}
--- End code ---
C++ (Again a Hello World Script)
--- Code: ---// my first program in C++
#include <iostream>
int main()
{
std::cout << "Hello World!";
}
--- End code ---
C#
--- Code: ---// Hello1.cs
public class Hello1
{
public static void Main()
{
System.Console.WriteLine("Hello, World!");
}
}
--- End code ---
Clojure
--- Code: ---(def hello (fn [] "Hello world"))
-> #'user/hello
(hello)
-> "Hello world"
--- End code ---
COBOL
--- Code: --- Identification Division.
Program-ID. sampleCOBOL.
Data Division.
Procedure Division.
Main-Paragraph.
Display "Hello World!"
Stop Run.
--- End code ---
Java
--- Code: ---public class HelloWorld {
public static void main(String[] args) {
// Prints "Hello, World" to the terminal window.
System.out.println("Hello, World");
}
}
--- End code ---
Lua
--- Code: --- print("Hello World")
--- End code ---
Javascript
--- Code: ---console.log("Hello World!");
--- End code ---
Perl
--- Code: --- #!/usr/bin/perl
#
# The traditional first program.
# Strict and warnings are recommended.
use strict;
use warnings;
# Print a message.
print "Hello, World!\n";
--- End code ---
PHP
--- Code: ---<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World</p>'; ?>
</body>
</html>
--- End code ---
Python
--- Code: ---print('Hello world!')
--- End code ---
Ruby
--- Code: ---puts "Hello World"
--- End code ---
SQL
--- Code: ---SELECT * FROM Customers;
--- End code ---
--- Code: (Haskell) ---main = putStrLn "Hello World!"
--- End code ---
Here's a quick implementation of quick sort just for fun:
--- Code: (Haskell) ---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
--- End code ---
[/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
CONTRIBUTIONS
Have 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]
shitlord:
u forgot python
Becquerel:
--- Quote from: stufflord on October 28, 2015, 09:07:33 PM ---u forgot python
--- End quote ---
i dont know how i missed that
adding to OP
Fab:
https://youtu.be/UIWWLg4wLEY
Becquerel:
--- Quote from: Fab on October 28, 2015, 09:08:37 PM ---https://youtu.be/UIWWLg4wLEY
--- End quote ---
Thats actually kinda cool!
Adding to OP under new category "Just what can programming do?"