What is Computer Programming

Programming a computer to solve a problem always requires defining data to represent the things in your problem; this is called modeling. It also requires explaining unambiguously what process to follow in order to solve the problem. This process of explaining is where different paradigms of programming come in:
  • In imperative programming, we tell the computer what to do to the data. The computer starts out with its memory containing stuff, we tell it how to change that stuff, and it makes those changes.
  • In functional programming, we tell the computer how to build output data from input data. We use functions, which are rules that say how to combine or transform things; they consume inputs and produce outputs.
  • In logic programming, we specify a set of constraints -- rules that say how things are related -- and then ask a question; the computer runs a program that examines all those constraints and finds all valid answers to the question.
For decades, imperative programming was the dominant (or even the only) option, because at its heart, a digital computer is a bunch of switches and rules for how to switch them on and off. Functional and logic programming existed, more or less, only as language spoken by mathematicians. By now, though, programmers have written a vast menagerie of interpreters and compilers -- programs that run or translate other programs, respectively -- that allow us to communicate in whatever kind of language seems most suitable to the problem we're solving. We even have domain-specific languages that are fine-tuned for specific classes of problems: statistics, physical simulations, music, and typesetting are just a few that come to mind.

And why does all this matter? Because, again, the aim of programming is to explain solutions. Sure, computing the solution automatically is great -- after all, without that ability computers would be useless -- but good programs are meant for other people to read and understand, not just for them to use.

Programming is about :
  • Evaluation and substitution. These are the basic algebra skills that programs are built on, and that programmers mentally fall back on when trying to figure out why a program isn't behaving as expected.
  • Modeling. Information is complex; solving problems with the computer (or with math) always somehow involves defining and using data to represent information from the problem.
  • Managing complexity: Breaking problems and solutions down into chunks that can be understood easily. Abstraction (as Tikhon Jelvis mentioned) is the main tool for this.
  • Communication. In at least two ways, this is important: (1) Determining what your clients want, so you are solving the right problems. (2) Organizing and documenting your work so that you (or the next programmer to touch it) will be able to understand it, months or years later.
  • Patience and perseveration. When things aren't working right, there's usually something you haven't noticed. Learning what that something is often requires mentally retracing your steps, and manually re-running code on different inputs, until you see what you've been missing. This may take a while.
  • Discipline. Writing tests and specifying what work must be done are both decidedly unsexy tasks, but they both make your work easier and give you confidence that you've done your work correctly.

Amazing Facts about Programming

Amazing Facts about programming  The first programmer was a lady named Ada Lovelac . She was a writer and gifted mathematician...

Popular Tutorials