How many types of programming languages are there?
Basically, I want to learn lots of programming languages to become a great programmer. I know only a handful to depth and I was hoping someone could elaborate on how many classes or types of programming languages there are. Like how you would lump them together if you had to learn them in groups.
Coming from a Java background, I'm familiar with static typing, but I know that in addition to dynamic typing there has to be such variety in available languages that I would love to see a categorical breakdown if possible.
Well I have learned that something like Prolog and C are fundamentally different, so I was thinking each of them corresponds to a different kind of programming language, and I was hoping to get a grasp of _how many_ kinds.
Learning about different types of programming languages _absolutely_ **is constructive**! You could potentially argue this should be closed as a duplicate of this but I think they're distinct enough questions to remain separate.
I feel this is a constructively subjective topic. It certainly meets guidelines 1,2,3,5, and 6. It may be debatable which languages fall under a paradigm, but the existence of certain paradigms isn't really in question, just what they are.
Here is a nice wiki list of programming languages divided into categories http://en.wikipedia.org/wiki/List_of_programming_languages_by_category
http://norvig.com/21-days.html tl;dr "Learn at least a half dozen programming languages. Include one language that supports class abstractions (like Java or C++), one that supports functional abstraction (like Lisp or ML), one that supports syntactic abstraction (like Lisp), one that supports declarative specifications (like Prolog or C++ templates), one that supports coroutines (like Icon or Scheme), and one that supports parallelism (like Sisal)."
@Sova, I'd recommend making your first choice of new languages to try out something that doesn't use c-based syntax. That will get your head focused more on how it works vs. how it's different from the one you know best.
"Your questions should be reasonably scoped. If you can imagine an entire book that answers your question, you’re asking too much." ([help/dont-ask])
It got deleted for some stupid reason. The answer to 404s is Wayback Machine: https://web.archive.org/web/20130516060131/http://programmers.stackexchange.com/questions/10756/whats-a-good-resource-for-learning-about-all-the-different-programming-paradigm
Just reporting in years later: Clojure is amazing. Learn something lisp-like, or even just read McCarthy's paper on LISP (from the 60s I think) and you will understand that lisp is the alpha-language from which all other possible languages descend. Very good to learn functional programming, check out Rich Hickey's videos on infoq. Unlock the potential
It depends on how you want to classify languages. Fundamentally, languages can be broken down into two types: imperative languages in which you instruct the computer how to do a task, and declarative languages in which you tell the computer what to do. Declarative languages can further be broken down into functional languages, in which a program is constructed by composing functions, and logic programming languages, in which a program is constructed through a set of logical connections. Imperative languages read more like a list of steps for solving a problem, kind of like a recipe. Imperative languages include C, C++, and Java; functional languages include Haskell; logic programming languages include Prolog.
Imperative languages are sometimes broken into two subgroups: procedural languages like C, and object-oriented languages. Object-oriented languages are a bit orthogonal to the groupings, though, as there are object-oriented functional languages (OCaml and Scala being examples).
You can also group languages by their typing discipline: weak typing, which supports implicit type conversions, and strong typing, which prohibits implicit type conversions. The lines between the two are a bit blurry: according to some definitions, C is a weakly-typed languages, while others consider it to be strongly-typed. Typing discipline isn't really a useful way to group languages, anyway.
Was going to pose something similar, but will +1 and add comments instead. Each category or combination also has numerous spin-offs created by focusing on particular elements. OOP, for example, begets: Prototype-based OOP, Aspect-Oriented Programming, Component-Based Programming, and so on. Functional paradigms also have spin-offs, such as languages where an asynchronous process or thread is the base unit and you program by composing parallel processes together.
How would scripting languages,e.g. VBScript, fit into this? It can be a bit procedural and a bit OO as one can create various types, so would that make it a hybrid?
@CodexArcanum could you give me an example of a language where you program by composing parallel processes together? This sounds fascinating.
@JB King OOP languages usually are procedural, at least within the method bodies. Also, it's a common misconception that OOP means "objects". Lots of languages have data types and objects. There's a lot of debate on what the exact definition of OOP is, but it usually includes inheritance and/or encapsulation (private state) as major themes. A language without either in some form would be difficult to classify as an OOP language.
@sova I can only think of two languages that work kind of like that. Erlang is based heavily on parallel processing, but if you want more like what I was talking about exactly, you should look into Polyphonic C#. It's a research language (now folded into C-omega) based on Pi-Calculus (like how FP is based on lambda calc) Pi-calc is based around the unit of a process, and you declare processes and a combination of synchronous and asych calls into them. Also look into Arrows in FP, especially Haskell. Arrows are very much like that.
@CodexArcanum: I think a weak case can be made for Go as also being a programming language where you (can) compose multiple interacting processes (well, goroutines), with explicit support for that in the language definition.
@Vatine Sure, Go even includes explicit support for the same operations that I described as part of Polyphonic C# through the use of Channels and the arrow operator. Something like Channels is also a part of the next iteration of C# (4.5 I think?) It's great to see these concepts getting out of research languages and into real world use.
Hmm... are people misusing 'declarative' when they describe HTML and CSS as declarative languages?
@ErikReppen: No, they're still declarative. They're not *programming* languages, though.
It's interesting that the declarative wiki seems to say anything that isn't procedural is declarative.
I definitely get the sense when people use the term for HTML and CSS it's meant to point out that they aren't programming languages. Not that it means they're right to. 99% of he English-speaking planet doesn't know what decimate and sarcasm mean either but those get misused all the time.