There are probably five main styles of programming, which may overlap, and often relate to particular languages. We have imperative, declarative, object oriented, functional and logic programming styles. These are more commonly called programming paradigms than styles. The list below has each style with an iconic sibling language to implement it.
- imperative - C, or BASIC
- declarative - SQL
- object oriented - Smalltalk
- functional - Haskell
- logic - Prolog
Imperative programming begins with the 3 rules of coding: sequence (code executes left to right, top to bottom), selection (if, case) and iteration (loops), and may develop to structured programming. There's something very low level and intuitive about imperative programming but the best programming is rarely done in this style. With imperative programming, our code explains how a problem is solved - the solution can often be understood by tracing through the steps in the code. Imperative code often has a closer relationship to machine code than other styles.
With declarative programming, one declares a statement or code block to solve a problem. Declarative features are generally higher level. We see declarative features in SQL, many functional and logic programming languages.
Functional programming (FP) began in academia. Elements of LISP (Designed by John McCarthy, 1958) are functional, Robin Milner created ML in 1975. 1980s saw a commercial FP language: Miranda (David Turner). Haskell began in 1987, mostly as a copy of Miranda, ever refining itself, yet staying lean and clean. Modern functional programming stresses, functions as "first class" elements of the language, declarative programming, prefers immutable data. Other commercial FP languages are: OCaml, F#, Scala, Clojure, ...
Logic programming languages began in earnest in the early 1970s with Prolog. Coding styles are very declarative and applications often have an AI basis, data analysis or both.
I began this in response to a question : what programming language should one learn first? It's not really a sensible question. You should learn each of the programming language styles, and sub-styles. [e.g. sub-styles: structured programming as a sub-style of imperative programming, design patterns as a sub-style of object-oriented programming, They are not really sub-, but more like meta-, or supra-styles]. We can also recognize certain idioms that span all styles: DRY, SOLID, ... A lot of good coding practices seem orthogonal to implementing specific use cases. You could begin with imperative programming (first six books in list below), and apply the wisdom in the books to your code. Object-oriented languages dominate business, so read books 7 to 12, but only 12 is specific only to OO (in a sense). Finally, you need at least some functional programming and the last two are good starters.
Beginner programmer reading list.
TBH, A beginner can begin with any programming, or programming language book. Yet you won't really have graduated from beginner until you've read most of the 14 books below. Read and apply the lessons of all 14 and you're past beginner/junior programmer level.
- Code Complete: A Practical Handbook of Software Construction, 2nd Edition, by Steve McConnell
- The Art of Readable Code, by Dustin Boswell and Trevor Foucher
- Programming Pearls (2nd Edition), by by Jon Bentley
- 97 Things Every Programmer Should Know, by by Kevlin Henney
- Clean Code: A Handbook of Agile Software Craftsmanship, by Robert C. Martin
- Test Driven Development: By Example, by Kent Beck
- Agile Principles, Patterns, and Practices in C#, by Robert C. Martin and Micah Martin
- Refactoring: Improving the Design of Existing Code, by by Martin Fowler
- Working Effectively with Legacy Code, by by Michael Feathers
- Growing Object-Oriented Software, Guided by Tests, by Steve Freeman and Nat Pryce
- Agile Java: Crafting Code with Test-Driven Development, by Jeff Langr
- Object Design: Roles, Responsibilities, and Collaborations, by Rebecca Wirfs-Brock and Alan McKean
- Programming in Haskell, by Graham Hutton
- The Joy of Clojure, 2nd Edition, by Michael Fogus and Chris Houser