Before we can do anything, we’ve got to cover the basics. Here’s what you have to know before you can get started.
WHEN WE SAY «PROGRAMMING,» WHAT DOES THAT REALLY MEAN?
For this article, we’re going to use a fairly narrow definition of programming, and say that what we’re talking about is the process of creating software on a computer. That process involves writing out a series of commands for the computer to execute, which will create our desired behavior. We write those commands using a programming language.
WHAT’S A PROGRAMMING LANGUAGE?
There’s an incredible variety of programming languages available for use, but the vast majority of commercial and personal software is written in one of a core group of languages including C/C++, Java, C#, Python, and a few others. Modern programming languages share a lot of the same basic concepts and some syntax, so learning your second, third, or fourth programming language is much easier than learning your first.
what makes one programming language different from another?
C and C++ are low-level languages, meaning that code written in C is closer to the machine code that your CPU understands (see sidebar below). Low-level languages can produce faster, more efficient software, so they’re used where performance is at a premium—for programming an operating system or a 3D gaming engine, for instance. High-level languages, like Java and Python, have the advantage of being much easier to program in, and the same program can generally be written with fewer lines of code in a high-level language.
But which one’s the best?
There’s no one best language — it really depends on what kind of programming you want to do. If you want to program native Windows applications, you’ll use C#; if you want to program sophisticated web applications, Ruby would be a good choice; if you want to be the next John Carmack, you should probably start with C.
No, for real, which language should I START WITH?
The secret is to not stress too much about whichever particular language you start with. The important things you will be learning are all basic concepts that work pretty much the same in every programming language. You’ll learn how to use data structures and conditionals and loops to manage how your code flows. You’ll learn to structure your program in a way that’s readable and organized. Once you’ve done all that, learning a bit of syntax to pick up a new language won’t seem like much work at all.
Is HTML a programming language?
Not quite! HTML is a markup language, used to define the contents of a webpage. Although HTML has a specific syntax (a set of rules defining how you have to write things), it doesn’t have semantics, or meaning. An HTML document is rendered, rather than executed. That said, if you have written an HTML document, you at least have experience writing a formalized computer language, which may make the jump to programming easier.
WHAT’S AN IDE?
An IDE (short for integrated development environment] is the software suite programmers use to actually write programs. They generally include a specialized text editor for writing the source code, as well as the ability to test and debug your program. Two of the most popular IDEs are Eclipse (open source, free, and available at www.eclipse.org) and Microsoft Visual Studio (proprietary and expensive, but with a free “Express» version that’s limited to and excels at programming in C, C#, and BASIC].
How can I start writing a program, like, right now?
Unfortunately, it can be a bit of a hassle to get started coding in most programming languages. You generally have to install and configure an SDK (software developer kit], and sometimes an IDE as well, in order to be able to write and compile code in a new language. It’s rarely super hard, but be prepared to spend 15-30 minutes Googling, reading a guide for your chosen language, and setting things up.
How Does It Actually Work?
High-level languages allow you forgo a lot of the technical grunt work. For instance, in a high-level language, you can simply declare and use variables as you please, without ever worrying about what exactly is going on in your system’s memory. In assembly language, you have to manually assign data to locations in memory as you use it, and clear up the memory when you’re done.