Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

The Top 10 programming languages, according to the TIOBE index seem to be heavily influenced by C:

1. Java

The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. - wikipedia.org

2. C

C is one of the most widely used programming languages of all time and there are very few computer architectures for which a C compiler does not exist. - wikipedia.org

3. C#

During the development of the .NET Framework, the class libraries were originally written using a managed code compiler system called Simple Managed C (SMC). In January 1999, Anders Hejlsberg formed a team to build a new language at the time called Cool, which stood for "C-like Object Oriented Language". - wikipedia.org

4. C++

It was developed by Bjarne Stroustrup starting in 1979 at Bell Labs as an enhancement to the C language. - wikipedia.org

5. Objective-C

Objective-C is a reflective, object-oriented programming language that adds Smalltalk-style messaging to the C programming language. - wikipedia.org

6. PHP

He rewrote these scripts as C programming language Common Gateway Interface (CGI) binaries, extending them to add the ability to work with Web forms and to communicate with databases and called this implementation "Personal Home Page/Forms Interpreter" or PHP/FI. - wikipedia.org

8. Python

Python was conceived in the late 1980s and its implementation was started in December 1989 by Guido van Rossum at CWI in the Netherlands as a successor to the ABC programming language (itself inspired by SETL) capable of exception handling and interfacing with the Amoeba operating system. - wikipedia.org

ABC (programming language) Its designers claim that ABC programs are typically around a quarter the size of the equivalent Pascal or C programs, and more readable. - wikipedia.org

9. Perl

Perl borrows features from other programming languages including C, shell scripting (sh), AWK, and sed. - wikipedia.org

10. JavaScript

JavaScript uses syntax influenced by that of C. - wikipedia.org

It appears that most of them borrow their syntax from C and / or are heavily influenced in several other ways, at least in their beginnings. Why?

share|improve this question

closed as not constructive by gnat, Michael K, Walter, Jarrod Roberson, Jon Purdy Feb 17 '12 at 17:58

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

13  
Having c like syntax is not the same as being based on c. –  Oded Feb 17 '12 at 10:16
12  
In addition, TIOBE is a junk index. –  DeadMG Feb 17 '12 at 10:22
3  
Rather, can I ask why programming languages based on C are more popular? –  Manoj R Feb 17 '12 at 10:33
3  
@YannisRizos Great salvage of the question! It is actually a great question now. –  maple_shaft Feb 17 '12 at 12:36
15  
Because C is a descendant of ALGOL, and ALGOL is to block-scoped imperative labguages what Abraham is for Christians, Jews and Muslims. –  Ingo Feb 17 '12 at 13:08
show 14 more comments

5 Answers

up vote 35 down vote accepted

With the rise of UNIX in the 1970's, its standard systems programming language C quickly became the lingua franca of the programming world. For quite a while, C was practically mandatory for every programmer. As such, the fact that C has influenced almost every programming language that came after it in one way or another is hardly surprising, for two reasons:

  • When designing a new language, it makes sense to base its syntax, where possible, on a popular existing language that can be assumed common knowledge.
  • A new language is more likely to succeed if the learning curve is shallow, and a syntax that resembles an already known language is generally easier to learn (unless it behaves radically different despite the apparent similarities). So languages that borrow syntax from C generally gain traction more quickly than ones that don't.

But other languages existed, and they still do, some of them even predating C - there's the LISP family (CL, Clojure and Scheme being the most popular modern dialects), the ML family (with several modern dialects), there's a whole army of BASIC dialects (VB.NET and VBA are modern implementations), there's Pascal and its relatives (Delphi being the best known one) and many 'oddball' languages that took influences from many other languages and invented a few things themselves; examples include Go, Python, Lua, Haskell (and its predecessor, Miranda), Prolog, and Erlang. While none of these languages (except Python) is in your top 10, many of them have a stable user base and an active community; they're certainly not going away.

Also, it should be noted that the amount of C influence in these languages differs wildly, ranging from the almost 100% C compatible languages C++ and Objective-C, up to Python (which deliberately abandons many of C's syntax features). And that's only the syntax: in terms of semantics, most of the languages on that list don't have much in common with C. The overwhelming majority has memory management built into the language, and consequently, copy semantics, argument passing, etc., are very different. JavaScript, for example, has strong semantic influences from Scheme, while its syntax was designed to resemble Java (which, in turn bases its bits-and-pieces syntax on C, but not its semantics). Other differences (with the exception of C++ and Objective-C, which are mostly backwards-compatible with C) include error handling, scope rules, standard libraries, external code inclusion (#include), and the fact that many of these languages are 'virtualized', that is, they run on an interpreter, JIT compiler, or a virtual machine.

Python, by the way, does have some C influence, but it is certainly not "based on" C. Both syntax and semantics differ quite radically from C, and this is by design. Python only borrows features from C where other alternatives are equally "good" (as per the "Zen of Python" - type import this in a python interpreter).

As for the future of programming; predictions vary. The influence of C is not going away, but recent developments in hardware (multi-core machines becoming commonplace, powerful GPU's, the CPU ceasing to be the typical performance bottleneck, fast reliable network connections, etc.) call for radically different approaches to programming in general. Anyone who has ever written a multithreaded distributed application in an imperative language can tell that it's incredibly hard, while languages like Haskell have features that remove most of the typical problems and offer a more abstract and more structured approach to distributed, concurrent, and parallel processing (purity being an important concept in this context). Newer programming languages (e.g. C# or D) already include many features to support such an idiom. In any case, neither the strong impact C has made on programming, nor the existence of non-C-like languages is going away.

share|improve this answer
    
Nice answer, but "CPU ceasing to be the typical performance bottleneck"? In my experience, performance problems abound - CPU, IO, you name it. If not, profilers would not be needed, even though they are not very effective. –  Mike Dunlavey Feb 17 '12 at 13:42
3  
@MikeDunlavey: Usually, the bottlenecks I encounter are caused by I/O, networking, CPU cache performance, bus throughput, and (inefficient) interprocess communication. Back in the days, the CPU was almost inevitably the bottleneck; this just isn't true anymore. –  tdammers Feb 17 '12 at 16:05
add comment

This is a lot like asking why English is the dominant language in the US. Why not Spanish or French? They controlled more of the US territory than the English colonies. Why not Dutch? The first US capital was in a former Dutch colony. I'm not sure there can possibly be an "answer" to this.

However, the "Computer Languages History" timeline (http://www.levenez.com/lang/) provides all the answer there can possibly be.

share|improve this answer
3  
Because Great Britain from the 1600-1880 roughly was the prime industrial and financial powerhouse of the world, followed by the United States from 1880-Present(<--debatable). It became the language of international business and is spoken fluently by well over 2 billion people worldwide. That and nobody wants to speak Spanish or Dutch :) –  maple_shaft Feb 17 '12 at 12:43
3  
@maple_shaft - "nobody wants to speak Spanish"?! ... do you even know in how many countries it is spoken? en.wikipedia.org/wiki/Spanish_language –  ldigas Feb 17 '12 at 13:17
9  
@S.Lott: You mean the part where the British Empire was the biggest empire to ever exist, and occupied 25% of the entire world's surface? That kind of "not powerful"? –  DeadMG Feb 17 '12 at 13:18
2  
@DeadMG: I'm not talking about the world. I'm talking about the US in the 1700's where the French had the British hemmed into a small area along the coast. I'm talking about the British losing military engagements in this theater only. The French clearly controlled most of what became he US. Yet. The US wound up speaking English. Not French. The same analysis applies to C. It's a complex history with lots of influencing factors. There's no trivial, pat answer. –  S.Lott Feb 17 '12 at 13:21
2  
@S.Lott The French didn't win every single encounter. Just looking at North America they won a majority; but losing 4 of the 5 major battles in NA during 1559/60 resulted in a crushing defeat in the theater. The captures of Forts Ticonderoga and Niagara, The Plains of Abraham, and the battle of Restigouche were all British victories. By cutting off supply/reinforcement the latter made the French victory at Sainte-Foy irrelevant. –  Dan Neely Feb 17 '12 at 13:51
show 11 more comments

If you make a new programming language, having a syntax similar with popular existing languages makes learning easier for your new users. Especially if many concepts are similar between languages.

Also I think that C-style syntax is relatively easy to read. To compare with Pascal, using symbols "{" and "}" for blocks of code is more legible than "begin" and "end", which are optically very similar to identifiers. Python is even more legible, but including whitespace in syntax opens a new set of problems with editing. Another example: Lisp and JavaScript share a few ideas, but when the same thing is written in C-style syntax, it is less obscure.

I am sure many people would disagree with the second paragraph, because everyone has their own favourite language, but I think that the popularity of C-style syntax is partially a historical coincidence, but partially it also shows that authors of C made a few good decisions.

share|improve this answer
add comment

Programming languages evolve over time just like natural languages, with some older languages influencing that evolution in a stronger way than others, while others fade into obscurity and their influence is harder to trace on the surface level, that is, syntax.

C's influence comes from many sources - it's low level, widespread, had backing in both Unix and Microsoft circles. It's also survival of the fittest issue - it's easy to see terse C-like syntax had more appeal than the verbose Algol-derived syntax of Pascal and other competitors of C in the 1970s and 1980s. Hence it was widely adopted by languages that came after it.

With present growth of importance of multithreaded programming and functional languages being particularly well-suited to it, I'd say we'll see their influence grow in the future. Case in point: Python, which even made that list in the question post.

A nice timeline view of language history to ponder upon

share|improve this answer
    
You got it wrong. Both PASCAL and C are ALGOL descendants. –  Ingo Feb 17 '12 at 13:05
    
True, but Algol itself is Fortran descendant and picked some of the constructs I was referring to there (program, end, subroutine compared to c's brackets). Still, what I had in mind was in fact Algol-like syntax. Edited. –  scrwtp Feb 17 '12 at 15:49
    
terse C-like syntax had more appeal then verbose Algol-derived syntax of Pascal and other competitors of C in the 70's and 80's +1 for that. begin programmers are humans too end begin those who believed that it's convenient to map punctuation signs to words like begin-end lost their battle to curly braces end of story –  gnat Feb 17 '12 at 17:33
    
I see no evidence that C syntax is less obscure, except in the sense that most developers know C or some sort of C-related language, and so it looks more familiar. AFAICT, C won over Pascal because of its structure, and the fact that implementations didn't have to roll their own linking, not syntax. –  David Thornley Feb 17 '12 at 17:55
    
@David-From what I remember, one of the reasons C won out over other languages was because of the relative ease of accessing memory in C (ie. pointers). I know they are fround upon now, but back when 1 KB of RAM was a lot of memory, that was a very powerful feature of the language. I know other languages provided pointer like features, but none as easily as C. –  Dunk Feb 17 '12 at 21:56
add comment

Most of the languages you list have virtually nothing to do with C apart from irrelevant syntactic similarities. The only two actual C derivatives are Objective-C and C++.

share|improve this answer
    
If we are not considering syntax, then the only differences between any languages are the availability of general language constructs (loops, conditionals, variables, abstractions of these like classes and closures, etc...) and that they all equate to behavior of machine code. All low level languages are similar to each other and all high-level languages are extremely similar to each other at that point. –  maple_shaft Feb 17 '12 at 13:51
1  
You shouldn't think about a language as what functionality it has, but how it communicates application behavior. Your source code is your lowest level of documentation and one writes source code for people and NOT for machines. If we wrote code strictly for machines then we would all be coding in assembly. –  maple_shaft Feb 17 '12 at 13:54
1  
@maple_shaft: Quite right! I was asked in an interview to explain the difference between machine language (assembler) and programming language. My answer was: "Machine language is for machines, programming language is for programmers." –  Treb Feb 17 '12 at 14:48
1  
@maple_shaft: The syntax is irrelevant as to it's communication to people. If I replaced an English word with a different spelling, English would still be the same language. The syntactic form is irrelevant, what's communicative is the language semantics. –  DeadMG Feb 17 '12 at 15:31
2  
@DeadMG: But the question is about syntax. You can consider the syntactic similarities to be irrelevant, but the person asking the question wants to know why these irrelevant similarities exist. –  Nicol Bolas Feb 17 '12 at 16:26
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.