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.

I have often seen people fighting over that their favorite language is more "powerful" than others. When it comes to describing a programming language, I can understand what an object oriented language is or what a dynamic language is, but I still can't figure out what exactly a "powerful" language is. What are your thoughts?

share|improve this question
4  
A language is as powerful as its user. –  ysolik Oct 6 '10 at 21:03
4  
@ysolik not necessarily true. i could give someone a crappy language and see how far they get. it has one op, NOOP! =) –  Mark Canlas Oct 6 '10 at 21:04
2  
@Mark if we're talking extremes, then you're right. However, if you consider today's more or less widely used languages, then the user is a big part of it. –  ysolik Oct 6 '10 at 21:08
1  
PowerBASIC: Can't get any more powerful than that. ^^ –  gablin Oct 6 '10 at 21:57
1  
@ysolik: it'd be more accurate to say "a language can be no more powerful than its user." –  Duncan Bayne Mar 29 '11 at 0:38

13 Answers 13

I maybe biased because I'm a system programmer. I would think a programming language used for all of kernel, system, server and application programming, or support multiple programming paradigms, or both can be called "powerful".

C, C++, D are powerful, but obviously this is just my humble opinion.

share|improve this answer
    
You would use Java for kernel level programming or am I misunderstanding you? –  Davy8 Oct 7 '10 at 13:06
    
@Davy8, you are right, by my own definition, I shouldn't have included Java. –  grokus Oct 7 '10 at 13:34

The right balance of brevity and flexibility.

Great question. Given that many languages are "Turing complete", we can put them all on equal grounds with regards to what they're theoretically capable of. But we don't do that because languages obviously differ from one another. And what is the difference?

The difference is the ability to say a lot of different things with very little. If we could jump right to the extremes, I could make a language that is the best language for automatically initializing a content management system using just one character, 'c'. But what would the point of that be? Sure, it's powerful in a sense of being very brief, but it's not flexible. What you want is a language that allows you to say many different complex things without being too verbose. Without being like assembly, capable of everything under the sun, infinitely flexible but extremely verbose.

A powerful language is a language that allows you to say many different things with the least amount of length possible.

share|improve this answer
    
-1. I'm sorry, but that's not only a misconception, but a dangerous one, since it can severely hamper productivity further down the line. –  Mason Wheeler Oct 6 '10 at 21:27
    
@Mason Wheeler: Could you elaborate? –  Joey Adams Oct 6 '10 at 23:17
    
@Joey: See my response to this question. –  Mason Wheeler Oct 6 '10 at 23:17

Once you hit Turing complete (and it's easy for a language to do this), "power" doesn't mean much, in the sense that anything you can say in one Turing complete language you can say in another. Mark Canlas' answer nails it: brevity and flexibility makes the difference.

Having said that, Matthias Felleisen's paper On the Expressive Power of Programming Languages makes for interesting reading. In it he attempts to formalise the notion of expressiveness in languages.

share|improve this answer
    
By the way, this isn't actually true. I have seen languages that are Turing complete but less powerful than other languages. A simple example: consider a language that only has integers and strings as its data types, no way to convert between them, arbitrary computation on integers, and only string concatenation and comparison on strings. (I have worked with such a language.) It is Turing complete, but it cannot express arbitrary functions on strings, so adding more functionality will increase its computational power. –  reinierpost Mar 28 '11 at 16:58
    
@reinerpost - said Turing-complete language can still compute arbitrary functions on strings, it just has to represent them in a different way. Turing completeness is pretty much orthogonal to the question of what data types you have available. For example, some turing complete languages have no data types and just represent everything with functions - and have to resort to things like Church Encoding for arithmetic. –  mikera Feb 22 '12 at 4:18

There are a few definitions of power beyond Turing completeness. Mark's cited what I tend to think of as "the Paul Graham definition." It's a pretty good definition, with one serious flaw: it's wrong. It's theoretically a very good definition of language power, but you know what they say about the difference between theory and practice...

If everyone was capable of writing perfect code, not only perfectly bug-free but also perfectly future-proof, consistently, then the Paul Graham definition would be correct. But that's obviously not the case. In the real world, the majority of time and effort that goes into software engineering is not taken up by initial creation of the product, but by maintenance afterwards. Depending on which statistics you listen to, (and it probably varies quite a bit from project to project,) maintenance can account for anywhere from 60% to 90% of the total effort that goes into a program.

Maintenance is often performed by people other than the person who wrote the code initially, and frequently months or even years after the initial writing of the code, which means that even to the original coder it may as well be "other people's code" by that point. If you want to be productive during maintenance, you need to be able to quickly ascertain the original intent of the code by reading it.

Therefore, a more powerful language is one that makes code easier to read quickly, not one that makes code easier to write quickly. There tends to be a fair amount of overlap between the two, but the concepts are often at cross purposes as well, since terse syntax will often omit details that a compiler/interpreter is able to infer a lot more easily than a maintenance programmer.

EDIT: There's another important point in describing a language's power: the range of concepts that you're able to express, and how easily you can hit both ends of it. Paul Graham likes to evaluate this one on how high a level of abstraction you can reach, but that's only half of it. Any language that imposes a lower limit of abstraction, beneath which you can't go when necessary, is crippled because the details that are being abstracted away are there for a reason. This is the difference between an easily-readable toy language like COBOL and an easily-readable powerful language: COBOL has no pointers and no access to inline assembly, where you can express any computation, even ones that COBOL is not well-suited to.

COBOL is also not particularly good at hitting the high end of the abstraction spectrum either. According to Wikipedia it has "no user-defined types, and no user-defined functions," which makes it very difficult to create algorithms and data structures.

share|improve this answer
1  
The problem I have with this is that it seems to point to COBOL as a very powerful language. –  David Thornley Oct 6 '10 at 21:30
2  
I take it you don't know Lisp? :) –  dash-tom-bang Oct 6 '10 at 22:34
1  
@Matt: That's the thing. What a language is used for is limited by what a language can be used for, and there's a lot less you can do with Python than with a language that doesn't abstract away memory-related details. –  Mason Wheeler Oct 7 '10 at 20:19
2  
-1 Because of the implicit notion that shorter, more expressive code is somehow harder to maintain. You've taken both the common meanings of language power (expressiveness vs openness) and conflated them into one concept that only half expresses either of the two original ideas. –  CodexArcanum Nov 4 '10 at 20:55
1  
@Jörg W Mittag: You are right, but I think that the sentence I cited refers to the direct control of the hardware resources (e.g. memory): C++ gives you more control. Of course, if you implement a virtual machine you have full control, but I think Mason Wheeler referred to having control of the real machine. –  Giorgio Dec 13 '12 at 7:05

There seems to be a lot of disagreement over what constitutes linguistic power. Is it terseness, legibility, adaptability, or just plain Turing completeness? I think that all of these factors come into play, so perhaps the best way to look at it is in terms of stat points. Yes, I'm talking pen-and-paper RPG, here.

The idea is that each language has (roughly) the same number of "points", which can be distributed arbitrarily across a number of categories. For the purposes of discussion, say the only factors are brevity, legibility, and flexibility. A language then might be extremely terse and flexible, but consequently very difficult to read; or very legible and flexible, but extremely verbose.

(Arguably, the number of points that a language has to distribute is defined by the skill of the designer and implementor, but let's pretend that all language designers are equally good at what they do.)

When a language designer decides to increase the strength of a language in one category, they logically take away a fraction of that potential strength from every other category. This is why it's so often said that programming language design is all about trade-offs. From this point of view, the overall power of a language is still not definable, and we have to revert to the tried and true method of categorising languages based on their relative strengths. Not satisfying? Too bad.

You can argue two ways: that a powerful language is one with a relatively even distribution of points (jack of all trades, master of none), or with as many points as possible in one area without leaving others unattended (specialist). There is no such thing as a "renaissance man" language, with perfect mastery in numerous fields. And if that's your definition of the most powerful possible language, then you're just plain out of luck.

For further reading, this article (coincidentally also by Paul Graham, who seems to have mixed opinions) touches on the idea that, difficult though it may be to determine how, programming languages do indeed vary in power. He argues rather persuasively that it's very easy to see how a language is less powerful than your preferred one—it's missing feature X—but very difficult to see how a genuinely more powerful language is in fact so—it's basically equivalent to language X, but with a bunch of other stuff thrown in. I leave you with a quote from that paper:

By induction, the only programmers in a position to see all the differences in power between the various languages are those who understand the most powerful one. (This is probably what Eric Raymond meant about Lisp making you a better programmer.) You can't trust the opinions of the others, because of the Blub paradox: they're satisfied with whatever language they happen to use, because it dictates the way they think about programs.
share|improve this answer
    
I disagree with your model that all language necessarly have an equal number of points in their distribution. Let's take the extreme exemple of brainf*ck and we can easily say that it is not comparable to any modern language, even if only by the total number of points. ie it is not a zero-sum game in programming language - language do not start with x points and distribute them, they start with 0 and get points depending on features. That there is some compromise that need to be taken is of course natural but all choices are not equal (my opinion at least). –  n1ckp Oct 7 '10 at 12:21
    
I didn't say that all languages necessarily have the same number of points. I said that all languages under consideration (that is, languages designed for real use) have roughly the same number. Esoteric languages are a pathological case because they're not designed to be useful in the first place. I was simplifying for the sake of argument, since it's not useful to try to differentiate between languages based on sheer "number of features", if in fact features are countable. –  Jon Purdy Oct 7 '10 at 12:39
    
sorry I reread your post and I have to agree I read a little too fast .. but I still disagree that every (mainstream) language have roughly the same points. Let's take Java and c++ because they are language I know somewhat good. I'm quite sure I can affirm that c++ is more powerfull than Java just because c++ off basically everything that Java do (except gc - but then java do not offer manual memory management either) PLUS more (real templates FTW). That what somewhat the point I wanted to make I think: No, not all language are roughly equal in programming fairy land, even –  n1ckp Oct 8 '10 at 7:27
    
when comparing only mainstream languages. –  n1ckp Oct 8 '10 at 7:28

This was written in regard to natural languages, but I think it is appropriate to programming languages as well:

A belief that some languages are intrinsically superior to others is widespread, but it has no basis in linguistic fact. Some languages are of course more useful or prestigious than others, at a particular period of history, but this is due to the preeminence of the speakers at that time, and not to any inherent linguistic characteristics.
--David Crystal (ed.). The Cambridge Encyclopedia of Language 2/e (1997). p.7

"Power" simply isn't attributable to one language over another. It would be silly to say "Chinese is a more powerful language than Korean." Likewise, it is silly to say "APL is a more powerful language than COBOL."

There have been several attempts to equate linguistic power with some objective measure. I believe these attempts fail:

  • It may be easier to get a job in the US if you speak American English than say Maori. Likewise, its no doubt easier to get a job programming Java or C, rather than LISP or J. But this economic advantage certainly doesn't reflect some kind of innate power of the language. Its about the power of speakers of the language.
  • "Hi" isn't better than "ni hao" or "shalom" because its shorter. Similarly, while a function may be expressed more succinctly in APL than COBOL, this too doesn't reflect some kind of innate power of the language.

My opinion is that discussions of "the power of one language over another" are veiled expressions of the speaker's feelings of superiority over some other group. In short, its prejudice and stereotyping. Of course, people who are prejudiced really, really believe their stereotypes quite strongly, and its unlikely you could persuade them to change their minds.

share|improve this answer
    
I disagree. For an easy exemple I think noone would say otherwise than to say than there exist more powerfull language than brainf*ck (say) even if theorically it is turing complete (I think). The point is that 'powerfull' is a certain quality that have nothing to do with the fact that they are all 'complete'. I agree that it can be somewhat subjective but to say that all language are equal with regard to 'powerfullness' seems pretty far fetched. –  n1ckp Oct 7 '10 at 12:15
1  
@n1ck: Are you saying Power=Readability? And :. BF's lack of readability implies its lack of power? APL and J also have very low readability, yet they're extremely useful and succinct (though I'm certainly not equating usefulness or succinctness with power either). Going the opposite direction, COBOL is very readable; its downright verbose; but again, this hardly makes it more powerful than APL or BF. BF is highly amusing; it has the power to amuse; but that's not Power qua Power. The problem is that nobody seems to have a good theory of Power behind which they can get a consensus going. –  A. N. Other Oct 7 '10 at 19:04
    
No I did not meant that power=readability. I just disagree about your view that all language are equal and that we can't compare language on 'powerfullness', however you define it. In my opinion, a basic of readability is required to give any power to the language but it is not really the question. If we want to really answer the question we would of course need to define powerfullness first but in my view this is not the same as 'best in every situation' which your answer seem to hint me that you interpreted it that way (ie no best language for everything, which I kinda agree). –  n1ckp Oct 8 '10 at 7:22

Discussions about programming languages are - IMHO - like discussions about mail clients in some Linux newsgroups: they tend to be a flame war. I can remember times when VB6 was popular. There were people even arguing that it isn't a programming language at all, while others created stunning applications with it.

I think programming languages differ already in the concept as the creators had different things in mind when they created/designed the language. So a language that fits one purpose - and under that circumstance is powerful - might not fit another. Naming the language powerful or not is then purely subjective. That said, I do not think that there is a metric that can be applied.

share|improve this answer
    
+1 to counter unexplained downvote, and because I generally agree with it. Use a langauge for the task it was designed for. Don't write complex GUIs in C, don't write complex algorithms or OSes in VB6 –  Gerry Oct 8 '10 at 1:48

I think the the power of a language (and thus its usefulness) is proportional to the tools it gives you to translate abstract concepts in code. In this definition, I find C++ extremely powerful, even if mastering it (see also: metaprogramming) it's not easy.

What I like most is that C++ is powerful AND fast. So said dynamic languages (python, Perl etc) are also powerful but that power comes often (but not always) with a big cost: speed. That's because you can do magic with runtime code instead of compile time one. This is not always true,of course.

share|improve this answer

They are all tools in your tool chest. A hammer can be powerful, but not if you need a wrench. C/C++ is great if you are a systems programmer, but Adobe Flash is probably a better fit for that gaming web site you want to build.

share|improve this answer

We can't define what a "powerful" language is without first defining the word "powerful."

The literal definition of power would be "potency", and I think we can all agree that the vast majority of compilers - and even many interpreters that aren't Turing-complete - do an equally good job of getting the processor to execute their instructions. So as far as the literal definition, the answer to the question would be "almost any language at all."

Practically, we really ought to stop there; defining a "powerful language" is a bit like defining a "good person" or a "quality product." There is absolutely no objective definition of these words that you could get everybody, or even a majority of experts, to agree upon, and most definitions simply end up begging the question. Depending on who you talk to, power could be any of the following:

  • A rich general-purpose framework or library for performing a wide variety of common tasks
  • A sophisticated domain-specific syntax that "does one thing and does it well"
  • Direct access to machine functions, i.e. the ability to write low-level code
  • Abstracting away machine-level concepts, i.e. the ability to write high-level code
  • A very rich type system allowing for advanced strategies like reflection, DI, and static analysis
  • A very loose type system that allows programmers to just get it done (type coercion, etc.)
  • The ability to treat everything as an object, which offers conceptual verification
  • The ability to treat everything as a function, which offers mathematical verification
  • Automatic memory and resource management (GC, RAII) leading to fewer bugs
  • Manual memory and resource management, potentially leading to optimized performance
  • A minimum amount of syntactic noise, leading to improved readability
  • A more English-like syntax, which offers a shallower learning curve
  • The ability to write very concise code (i.e. ternary operator, null-coalescing, null-extension)
  • The inability to write potentially confusing code (i.e. no ternary operators, etc.)

Does everybody see what's going on here? Virtually every bullet-point feature can be interpreted as a sign of "power", and so can its exact opposite!

Somebody, somewhere, obviously thought that variable variables were an awesome idea that would make the language very powerful. I won't judge; I'm not a PHP guy.

I propose that instead of all this holy-war nonsense, we all use this Really Simple Definition:

The most powerful language is the one that allows you to ship the highest-quality product at the lowest cost in the shortest amount of time.

Vague? You betcha. That's why anyone who wants to call him/herself a professional has to understand both the programming concepts and the project domain. That's the only way you're going to be able to decide what's "powerful" for you.

Otherwise, you might just be bringing a really big knife to a gun fight.

share|improve this answer
    
+1 This is the only definition that tries to include all the various notions of language power. I especially like how you show that conflicting features can both be considered powerful. Computer Science is the science of trade-offs, even in language choice. –  CodexArcanum Nov 4 '10 at 21:02

The most Powerful programming language is the one that solves the following linear programming problem:

Maximize

      Rapidity of development
    + Ease of reading code
    + Ease of debugging
    + Succinctness/brevity of expression
    + Ease of learning/teaching
    -  CPU usage
    -  Memory requirements

Subject To

  • It must be Turing Complete.
  • It must be multi-paradigmatic: functional, object-oriented, logic programming, constraint programming, concurrency, distributed computing, etc.
  • It must be versatile, allowing the creation of command-line interfaces, component libraries, servers, GUIs, and web applications.
  • It must be portable, i.e., easy to port and maintain in a cross-platform setting.
  • It must be adaptable, i.e., open to change and able to evolve as new hardware (quantum chips), new paradigms, and other innovations in technology occur.
  • It must encourage the development of libraries (like CPAN, CTAN, and CRAN).
  • It must be free and open source.

(And yes, I know, I already posted a completely contradictory answer. That's because I'm a dialectcian.)

share|improve this answer

This has been debated repeatedly at great length (e.g., on comp.lang.lisp, several times). I don't think anybody's ever come up with a "right" answer but a lot of people have come up with answers that strike me as obviously wrong.

In the answers I see here, let me pick on Mason Wheeler's answer. On one hand, the issues he covers are important -- but on the other, I can't quite imagine calling them at all related to "power." It's a bit like he's saying his Honda mini-van is more powerful than a top-fuel dragster because it's safer, quieter, has better handling, more passenger room and a much more comfortable ride. All of this is absolutely true, and it's all important. Those factors (among many others) make the minivan much more practical and reasonable for most people -- but they don't change the fact that the minivan's engine produces only about 250 HP whereas the dragster's produces somewhere around 8000 HP.

The problem, of course, is that with vehicles there's a clear-cut definition of what constitutes "power" and what doesn't. With programming languages, it seems to me that the discussion ends up being about equivalent to treating handling, comfort, speed, cargo capacity, and cruising range as all being parts of "power". The result tends to be threads that run on endlessly, generating a great deal more heat than light. Most of the questions that arise basically come down to the degree of importance you attach to completely unrelated and orthogonal features -- e.g., is the ability to program the MMU in assembly language more or less "powerful" than the ability to create higher level functions in Haskell? At least IMO, there's no meaningful way to compare the two, and no meaningful answer to which is "more powerful", or implies more power, or anything of that nature.

As such, as much as I hate to I have to say that in this case, the only meaningful answer is basically a relativistic one -- a powerful language is one that you find helps you to accomplish what you want to. Differences in peoples' goals render most "absolute" measurements of power meaningless at best.

share|improve this answer

Programming languages are tools - nothing more, nothing less. Some tools are extremely specialized and well suited for particular purposes; others are generalized and simplified to the point of near uselessness.

I would argue that the most "powerful" language is the one which allows you to achieve your goals with a minimum investment of time, energy and other researces; that is, the language which provides the greatest ROI. In some situations it could be C; in others, Java; in still others, Haskell.

The best thing to do would be to familiarize yourself with a wide variety of languages and what they're useful for. Then, when the time comes to begin a new project, you can make an informed decision about which would be the most appropriate.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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