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.

Basically in both cases you have:

  • a well defined vocabulary
  • a syntax to respect
  • they both can express a business logic
  • they can define semantics

I don't think that will be fair to say "A programming language is only useful for a PC" or something like that.

I just can't find a real answer, but we can feel the difference, it's strange.

share|improve this question

closed as not constructive by Jarrod Roberson, BЈовић, gnat, ChrisF Jun 30 '12 at 14:14

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.

    
Isn't the purpose of each quite distinct? –  Emmad Kareem Jun 29 '12 at 23:53
13  
I dispute the claim that English (or any other living human language) has a well defined vocabulary. Not only do many English words have multiple dictionary meanings, popular usage can turn them entirely upside down. For example the slang usage of "sick" meaning excellent, and the popular if errouneous usage of "nonplussed" as "not bothered" or "not surprised". The lack of a well defined vocabulary is one immediate difference between human languages and computer languages. –  Charles E. Grant Jun 29 '12 at 23:55
2  
Since when does English have a well defined vocabulary? There's an entire SE site, English Language & Usage, devoted mainly to figuring out what words mean and how to use them. Also, you can bet there there are many differences between human languages and computer languages, not just one. –  Caleb Jun 30 '12 at 0:14
2  
@Charles E. Grant : Yeh, right..... (Just to prove your point) - In my country, usually means I don't believe you, but both the words agree with you. Thats same as a C++ like language having a statement x += +y; meaning x = x-y most of the time - depending how what the lines before it are. The fact that English (an other spoken languages) is not precise enough is why we have programming languages. This is not confined to computers - Matheticians, Chemists, Engineers, Phyisist and even Lawyers (Have you ever read a legal document?) have a language that is not English. –  mattnz Jun 30 '12 at 0:41
1  
@Izkata Exactly. Ergo, the OP's premise that both English and computer languages have well-defined vocabularies is false. –  Caleb Sep 6 '12 at 18:23
show 9 more comments

7 Answers

The essential distinction, I would say, is formally-defined syntax and semantics.

A programming language can be parsed by an automated tool according to formal rules, and found to either have meaning according to those rules, or be invalid and therefore worthless. And if it does have meaning, it means exactly what the formal rules say it means and nothing else.

A human language, on the other hand, is not understood formally but intuitively. You can mutilate the grammar to a pretty high degree and the person you're talking to will still understand what you mean, and what you mean (and are understood to mean) is frequently not precisely what you said.

As a side note, this tends to make natural language extremely difficult to parse. It remains one of the great unsolved problems of artificial intelligence, despite being one of the ones they've been working on the longest!

share|improve this answer
    
how you can define the semantic of a pointer? The pointer are probably born just to bypass the "scope" which is a concept strictly related to semantics. –  user827992 Jun 29 '12 at 23:55
2  
@user827992: No, pointers are not "scopes", they are memory addresses. They have a well-defined meaning: a pointer to an integer (for example) is the memory address of a variable that contains an integer. Scoping is a completely unrelated concept. –  Mason Wheeler Jun 30 '12 at 0:01
    
pointers are types, the content of a pointer is usually an address, they can also be NULL, from your point of view they are something like a bridge between a label and an address, it's not like that, a pointer, as third options, can also point to a random address for X reasons. Pointer are types and this does not ensure you that they have a meaning. –  user827992 Jun 30 '12 at 0:06
1  
Ahh - heres proof, we all (well, mostly all) intuatively "know" what a pointer is, but struggle to describe what it is in plain english. Yet the language definition means the compile knows exactly what it's for and what can and cannot be done wih it. –  mattnz Jun 30 '12 at 0:39
2  
@Scarfridge: The compiler is the formal definition. The language means exactly what the compiler says it means, and nothing else. Anything else--including a standards document written in a human language--is simply an attempt to describe the behavior of the compiler in an easier-to-read format. –  Mason Wheeler Jun 30 '12 at 12:21
show 3 more comments

Here's a biggie:

Mason has already said this, but: Formal languages have formally defined semantics. Human languages don't. It's not still really well understood how humans extract semantics despite the fact that this has been studied for decades by linguists, philosophers and psychologists.

I think it's pretty obvious that formal languages lack the semantic richness of even simple natural language. "The cat jumped over the lazy dog" encodes and is dependent on far more information about the world than just the definitions of the words and the syntax alone. Formal languages lack the syntactic and semantic ambiguity that is possible with natural language as well.

share|improve this answer
add comment

When I was a prof 30 years ago there would be these Faculty Colloquia or off-site weekends where some profs from around the university would get invited, with deans, for fancy food and "collegial" discussions. Read: b o r i n g.

Once the question was raised: Should a computer language be allowed as a substitute for the foreign language requirement?

This drove me nuts. To think that learning BASIC or PASCAL (at the time) was even on the chart, compared to learning French, German, or another human language and culture, seemed preposterous.

Technology is beautiful. It has a depth of meaning that can't really be imagined outside of it. At the same time, it is easy just to think of it as a means to an end - a way to engineer our mechanical slaves.

What is there in programming that can compare to a poem, or a novel? When you learn a human language, it is not just a vocabulary, syntax, etc. It is a window on history, culture, beauty, what makes life interesting.

share|improve this answer
2  
History, culture, and beauty? Their value is highly subjective at best. Computer programs can correspond to a poem or novel easily- they are also highly creative and, if you know where to look, beautiful. They even have dialects. Human languages involve pointless ambiguity, and can only express the kind of beauty that rarely gets anything done. –  DeadMG Jun 30 '12 at 4:11
3  
Poetry? Waka waka bang splat tick tick hash... –  Izkata Jun 30 '12 at 7:05
2  
"Human languages involve pointless ambiguity, and can only express the kind of beauty that rarely gets anything done." - This makes die a little inside –  spinning_plate Jun 30 '12 at 7:24
1  
@spinning_plate I feel with you –  scarfridge Jun 30 '12 at 11:15
1  
@DeadMG: Try reading Lacuna, The Death of Ivan Illych, Heart of Darkness, Mrs. Dalloway, or A Thousand Acres and show me a comparable program. Software does something for you. Literature does something to you. –  Mike Dunlavey Jun 30 '12 at 13:37
add comment

"A programming language is only useful for a PC" isn't fair you're right.

Fair way to state the difference would be

A programming language is also useful for a PC

The point is, programming language (just like English) is primarily intended to be read / communicated by humans, but unlike English, it has a cumbersome limitation that it has to allow for machine execution.


...Writing code certainly feels very similar to writing poetry. When I'm writing poetry, it feels like the center of my thinking is in a particular place, and when I'm writing code the center of my thinking feels in the same kind of place. It's the same kind of concentration. So, I'm thinking up possibilities, I'm thinking about, well, so how do I reinvent the code, gee, you know, what's the simplest way to do this.

I'm thinking about things like simplicity -- how easy is it going to be for someone to look at it later? How well is it fulfilling the overall design that I have in mind? How well does it fit into the architecture? If I were writing a very long poem with many parts, I would be thinking, "Okay, how does this piece fit in with the other pieces? How is it part of the bigger picture?" When coding, I'm doing similar things, and if you look at the source code of extremely talented programmers, there's beauty in it. There's a lot of attention to compression, using the underlying programming language in a way that's easy to penetrate. Yes, writing code and writing poetry are similar...

         (Richard Gabriel, Janice J. Heiss, The Poetry of Programming)

...Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do.

The practitioner of literate programming can be regarded as an essayist, whose main concern is with exposition and excellence of style. Such an author, with thesaurus in hand, chooses the names of variables carefully and explains what each variable means. He or she strives for a program that is comprehensible because its concepts have been introduced in an order that is best for human understanding...

         (Donald E. Knuth, Literate Programming)

share|improve this answer
    
I think that the Morse code can break the logic of your answer. –  user827992 Jun 29 '12 at 23:57
1  
+1, good attention to detail :) –  Emmad Kareem Jun 29 '12 at 23:57
1  
@gnat - Example: write me a piece of code that communicates "Larry ate pizza". Printing "Larry ate pizza" doesn't count –  spinning_plate Jun 30 '12 at 0:09
2  
@user827992 Morse code is a transport mechanism tied to the Latin alphabet (usually). It doesn't convey any other information besides the text itself. Formally it is a binary code and the computer can 'peel off' the encoding part, not make sense of what is underneath it. –  K.Steff Jun 30 '12 at 0:32
1  
Person("Larry").ate(Food("Pizza") –  Michael Best Jun 30 '12 at 0:44
show 7 more comments

Ask a strange question and you get a strange answer :) Here are some differences (INMO)! enter image description here - Add to the list the fact that recursion is meaningful to computers only and not to humans.

share|improve this answer
2  
What do you mean by "recursion is meaningful to computers only"? The Euclidean algorithm for GCD is recursive and it's been used by humans way before any form of computers existed. –  K.Steff Jun 30 '12 at 1:28
1  
Somebody is bound to take on the challenge of writing poetry in code, or worse starting a religion whose founding text is in COBOL ;) –  Terence Johnson Jun 30 '12 at 1:48
2  
So basically, you cherry-picked all the worthless things that you think are benefits for English, and listed them. –  DeadMG Jun 30 '12 at 4:11
1  
@K.Steff, you are correct, my wording was not accurate (it was 3 AM when I wrote this). –  Emmad Kareem Jun 30 '12 at 6:26
4  
Human languages don't have defined vocabularies. They have discovered vocabularies which are constantly changing. No one, not even a dictionary writer, defines what words exist in, say, English. Instead, they observe what words are being used in English at a point in time and record those. This is true of all non-invented languages. –  Steven Burnap Jul 1 '12 at 0:53
show 1 more comment

When you're speaking programming language you're speaking data and clear instructions.

When you're speaking English you're having 1 big negotiation over non-data which ends in ambiguous instructions and hidden meanings to data supposedly being clear.

share|improve this answer
add comment

Purpose of any language is communication, to make your feelings known to other side be it a person or a machine. The basic difference between English language and programming language is the way of communicating the feelings. In programming language you do it in a way you do it with a child, giving parsed information while English is much more complicated than that. You need to make your thoughts understood as per the listener, but here you have a same set of instructions for the system. This is the basic point. Coming now to structure and composition- We use English in our programming languages but is not the other way around. Also neither the structure nor the composition is necessary in English but if you miss this in programs it computer will make your life hell till you correct it according to the predefined set of rules. It is why the programmers are trying to merge English into the Programming language that Artificial Intelligence was born; so as to merge the gap between English and Programming Languages, to make layman understand the machine and machine understand the layman.

share|improve this answer
add comment

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