Science

[Science][bleft]

Apple Related

[Apple][bleft]

Technology

[Technology][twocolumns]

Programming Progress (C++) Vol 1: Compilers

Vol 1: Compilers

So you want to know how to Program in C++, eh? Of course you do otherwise you wouldn't be here. But of course you have to start somewhere right? I'll shoot it straight with you, programming isn't that complicated depending on what you're programming. I mean, of course professional programmers are doing some complicated stuff and maybe you're headed in that direction, maybe not. Either way this is a pretty good place to start.

By the time I'm done writing the series, this still won't make sense

Haha, good joke right? I should clarify that this is a series on programming in C++. (The language in the picture above is not C++) So now that we've got that settled let's dig into the nitty gritty concepts. In fact let's start with the most important thing you need to program in any language really.

The Compiler:

Have you ever tried to speak to your computer? Well, through various methods of input like typing or clicking technically yes you have. But your computer is weird, it only understands ones and zeros. A lot of you already know I'm talking about binary, so how is it that our words in programming languages can be translated as ones and zeros? If you said the obvious answer of "Compiler" You'd be correct. If you said anything else you need to re-evaluate some things the answer was literally the title of this article.


Hurrdurr pbblt = 1010100001010111010110101101010
So essentially I've told you that a computer only understands ones and zeros and the compiler translates your gibberish into the logical syntax a computer uses. But there are many more uses for the compiler. For example it's also used to sort of 'spellcheck' your work. 

Think about it like this. Let's say you're going along doing your programming, everything looks fine. But you used one of the commands wrong or you forgot to end a command. Suddenly your code makes absolutely zero sense to the computer and either a) nothing will happen or b) something crashes.



Neither of those situations sound fun do they?

So the compiler will politely tell you "Hey this part doesn't make sense to me. You should probably revisit it" in less words than that of course, sometimes more. 

Troubleshooting for errors.

They also keep your programming environment neat. Actually I'll add a disclaimer; some of them keep your programming environment neat. Some of them like to see your work messed up like Albert Einsteins desk after he left us. But you can pick whichever one you like it usually won't matter. Since we're now getting into the differentiation of compilers let me give you some options as to which ones to pick.


#1. Code::Blocks (http://www.codeblocks.org/)

Of course number one on my list is going to be Code::Blocks. This compiler is basically my drug. It does C++ and C so if you wanted to do both these languages you're set here. It keeps your environment neat, and it gives you back rubs after long nights of programming (I think).

#2. Eclipse (https://eclipse.org/)

I really liked eclipse, using it was fun. But setting it up for C++ is going to be a nightmare for you. If you're absolutely new at this, don't bother with Eclipse use one of the others on this list. If you've got some experience in another language feel free to pick this one if you feel like going through the hassle of setting up the non-natural environment. I'm not sure if they made it easier or not but give it a shot.

#3 Dev C++ (http://www.bloodshed.net/devcpp.html)

Dev C++ was actually the very first compiler I ever used when I was 17. That being said I have no idea of what changes they've made to it since then but it was very solid when I used it.  I can't imagine it's gotten very much worse so for the uber beginner this is also a very good start.



There are tons of compilers out there besides these three. But these are my favorites so I figured I'd share them with you guys. By all means feel free to search and see if you can find different better ones. If you do find one that's awesome tell me in the comments below!

~Ritter