Programming guide
This page includes a preliminary version of a guide on learning programming. See also our programming learning resources, programming learning benefits, and learn programming pages.
#1: Programming for non-programmers
There are some skills that don't really constitute programming, but:
- require some familiarity with programming-style thinking,
- help make one more computer-savvy, and
- make it a little easier to start learning programming (the differential isn't huge)
Examples are:
- Markup or text formatting languages such as LaTeX, HTML, Markdown, Mediawiki syntax
- Shell commands (such as the Bash shell)
- Computational software (such as Mathematica, Matlab, R (command prompt)). To a lesser extent, this also applies to spreadsheet software such as Excel.
In each of these cases, either the same language supports full-fledged programming, or there are languages built on it that support full-fledged programming. For instance, LaTeX can be used to write complicated functions to control formatting and layout, though the typical use case of LaTeX does not involve programming. Similarly, HTML isn't a programming language, but a bunch of tools built atop it, such as CSS, PHP, Ruby on Rails, and Javascript, support a varied range of programming capabilities. Matlab and R can be used as interactive interfaces where you type in one command at a time, but we can also write full-fledged programs in these languages.
Using this as a route to learning programming
Of the people who eventually learn programming, a nontrivial fraction start off with learning one or more of the above and only then transition to a proper programming language. Even so, most of those who transition to a proper programming language do so somewhat independently of their experience with these. But it is possible, if rare, to piggyback on one's experience with markup, shell, and computational languages to learn programming. Here are some examples:
- A person designs his own webpage in HTML. Later, he wants to add more interactivity to the webpage. He adds some Javascript. He wants to make the style uniform across pages. He introduces CSS. He then wants to include some context-dependent displays into the page, so he switches from HTML to PHP to use more general-purpose programming constructs.
- A person uses the shell command "grep" to find relevant snippets of text within large files. Then, he decides that he doesn't just want to find the snippets, he wants to store them in a separate file. The command line syntax for the grep command gets more complicated. So he realizes that it's better to write a shell script for the job. But then he hears of Perl, and decides to switch to writing a Perl program instead of a shell script.
- A person is using a computational software to carry out relevant computations. Then, she notices that she is often doing calculations that share some common aspect. She wonders if there's a faster way of doing it than typing out long commands to do the calculations. She learns that she can define a function that can capture the sequence of operations she wants to do. Thus, she's introduced to the idea of functions. Perhaps her needs become more complicated, and she needs to introduce if-then logic into her functions.
The main advantage is that it allows a more gradual ramp-up in the abstraction level. It does not require the person to rapidly absorb a multitude of ideas related to algorithms and various program control and flow structures. The ramp-up is organic.
The main disadvantage is that this can be a slow process. Moreover, unless the person has the right set of needs, he or she may never get to the point where it's necessary to transition to full-fledged programming.