Re: Education (Example of a world gone mad?)
Posted: Sun Mar 28, 2010 11:45 am
If you want to see it, I can email it to you.
EDIT:Scott wrote: So to follow up our conversations, I sent this e-mail. It contains
information that will start you on your exciting adventure into
programming. Be prepared for a long read.
I'm not going to lecture you (as I am not a professor.....yet) but I
will give you links and advice that will hopefully be useful. I will
also show you the code for the "Hello World" program for each
language.*
*A "Hello World" program is the common starting program for any
beginner. It simply writes "Hello World" to the screen.
RUBY
Ruby is a very high level programming language (that means there is a
high degree of abstraction from what a computer actually communicates
in (if you still don't get it just ask or check Wikipedia )) and
unfortunately is interpreted. THIS means that you cannot just run it
on any machine. You need the Ruby interpreter. For instance, if I
spoke German you would most likely not have a clue what I am saying
(assuming you're not German, which I am assuming). The same thing goes
for programming. Although programming languages may look like a
computer communicating, it is not. Of course computers communicate in
binary. People did used to program in assembly which is so low level
(not abstract to what the computer does) it look more complicated that
binary. Anyway, interpreted languages are in German and the computer
in English. They need the interpreter to translate it so they will
know what you are saying. Even though it is interpreted, Ruby is a
good language to start with. It is easy to read (know as beautiful
code) and there is lots of help and tutorials out there.
You can check the Ruby site out and download the interpreter and libraries here:
http://www.ruby-lang.org/
Another link to get you started on Ruby is here:
pine.fm/LearnToProgram/
Other languages similar to Ruby are Python, Perl, and many more. I do
suggest Ruby though because it is the most popular out of the 3
(although Python is gaining popularity because of it's ability to
compile). *Compiling will be explained later*
"Hello World" in Ruby
As you can see it is very high level as most people could guess whatCode: Select all
puts 'Hello World' gets.chomp
that does. If you see "" around the program, that means BBCodeCode: Select all
doesn't work with Gmail in which I am currently using! Yay, I'm a
failure! But seriously, even if it doesn't work, it does separate it
from the text here. On most forums they would want you to use that for
easier readability.
C++ is completely different from Ruby. It is not as high level but it
is much more flexible. Not to say Ruby is bad, it is definitely a good
starting point if you are worried about the complexities of C++. Ruby
teaches how to use techniques in a simple manner, and C++ shows you
the complex ways of using the same techniques. Also math is important,
be good at math.
C++
C++ is complex but a very fun and efficient language. I made a test to
see which language could count to 10 million the quickest. Ruby took
about 33 seconds on average while C++ only took 0.7 seconds on
average. It's a staggering amount although again, Ruby is still good.
Back to C++. C++ IS compilable and not interpreted. This means that
you compile a program and turn into a .exe (standard application
extension). This can now run on most machines. To go back to the
German to English analogy, the German man learns a fractured English
phrase which most English people could make out what he was saying.
Some may have no clue and some may not have noticed it's fractured. If
the German man wants to add something else onto the phrase, a
verb(human) or a multidimensional array(computer), then he will have
to go back to the German-English dictionary and find out what he needs
to learn. So back to programming, you create a C++ program (actually a
source file) and the compiler turns it into a program that can be run
anywhere. The program is the scrap piece of paper he wrote it on. The
program in the interpreted scenario was the words the interpreter
spoke to the English person. It's just quicker if there is no middle
man. C++ is more difficult but still a very fun language to learn.
A compiler to start of with can be found here:
http://bloodshed-dev-c.en.softonic.com/
Many people say it's outdated (which it is only in features) but it's
simple interface makes it easy to learn on.
Tutorial:
http://www.cplusplus.com/doc/tutorial/
Great website with a helpful forum base.
Book:
Sams Teach Yourself C++ in 21 Days
This is the book I am currently using and is highly recommended. In
case you haven't noticed, I have been using it for well over 21 days.
This is because the title is complete BS but the content is very good.
You will get content, summary, FAQ, varied exercises, and answers for
each lesson. You can find this book online or at Chapters. It is more
expensive than an average book because it could be used as a text book
and we both know how expensive those suckers are.
Practicing is the best way to learn something. Programming is no
exception. Here is a link to some very good exercises from beginner to
expert:
http://www.cplusplus.com/forum/articles/12974/
Disregard the Suggested Study Order. I don't find this a very good
order but it is still up to you.
"Hello World" in C++
Much more complex right? Well it is. It is doesn't hard to understandCode: Select all
#include <iostream> int main() { std::cout << "Hello World\n"; std::cin.get(); std::cin.get(); return 0; }
though, just look complex when you don't know what it is. Also, afterit is really just makingCode: Select all
std::cout << "Hello World\n";
sure that console to close to earlier and let's the user shut it down.
That's whatwas in the Ruby version.Code: Select all
gets.chomp
Hope this was helpful and feel free to ask about anything.
- Scott