It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

22

The term 'best' is subjective, so you'd never have a univerally accepted best. There are, of course, quite a few languages that are suitable for broad ranges of development across all platforms. C++ and Java being the main two.
–
GrandmasterBSep 17 '10 at 19:19

we as a species have an innate ability to disagree (by virtue of our individuality), therefore we will never agree on what is universally required, and hence there will never be one (at least not one created by humans!)
–
NimMar 24 '11 at 17:04

23 Answers
23

The Swiss Army knife generally has a blade, as well as various tools, such as screwdrivers and can openers and many others. These attachments are stowed inside the handle of the knife through a pivot point mechanism...

The design of the knife and its flexibility have both led to worldwide recognition...

What you have in programming is a very large problem domain. This domain ranges extremely and in many directions.

This is why embedded flight controllers are written in C and websites are written in PHP, Java, Rails, .NET and a host of others.

For the embedded flight controller I have about 128k of memory to work with and on top of that if my code gets an unhandled exception the plane crashes, 200 people die and I get sued to tune of $1B, and have to send engineers to every airport in the world to fix aircraft that are grounded loosing my customers $10M / day. I have to work with a language that is very tight and has a small number of moving parts that could go wrong.

For my web application I have several GB of memory to work with, but network speed is limited (to a lesser degree everyday, but this is probably the web greatest limit). I will be looking at a language that gives me a ton of features and produces output that can be transmitted as fast as possible. I don't really care if my site goes down, I will maybe lose a few sales ($100) and have to patch the use case that bombed, no big deal.

Web sites haven't been written in C for over 15years (anybody do any cgi scripts?) and as far as I know flight controllers are just now beginning to look at C++, but even then in a very restricted way.

Most sites that actually make money will lose more than $100 if they experience significant downtime. Not to suggest that it's comparable to a life-or-death situation, but still, this is downplaying the risk more than a little bit.
–
AaronaughtAug 30 '12 at 0:40

1

Do you have any idea how flakey Facebook is. They recently posted they push code every 37 minutes. Their site is constantly borked in some way or another and they have a million tickets in their backlog. The point is with the web nobody is going to die, you "might" loose a few sales, but all in all not really much risk. Most of the issues you face are only going to affect a few customers not the whole base
–
Bill LeeperAug 30 '12 at 2:23

If you see more than one tool, think about how that applies to your question.

If you have no toolbox, or only have one of those little hammers with the screwdriver bits in the hollow handle, then I have great sympathy for you.

Seriously. If you go to an auto shop, does your mechanic have only one single do-it-all tool in his toolchest? He (or she) is a professional, with professional-grade tools specifically designed to perform various automobile repair tasks.

Similarly, professional software developers should possess a sufficient set of tools to perform his/her trade. If you open your toolbox and see only [the software equivalent of ] a Philips screwdriver, then you cannot consider yourself a professional.

You can turn a bolt with an open-end wrench, a box-end wrench, a ratchet wrench, or an adjustable wrench. You can even turn a bolt in a pinch with slip-joint pliers, clumsily, with minor to severe damage. But it is quite difficult to turn a bolt with a sledge hammer.

A different kind of answer to the others - I actually think there is potential for a language to become a "universal" one, allowing the features and paradigms of many other languages, though not perhaps a strictly designed language you might be thinking of.

To use brettmjohnson's analogy above, the idea that each programming language is the tool inside a box (or on a swiss army knife) is the assumption everyone is making, but is really a flawed assumption.

What if the programming language was the toolbox?

I mean, what if you can add and remove features from the language as you please, and have your own toolbox with the tools you need in it - even if the tools are for different purposes.

The concept exists partially already. For example, languages like Nemerle allow you to add syntax to the language, and as such, you might be able to take "the best feature from language X", and add it to Nemerle (or your own). This doesn't necessarily mean writing your own macros all the time either - each language (or paradigm) could be defined inside a macro in a standard library - such that a you could import Haskell; import Prolog;, and begin writing the two languages as if it were part of your language?

The question then is - how do you get the features of different languages/paradigms to work with each other? While I can't answer that, frameworks like .Net and JVM offer some of the solution - the languages are at least partially compatible because of the way they're compiled. You can take any code written in C# for example, and use it from F# without complaints.

The 'problem' with the solution as it is today, is that using these languages together requires you to create them as separate projects, which cannot reference each other - you can only have a 1 way reference. The language barrier is that each project compiles all it's files separately to Common Intermediate Language before any other project can access it.

A stepping stone towards removing that barrier would be to allow code of different languages (eg, C# and F#) to compile inside the same project. In theory you could compile each file separately (or in groups - if they have partial types or circular references), and then compile files of a different language which can access those already compiled (CIL) objects. You would need to strictly define the order of compilation for this to work though - but order of compilation is already required in the case of F#.

Anyway, I'm not saying "there can definitely be a universal language". I'm suggesting that there's the potential for much better interoperability between languages that what currently exists. In reality, it's not likely to improve greatly very soon, just because of the huge amount of work it is to implement a language and the libraries, the tools etc. needed to use it.

All the world is not a PC. The majority of processors on this planet have less than 64K bytes of total memory space. A language that can be used on these processors has to be so far reduced from those that most on this forum seem to use that your universal language will end up as an enhanced assembly language. I think that would be called "C".
–
ʎəʞo uɐןMar 13 '12 at 11:05

and if you were to try and combine a bunch of languages' features into one language which could do anything, you'd get a lot of redundancy, confusion, bugs from all the different ways to use different combinations of features, and a lot of wasted effort specifying which paradigm you're using on this line.
–
fennecSep 17 '10 at 19:22

Languages shape the way people think. This is true for natural languages. If a child knows only one language with the numbers "one, two, many", teaching that child math is... difficult. (Sorry, I don't have the link)
In english we talk about different times as if they were places - hence the concept of time travel is possible to imagine. In some other languages, the idea of time travel would never occur to its speakers.

This is also true for programming languages.

Hence if we have a single programming language, everybody will think about all computational tasks exactly the same. Thus we won't be exploring alternatives, and the best way to do something will remain undiscovered.

The closest thing we have to a universal language is C. C maps very closely to the underlying hardware concepts (how things actually get done in hardware) and programs in every* language is convertible to C. (See how CFront used C compilers for assembler tasks) The problem with C is basically that the above-mentioned conversions wouldn't make sense from a C programmers perspective.

"Lambdas" were always possible in C. The syntax is off, including code spread around the whole project/file, hence it was not a preferred solution. With a no-capture/upvalue/etc version, define a function somewhere else, and pass a pointer to the function. (see qsort()) To use lambdas with captured values, the quantity and complexity of the code you have to write rises a lot - as far as I'm aware noone ever actually wrote the code to use this method of programming in C. As opposed to languages where lambdas are part of the language, and basically used everywhere.

The main difference between C and C++ is how you can ask C++ to take care of stuff for you; but then you can no longer see, from only a single line of code, how much you're really asking of it. The answer becomes: it depends (on all this other code).

Some programming languages are excellent for specific tasks, but where most current programs in use around the world would simply not make sense if programmed in that language. That is, if the language could be used to implement that program to begin with, which is not a given.

"In some other languages, the idea of time travel would never occur to its speakers." Citation needed. The Sapir–Whorf hypothesis is not by any means widely accepted specially in its strong form.
–
Muhammad AlkarouriAug 21 '12 at 13:43

The impossibility on technical merits of having a Universal Language? That's total nonsense. You could have a universal language that covers all bases. The problem is mostly historical: different languages were invented to do different things and be used in different communities. Many of them stuck. Add to that preferences (vi! emacs! wait, I meant Java! C#, wait I meant Microsoft, Open Source, etc. etc. etc.) and general embedding of historical accidents... Look at the natural languages in a tiny land mass like some European countries to see just how crazy this topic can become. Some towns have their own pride and joy, a little dialect that only they speak. Nations and programming communities are not that different, nor are programming communities more rational. If they were, we would all speak esperanto and program in Universal somethin' somethin'...

The problem is deeper than that. The more options you make available, the more has to be specified explicitly instead of being the one implicit way things work in that language. The problems get more obvious if, instead of comparing Java with C#, you compare Java with Prolog. To have the features of both in one language would complicate the syntax of the compound language. A more reasonable choice may be to reduce syntax to a minimum, and allow any feature to be implemented as a metaprogramming library. That's basically what Lisp does, though it's core isn't low level enough for some jobs.
–
Steve314Apr 22 '11 at 2:17

It is a mistake to think that "combining all features" will make a better language.

You are more likely to end up with a bloated, complex, unreadable mess.

Good language design requires choice and trade-offs to be made. Arguably the best / most revolutionary / most successful languages are the ones that take something out and provide a better alternative rather than add new things in. e.g.

Because if you create such a language, it will be yet another new language. You might get a large fan base, but all the other languages will still exist.

C still exists even though many new languages were invented since.

You could say that python is such a universal language, but then there's also ruby.

The reason there are many language is simply because there are many programmers and some of them like to create new languages.

The reason there's no single universal language that everyone agrees on is that programming as a craft is not dictated by some institution that makes all the decision. Everyone is free to do what they want.

Aside from the swiss-army-knife argument (which has a point -- it is more difficult to design a good wide-spectrum language than a domain-specific one -- but that doesn't mean such a language wouldn't be both possible and a good idea), there are problems with "combining the best features":

For language features, "best" is subjective, or at least (interminably) arguable.

Some features aren't compatible; a good feature from one language may blow up when combined with a good feature from another.

We're not done coming up with new features yet.

In short, language design is harder and more complicated than that. Although, you may want to take a look at Scala.

With all that is written so far, it is hard to add much new rationale, but I will throw in a few.

Evolution : It is not just biological systems that are introduced, mutate and undergo a survival-of-the-fittest competition for resources and a niche to call their own. The competition is good and pushes things forward.

Maturity : We have been making computer languages for probably less than a century. We can't have the answer yet because we don't even know all the questions yet.

Separate genesis : Not sure the right word for this, but in the world their are many writing systems that started in many geographic regions. Think about Cuneiform that was dictated in part by the demands of carving into clay tablets. Think about Sanskrit, the Greek, Hebrew, Roman, Arabic alphabets. Hieroglyphics, the Chinese method of beautiful writing with 6000+ symbols that is shared in many east Asian countries. Think of more modern mixed alphabets with phonetic basis like Cyrillic, Katakana, and Hirigana. I am not a linguist so don't flame the inaccuracies too harshly, but when cultures worldwide need something, they will create it and make it their own out of necessity. Computer languages came along when there was a lot of worldwide communication and like the Imperial and Metric systems, came from places with powerful idea leadership. But programming languages serve many different cultures (some of them corporate cultures), so they reflect the people who made them. Computer languages come with cultural legacies that shaped their design and use. In the OS kernel culture, C and C++ are unlikely to be soon deprecated for Java (or the other way around) because they permit native code generation, close / efficient coupling with hardware for creating hardware abstraction layers, and have a sizable installed based.

Design of Design : Programming languages come about using different organizational paradigms. COBOL and Ada were from committees that were part of DOD which had a lot of hierarchy. If I recall correctly C, C++, Java, and probably many others came from one or a small number of designers. Fred Brooks compares the results of the committee vs. the visionary based approaches in his paper, the Design of Design (http://www.youtube.com/watch?v=pC-DlX-PaF4). If we sat down today to either select a Da Vinci or a committee to define the universal programming language, would we know who or what by what method it should be architected?

There is a universal programming language. It's called "machine language" and everything in any other computer language is ultimately executed as machine language.

What does it look like? A string of 0-9 and A-F.

But it's a bitch to use. So Alan invents a language that can be translated into machine language and is more appropriate to what Alan wants to do. Bill invents a different language for what Bill wants to do. Before long you've got Cobol and Fortran and Lisp and Java. All of them are just simplified vesions of machine language, easier to write certain kinds of programs but harder, or impossible, to write other types of programs. One is good for accounting, another is good for controlling the space shuttle.

I think all the "because you don't carve statues with a pencil" answers are missing the point.

Who here, TRULY selects a language before every new project?

The truth is, we only need a few programming languages, and the programming world would be better off that way: people would focus on making the scripting language better instead of being scattered across python/ruby/perl/younameit for example.

C# is programmed on/for windows (alright, there's Mono, anybody here runs a C# under Mono app every day?) and that makes users buy Windows7/8, and that makes money for Microsoft.
Other companies do the same, then open source knows better, then mister genius too... and we got lots of look-alike languages, it's just humanity's self-centered nature.

We must look to economics to answer this question. If it saved business money to have just one language, we would have it. They would standardize on it and require everyone to use it. The other languages would languish in dusty academic buildings and the basements of wild-eyed enthusiasts. This has not happened, so their must be no profit incentive in a universal programming language or one would have naturally evolved by now.