To be an uber-nerd.... (the basics of programming)
+2
vladmirbsl69
LOOK IT'S ADAM!!!
6 posters
Page 1 of 1
To be an uber-nerd.... (the basics of programming)
Regular programming (procedural / linear)
Object-oriented programming
Interpreted vs. compiled
Where do I start?
This largely depends on how much you know about the fundamentals of how a computer works and the operating system you use. Consider the following:
If you were able to answer half of those with “yes”, QBASIC is a great place to start. QBASIC is an improved version of the Microsoft basic programming language shipped with the MSDOS operating system. The commands are as straightforward, the IDE contains documentation on all the commands, and the compiler is built into the IDE. This language is currently only available for use in windows systems <QBASIC download link>
If you answered yes to all questions, C is a great place to start. Often used in 101 CSC courses in computer science classes across America, it is the basis for all modern languages. The setup is slightly more complex, an external compiler is needed and all source code is written in plain text (no IDE). A linux/unix platform is preferred for C, the compiler I use (gcc) runs natively in most open source platforms and the ubuntu synaptic package manager installs it hassle-free.
- Examples: any “BASIC” language, C
Procedural programming is a set of instructions that are executed in order from beginning to end. Loops and “goto” commands can alter the flow, but it is still very linear. Concepts in linear programming are usually very straightforward and easy to follow.
A large part of linear programming is writing functions. Functions are snippets of code that do one specific thing. For example, a function called “triangle_area()” might take in the lengths of the sides of a triangle and return the area. Writing a function allows the programmer to write a single line of code to represent many.
Object-oriented programming
- Examples: C++ , Java, Python, Perl, ect…
Object oriented programming is much more abstract than linear programming. It largely deals with “classes”, which are collections of information and corresponding actions that affect that information.
For example, an object oriented program could have a “BankAccount” class that represents one person’s bank account. In the BankAccount class, there are variables(data) that represent the balance, interest rate, account owner, and account number. Also in the BankAccount class, there exists methods(actions) that do specific things to that data such as deposit money, withdraw money, and compound interest. These actions are tied to the class.
Abstract ideas such as linked lists, data trees, and binary space partitions are used commonly in object oriented programming, and nearly 100% of current computer games are written in object oriented languages.
Interpreted vs. compiled
- Programming languages come in two varieties, interpreted (scripted), and compiled.
Compiled languages are far more common. A compiler takes the source code and translates it into a binary file which the computer can execute. All programs on your computer are compiled programs. Compiled programs are usually much faster than their scripted counterparts because the translation process has already been taken care of. The downside to compiling your programs is you can only compile your program for one computer setup, this is the reason you can’t use PC programs on a MAC and vice versa. The CPU architecture for MACs and PC differs, the binary commands do different things for each setup.
What interpreted languages lack in speed they make up for in versatility. Interpreted languages are only translated to machine code as they are executed. This interpreter is different for every machine, but the code itself can go across any platform. JavaScript (not java) is an example of this. The same JavaScript code is used for every platform, but the interpreter (your internet browser of choice) differs for every operating system.
Where do I start?
This largely depends on how much you know about the fundamentals of how a computer works and the operating system you use. Consider the following:
- Do you know what a “variable” is in the context of
computer programming? - Do you understand how a basic program such as the
following would “flow”?- Code:
i=0
while (i < 10)
{
print i
}
- Do you understand how to implement functions?
- Do you know what is meant by “integer division”?
- Do you understand how a computer stores values for
short-term use? - Do you know what memory addresses are?
- Do you use windows or a linux/unix operating system?
If you were able to answer half of those with “yes”, QBASIC is a great place to start. QBASIC is an improved version of the Microsoft basic programming language shipped with the MSDOS operating system. The commands are as straightforward, the IDE contains documentation on all the commands, and the compiler is built into the IDE. This language is currently only available for use in windows systems <QBASIC download link>
If you answered yes to all questions, C is a great place to start. Often used in 101 CSC courses in computer science classes across America, it is the basis for all modern languages. The setup is slightly more complex, an external compiler is needed and all source code is written in plain text (no IDE). A linux/unix platform is preferred for C, the compiler I use (gcc) runs natively in most open source platforms and the ubuntu synaptic package manager installs it hassle-free.
Last edited by LOOK IT'S ADAM!!! on 22/7/2010, 01:51; edited 1 time in total
LOOK IT'S ADAM!!!- Clan Member
- Posts : 511
Join date : 2010-02-16
Age : 34
Location : Cal Poly, the real one.
Re: To be an uber-nerd.... (the basics of programming)
My brain just asploded.(no not explode, asplode.)
Image found via google
- Spoiler:
Image found via google
vladmirbsl69- Posts : 1091
Join date : 2010-03-01
Age : 28
Location : Myrtle Beach, SC
Afro- Posts : 207
Join date : 2010-04-20
Age : 30
Re: To be an uber-nerd.... (the basics of programming)
I've took up basics of C# and Java , gave up cuz no motivation to learn advanced shit ftw .
Google- Clan Member
- Posts : 998
Join date : 2010-04-01
Age : 31
Location : New York, USA
Re: To be an uber-nerd.... (the basics of programming)
C# and Java aren't good places to start
LOOK IT'S ADAM!!!- Clan Member
- Posts : 511
Join date : 2010-02-16
Age : 34
Location : Cal Poly, the real one.
Re: To be an uber-nerd.... (the basics of programming)
example obligatory "hello world" and "count to ten" programs for a few of the languages i mentioned
- Code:
----QBASIC----
print "hello world"
for t = 1 to 10
print t
next
----C----
printf("hello world");
int t = 0;
for (t=1; t<11; t++)
{
printf("%d\n", t);
}
----Java----
System.out.println("hello world");
for (int t = 1; t <11; t++)
{
System.out.println(t);
}
----C++----
cout << "hello world";
int t;
for (t=1; t<11; t++)
{
cout << t << "\n";
}
Last edited by LOOK IT'S ADAM!!! on 22/7/2010, 01:53; edited 2 times in total
LOOK IT'S ADAM!!!- Clan Member
- Posts : 511
Join date : 2010-02-16
Age : 34
Location : Cal Poly, the real one.
Re: To be an uber-nerd.... (the basics of programming)
Adam are you fluent in sourcemod programming? It uses a lot of c++.
jameless- Senior Game Admin
- Posts : 955
Join date : 2010-01-04
Age : 42
Location : Florida
Re: To be an uber-nerd.... (the basics of programming)
----C----
printf("hello world");
int t = 0;
for (t=1; t<11; t++)
{
printf("%d\n");
}
Why do you write %d instead of t (sorry, C is kinda far in my memory(
printf("hello world");
int t = 0;
for (t=1; t<11; t++)
{
printf("%d\n");
}
Why do you write %d instead of t (sorry, C is kinda far in my memory(
Nicobbq- Forum Admin
- Posts : 1083
Join date : 2010-01-02
Age : 33
Location : Quebec, Canada
Re: To be an uber-nerd.... (the basics of programming)
Nicobbq wrote:----C----
printf("hello world");
int t = 0;
for (t=1; t<11; t++)
{
printf("%d\n");
}
Why do you write %d instead of t (sorry, C is kinda far in my memory(
oops, i forgot to put the t in there. anyways, the printf command only accepts single arguments, you can't pass multiple items to it at once. i could have just put "printf(t);", but then every number would be printed on the same line. i needed to pass a string to include a newline character, the %d is a placeholder for the next variable behind the comma.
jameless wrote:Adam are you fluent in sourcemod programming? It uses a lot of c++.
i'm not yet. until recently i had no idea how to use object oriented programming. i might get into it a little later though. the api is kind of confusing to get around.
LOOK IT'S ADAM!!!- Clan Member
- Posts : 511
Join date : 2010-02-16
Age : 34
Location : Cal Poly, the real one.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|