Basics
What is programming?
Programming is the process of writing instructions that somehow explain to a computer how to perform particular tasks.
What basic terms describe programs and programmers?
A computer program is a description of the instructions you want a computer to follow. A library is pre-packaged code that you can use in your own programs. The word software is used to refer to computer programs, while hardware refers to the physical devices that make up a computer. Programming is often also called coding and programmers called coders. Programming is just one part of software development, the process of creating computer software.
Why would I want to learn programming?
For us, one of the best parts of knowing how to write computer programs is that it's a lot of fun to create things! We assume that you are familiar with the many kinds of software that can run on a computer. Have you ever had an idea for an improvement to software you use every day, or had a completely new idea? Well, without programming ability, chances are that you will never be able to implement these ideas, be they for games, utilities, or anything else. Have you ever found a bug in OpenSource software and wanted to fix it yourself immediately? Learning to code will enable you to do this.
Even people who seldom or rarely write programs can find programming ability valuable. The mental processes that you develop in learning to program will prepare you very well for all aspects of math and science, as well as general logical thinking. A lot of us think that programming should be added to school curricula as early as possible, supplementing the other subjects used to hone "general thinking skills."
What are computer languages?
The natural electronic forms in which computers store information and instructions are not very natural for people to use. As a result, there are many kinds of human readable languages used when developing software. The name for a particular document in a computer language is source code.
Programming languages are our main focus here. They are used to define computer programs.
Scripting languages are a type of programming language that some people distinguish. We don't bother too much with classifying languages as scripting languages or not, since this isn't a very useful distinction.
Markup languages include HTML and XML. Instead of telling a computer how to perform a computation, they describe how something should look, what information should be associated with it, etc..
What tools do I need to start programing?
You'll need some of the following:
A Compiler is a program that transforms one language into another. Often, the final target language is the native language of your computer, allowing most anyone to run your program, as opposed to just people who have special tools for the language you used installed. An optimizing compiler uses internal translations on your code to try to make the output program run as efficiently as possible, in terms of speed, memory usage, and other factors.
An Interpreter is a program that runs your program in its current form without compiling it. If you run your programs in an interpreter, you will need to make sure that other people have that interpreter or another one for the same language if you want them to be able to run your programs.
A Debugger is a program that helps you find problems in your programs. They often act similarly to interpreters, letting you step through every thing your computer does in running your program and seeing what happens at each. If something unexpected happens at some step, you can gain a clue about what you have done wrong in your program.
An IntegratedDevelopmentEnvironment (IDE) is a program to help you with every stage of writing software. It will contain text editing tools to help you write code, simple ways to compile it, and tools for debugging it.
To begin developing software, Windows users will tend to need to buy or download any of the above tools that they want. Users of Linux and other Unix clones will generally have some of these tools for some languages installed, but will probably still end up downloading tools for new languages and upgrading their existing development software to newer versions. We have information on getting these tools for languages that we recommend you learn at LearnProgramming.
What is a "hacker"?
According to popular media, you might think that a hacker is somebody who breaks into computer systems through his expert technical knowledge, steals money, and plots to take over the world. However, the word "hacker" as used by people "in the know" actually refers to a programmer who simply likes to hack (program) code. The "right" term for people who break into computer systems and perform other illegal acts via computer is "cracker."
A cracker is also somebody who breaks protection off of games and applications illegally. These terms are all overused...
The etymological history of the word "hacker" has its origins at the famous Massachusetts Institute of Technology, or MIT. It was used to describe a student who spent his or her time pursuing recreational activities rather than striving to get straight A's. The person described in the latter part of the previous sentence was known around campus as a "tool." Computer programming was just one of the activities hackers spent their time pursuing.
Languages
What are the differences between the hundreds of programming language in wide use today?
A lot of people call programming language choice "subjective" and say that you should therefore just choose the language with which you feel the most "comfortable." There may be some validity to this idea, but there are certainly many objective factors to consider when choosing a programming language, including:
Availability and quality of development tools and libraries. A nice design without that great compiler or really useful library isn't very helpful.
Maintainability of code. The easier it is for other people to look at your code and understand how it works, the easier it will be to manage group development projects using a language, and the easier it will be for others to extend your OpenSource program. This also helps you keep track of your own code from day to day or after returning to it after a long absence.
Support for re-use of code. For big projects, every little language feature that makes it easier to re-use old code in unanticipated situations is a big win.
Run-time efficiency of programs. This is mostly based on the availability of compilers and interpreters for a language, though languages can be designed to make it easier to write good optimizing compilers for them. Some languages just don't have implementations that produce programs that run quickly enough, use small enough amounts of memory, or meet other efficiency criteria.
Safety. Languages like CLanguage allow you to write code suffering from such famous problems as BufferOverflows, while most languages today don't. There are many different gradations of the kinds of safety and security violations that language tools can prevent automatically.
Elegance. A lot of programmers, especially those in the FunctionalLanguages community, choose languages based on aesthetic judgments of the succinctness and clarity of the code a language allows you to write. Often similarity to well-known mathematical notations and ideas is a criterion.
In summary, most languages really will allow you to write any sort of program that you want. However, differences in the above qualities can dramatically influence how long it takes you to create working software meeting your standards in these languages.
What is the difference between "programming languages" and "scripting languages"?
There really isn't any sensible difference. You can write programs with scripting languages, so why deny that they're programming languages? When people call something a "scripting language," they generally mean that it's intended to be used for "small" tasks where execution speed doesn't matter, often running inside another program.
What is the difference between "interpreted languages" and "compiled languages"?
There really isn't one. A language would have to be designed very oddly for it to be impossible to compile or interpret it. Pick almost any programming language and you'll find both compilers and interpreters for it. There are languages that only have compiling or interpreting implementations at the moment, but this isn't an inherent property of these languages. Some languages are much more suited to one method or the other, though. This is what people will generally mean when they use these terms, though it's hard to give an exact definition of what falls into which category. See also the definitions of an interpreter vs. a compiler under the question, "What tools do I need to start programming?"
Is writing HTML code programming?
No, it isn't. Computer programs describe computations. They give step-by-step instructions on exactly how to do something, exactly describe a result by specifying some of its properties, or do something similar. HTML is a markup language; it describes how something should look, not how to make it look that way. Explaining in a water-proof way what the exact difference is can be tricky, but we think you'll understand if you know both HTML and a traditional programming language.
Are "object-oriented languages" and "functional languages" two separate categories?
Nope. People who say this seem to be confusing ObjectOrientedLanguages with ImperativeLanguages. See Objective Caml for a popular language that is both functional and object-oriented.
What is the relationship between JavaScript and Java?
In no way are JavaScript and Java related, except in their names, and even this relationship is tenuous: JavaScript was originally named LiveScript. It was created by Netscape to allow web pages to control Java applets but evolved into a tool for making tiny programs on websites like drop-down menus, pop-up windows, and other flashy things, while Java was created by Sun and is a general purpose programming language. Java is not limited to just the Internet, but small applets are seen on many websites. Java is also quite popular in designing applications for the PalmOS devices. It is said that JavaScript was just given a name similar to Java so that Netscape could gain popularity for the language. Java is a significantly more complex language than JavaScript.
Operating systems
What is an operating system?
An operating system (OS) is a collection of software that creates a good environment for running all sorts of other programs in a safe and cooperative way. Some people define an OS simply as "the software on your computer that you cannot avoid." You're running an OS now on your computer to be viewing this.
What kinds of interfaces do OS's have?
CommandLineInterfaces, which involve a text interface where you run commands by typing lines of text and see the results as text
GraphicalUserInterfaces, where you see graphical pictures, windows, and other things, often interacting with the mouse as well as the keyboard
What are some common operating systems?
Microsoft Windows, the most popular OS today for personal computers. It is created entirely by the Microsoft corporation, whose goal is to make money and not necessarily to give you the best software. You can't find the source code to Windows freely available, if you want to fix a problem that you find in it or just want to learn from it. Windows is mostly used through a GraphicalUserInterface, though there is an old style of CommandLineInterface associated with its predecessor, MS-DOS.
- That's not to say that Windows is without merit. You can run many Linux apps on it, either through Cygwin or with a native port. While older versions of Windows have reputations for instability, Windows XP is much more stable. If you only have experience with Windows and don't want to take the time to learn Linux, it probably doesn't make much sense to switch. After all, there are Windows ports of the most popular editors, compilers, and interpreters for pretty much every major language.
GNU/Linux, the most popular Free OS. All of the source code for GNU/Linux is entirely free for anyone, making this the most popular OS for FHP members and most others who write a lot of software. It's a very programmer-friendly OS. We recommend using it if you want to have the best tools for developing software available to you most easily. You can find both good CommandLineInterfaces and GraphicalUserInterfaces for GNU/Linux.
Unix is now a family of operating systems. The original Unix was created at Bell Laboratories, and Linux is based almost directly on it. Some other free Unix clones that are also excellent choices for programmers are FreeBSD, NetBSD, and OpenBSD.
Mac OS X is the latest version in the popular series of OS's for Macintosh computers. It is the first such version based strongly on Unix, making it a reasonable choice for software developers. However, it isn't free. Note that the core of it, Darwin, is free and open source. Mac OS X also comes with plenty of tools for developers including Applescript, the Objective-C Cocoa framework (based on the OpenStep specification), Java and Carbon.
Note: GNU/Linux is practically a subset of UNIX, which exceeds it in many places. The "definition" of UNIX hinges on POSIX compliance-- a guiding force in the development of the Linux kernel and the GNU Operating System. So saying GNU/Linux is NOT UNIX is correct, albeit only on a technicality. For all practical purposes, Linux, *BSD, Darwin, SunOS, etc.-- they're all the same type of operating system: UNIX.
Why would I want to choose an OS based on OpenSource?
What better way to learn programming than to have the source code to all of the sofware you use every day available to you? Choosing an OpenSource operating system like LinuxOs or another UnixOs gives you just this. There is a lot of OpenSource philosophy explaining why it encourages more people to make better software, but you can just take our word for it that OpenSource systems are much easier for programmers to support. It's not possible for vendors to hide the details of using their systems when the source code to them is available.
Independent of general reasons, you can just look at what software is available today. Most development tools available for closed OS's like WindowsOs are proprietary, while most for GnuLinuxOs are free. Maybe you like paying for software and dealing with bizarre licensing schemes for software you have paid for, but we sure don't.
Tools
What is a shell account?
Unix-like operating systems generally allow authorized users to connect to them and use their CommandLineInterfaces over the Internet. Machines that allow this are often called shell servers, and your user account on one of them is called a shell account. A well-maintained shell server can be a great place to do software development. The server's administrators can keep the development tools and environments up to date, freeing you from these concerns. Shell accounts probably won't work very well for developing graphical programs, though. A shell is a program that provides a CommandLineInterface on a Unix based or similar system. You can have several shell programs installed on one machine. A shell account gives you the ability to have remote access to a shell. We have a list of ShellProviders.
