Fog Creek Software
Discussion Board




Coding is language!

(re the post "coding is math?")

But seriously, folks, coding buisness applications rarely has anything to do with math (besides the few bits of sql thrown in). What it really is all about is language skills. You see, coming up with an algorithm to solve a specific problem is not too hard. I have seen lots of people writing code to do that. What is really hard, is writing a whole program, that will grow and prosper over many developement iterations and so forth. Writing code that _communicates_.

So why is language important? Does it help select better variable names? No! It helps deciding, if a specific variable is needed or not. Maybe, the code would communicate better, if it where refactored to an expression.

This math bit seems to excite geeks all over the world. The very types, who try to make computers seem far too alien for granny and grampa. Why do they dig math?

Because they don't see the light: Math is language too. Algebra is a language with rules (grammar), so is set theory and so on. What makes coding difficult is translating from one language (requirements) to all the other languages involved in a softwares developement.

So, to start programming, I would suggest: learn latin. Learn french, italian, german (don't forget to learn english!) and start taking arabic lessons. Learn as many languages as you can, including formal languages (algebra, set theory, logic, c, basic, whatever) and practice comparing them.

For: Language skills is about representing the world in a hierarchical system of symbols. If you can't write an essay in your mother tongue - no matter how geeky you are, you just won't be any good at software development.

Next languages for me to learn: set theory (having problems with complicated sql queries), spanish / portuguese, japanese / kantonese, lisp, msil, ip & co.

DarenThomas
Monday, May 10, 2004

There are other forms of language.  Modelling techniques for example use diagrams, like flow charts, to model reality.  The job of systems analysts is basically to understand the reality (i.e. how an organization works, what the needs of the staff, clients are, etc) and to model that reality in a language that can be translated in computer code.

CLK
Monday, May 10, 2004

If you think that human languages and computer languages are comparable in any significant way, then I submit you have little idea of either.

Stephen Jones
Monday, May 10, 2004

Coding is coding. It's not language at all in the cognitive sense. Recall that the first Holerith cards were emulating wooden pattern blocks from the textile industry wherein the design of a rug was encoded with small holes that the looms could interpret for which thread to use in which sequence.

Fortran in the 60s simply combined a very small subset of english words with some pre-programmed mathematical functions to construct an imaginary Holerith card in binary machine ops. The code was just a pattern of sequential electronic operations, nothing more.

Today's programming languages are a bit more sophisticated but not a whole lot more.

old_timer
Monday, May 10, 2004

Computer languages and human languages are the same kind of thing, except that computer languages are vastly simpler.

The Real PC
Monday, May 10, 2004

Has someone been reading Goedel, Escher, Bach again?

You're right, computer code is language.  A very unambigious language.  As are the symbols we use to represent mathematical concepts.

I wouldn't suggest learning a bunch of languages as a means of preparation for learning to program though.  For most people, learning the syntax and grammar of language isn't the hard part, it's understanding the concepts that they represent and how to use a very small set of words to accurately and completely represent a complex concept or series of actions.

I think you'd be better served by trying to tell (no demonstrations) a three year old how to do the dishes, or the laundry (I'm still not sure what qualifies as "white" myself).

Don't confuse learning to program with learning a programming language.

Steve Barbour
Monday, May 10, 2004

---"Computer languages and human languages are the same kind of thing, except that computer languages are vastly simpler.

The Real PC
Monday, May 10, 2004 "-----

Do you have any evidence to back this up, or is it just a statement of faith?

Stephen Jones
Monday, May 10, 2004

Stephen, I think that what he means is that human languages are (typically) instances of context-sensitive grammars (although actual spoken language is more like a probabilistic grammar -- since real sentences aren't necessarily syntactically correct).  Computer languages are (except in a few cases) specified as context-free grammars, which are a special case of context-sensitive grammars.

Look up "link grammars" and "probabilistic earley parsers" for some interesting reading on this subject.

Kalani
Monday, May 10, 2004

Apologies to Mr. Analogy:

Computer Languages are to human languages are what cookbooks are to literature.

MilesArcher
Monday, May 10, 2004

I've thought that my being taught to be bilingual helped me later to learn applied maths and physics. I learned that "cat" is not an actual cat, instead it's a word that represents a cat ... that there are several ways (languages) in which to represent a cat.

And I think it's true that the act of programming is the act of translating user desires into requirements, and of requirements into code.

Christopher Wells
Monday, May 10, 2004

Mathematics is a Language

KayJay
Monday, May 10, 2004

I wrote up a recent meeting where human communication and code was a small theme.
http://alu.cliki.net/lisp-user-meeting-amsterdam-april-2004

It's mentioned pretty immediately in the lecture intro, then when I describe the intermission (a couple pages down).

This was written for a specific audience, and I suspect a general one would consider it language bias or something. So if you don't like that, please feel free to skip this link, because this is not my attempt at any sort of language marketing.

Tayssir John Gabbour
Monday, May 10, 2004

Coding, like "human" languages (English etc.), is about manipulating symbols to express meaning.

Should be working
Monday, May 10, 2004

"If you think that human languages and computer languages are comparable in any significant way, then I submit you have little idea of either."

In my experience, people with an aptitude in one are fairly likely to have an aptitude in the other, too.

Of course, this is from a developer with an MA in Linguistics.

Jim Rankin
Monday, May 10, 2004

If you know the notes to sing, you can sing 'most anything.

Communication process involves syntax plus logic. Its purpose is context sensitive. Mathematics, Languages, Music, et al. are communication tools and therefore at some level have a very close one to one correspondence.

KayJay
Monday, May 10, 2004

---"Coding, like "human" languages (English etc.), is about manipulating symbols to express meaning. "----

No! The only part of your code that expresses meaing are the comments and the namings. Code is designed to result in the shifting of bits.

Stephen Jones
Monday, May 10, 2004

So the shifting of bits is the meaning, or at least the results of the shifting of those bits.

Or perhaps you're saying that you only write meaningless programs.

Steve Barbour
Monday, May 10, 2004

What is meaningless is all this talking about meaning. If you turn on the light switch you are not communicating meaning with your fingers. If you turn a switch in a transistor in a memory module, which is the direct effect of your programming, then you aren't communicating anything either.

Stephen Jones
Monday, May 10, 2004

---" Mathematics, Languages, Music, et al. are communication tools and therefore at some level have a very close one to one correspondence."-----

Waffle: if there's a one to one correspondence show it.

Stephen Jones
Monday, May 10, 2004

---"In my experience, people with an aptitude in one are fairly likely to have an aptitude in the other, too."----

People with an aptitude in one intellectual field often have an aptitude in another. Indeed there is a postive correlation between athletic acheivment and intellectual acheivment.

I will agree that learing a language may require one to distance one's mind, and to look into the ways things structure themselves, and that these abilities are useful for programming,  but that does not mean that human languages are related to computer languages in anyting but name.

Stephen Jones
Monday, May 10, 2004

"If you turn on the light switch you are not communicating meaning with your fingers."

Tell that to Paul Revere.

"If you turn a switch in a transistor in a memory module, which is the direct effect of your programming, then you aren't communicating anything either."

And if I depress switches on this keyboard attached to my computer, that then causes this message to appear, then I'm not communicating either, right?

You're going 180 degrees from the original poster (who I didn't completely agree with) and making a similar error.  Programming languages are languages, and as languages can be used to convey meaningful information.

The language that we use to represent math is a language and can be used to convey information.

Ditto, with music.  You can even translate from one language to another.  I don't think that there is always a direct one to one correspondence, but there is a correspondence.

I still don't think language training is the best way to prepare for computer science BTW.

Steve Barbour
Monday, May 10, 2004

---" And if I depress switches on this keyboard attached to my computer, that then causes this message to appear, then I'm not communicating either, right?"----

Depends what the message is. If I flick the light switch on and off I can send a message in Morse code, but iti is not the act of switching the lightswitch that communicates the message, nor indeed is it the Morse Code. The language that communicates the message is English or Chinese or whatever.

Computer languages and Human languages share the name and some other terminology. I am not at all sure that this doesn't cause more confusion than it solves.

And what do you mean by using a language to express math? Surely the math and the language are the same?

Stephen Jones
Monday, May 10, 2004

To give another analogy, some people appear to think that language is a global class and that hiuman language, musical language, computer language, and Mathematical language are sub-classes that inherit from it.

I prefer to think of each type of language as being locally declared variables that do not impinge on each other.

Stephen Jones
Monday, May 10, 2004

Stephen,

Not much of a musician, but insofar as Mathematics, Language and Coding are concerned, is not having a modular expression, viz. a line of code, a sentence, an equation, that consists of operands, operators & functions, subject, object & verbs,  variables, operators & functions reveal, at some level, a one-to-one correspondence?

KayJay
Monday, May 10, 2004

no

Stephen Jones
Monday, May 10, 2004

> The language that communicates the message is English or Chinese or whatever.

In fact, Morse can be a language in its own right, with its own words such as "SOS" (meaning "I'm in distress") or "CQ" (meaning "hello?").

Check out "meaning" in the dictionary: import, purport, significance, purpose ...

The phrase "debit my bank account" can be meaningful. The software which does the debitting is similarly meaningful (whether the software is in source code, or compiled). And in both cases (English or software) it's not so much the phrase that has meaning: it's the act that has meaning.

Christopher Wells
Monday, May 10, 2004

The language used to express math and the math itself are definately not the same. 

I can say "one plus one equals two" to express that concept or I could write "1 + 1 = 2", or I could use pidgin German (I'll spare you).  The language isn't the same, but the concept is.

As far as flicking the light switch, your message can be as simple or complex as you wish.  It could be as simple as "someone just turned on the light", it doesn't matter, it conveys meaning as long as there is someone there to interpret it.

Languages express meaning, that is their most basic function, but the language and the meaning they express are two completely seperate things, and yes, you can use language to express gobbledy gook as well.  I'll leave others to interpret the meaning of that though. ;-)

Steve Barbour
Monday, May 10, 2004

> I'll spare you

I won't! Ein und ein dswei ist.

I think the Maths and the language are the same; and that the "meaning" if any comes from when you try to apply that to the 'real world', like "one apple plus one apple equals two apples".

Anyway, it's turtles all the way down.

Christopher Wells
Monday, May 10, 2004

Coding is *not* language in the sense that what we tell the computer in reality communicates nothing to it except how to move some bits in and out of registers.  The computer ascribes no real meaning to it because the computer cannot (as of yet) think.

Coding *is* language in that it is a semantic overlay constructed by humans to describe what is happening in the computer so that we as humans can understand what is going on. 

The bits in themselves mean nothing - but we have assigned semantics to them that allow us to make meaningful computations and deductions from them.  Coding is a language in that it is a vocabulary and a grammer designed to allow a human to describe process. 

The language communicates from programmer to programmer, or from language designer to programmer.  The fact that semantically it is meaningless to the computer does not remove the fact that it encodes the human understanding and description of a computational process.

Connor Berry
Monday, May 10, 2004

Well put Connor.

Steve Barbour
Monday, May 10, 2004

Computer languages are languages in the formal sense.  As long as the language has a well-defined semantics, it doesn't matter whether it's implemented on top of bits or neurons.  I can understand and respond correctly to "for(int i = 0; i < 50; ++i) print(i);" just as well as a computer (if not quite a lot slower).

I think that the argument about meaning is a dead end.  When you get down to the level of neurons, there's not a lot of intelligent stuff going on there either.  Whether the computer knows what a program "means" depends on how you mean "meaning".  The "meaning" of a sentence is exactly the semantics of the sentence.  Like somebody else said, 1 + 1 and "one plus one" are syntactically different but semantically they both mean 2 (using the semantics of ordinary arithmetic).  You might say that although the computer knows what 1 + 1 means in an arithmetic sense, it doesn't know that "1 + 1" is commonly associated with simple examples of things (coming from early childhood lessons).  That's true, but that's a different set of semantics.

So I think that it's more meaningful to say that although a computer understands some simple languages, it doesn't cover all of the domains typically covered by (for example) adult human English speakers.

Kalani
Monday, May 10, 2004

Via http://dictionary.com/ we have:

Music: an artistic form of auditory communication incorporating instrumental or vocal tones in a structured and continuous manner.

Language (w.r.t. Computer Science): A system of symbols and rules used for communication with or between computers.

Mathematics: obviously a system of symbols and rules that can be applied to them, or is Stephen going to object to that as well?

In short, Music, Language and Mathematics *are* related, and this relation is commonly accepted except, perhaps, amongs trolls.

David B. Wildgoose
Tuesday, May 11, 2004

To paraphrase Wittgenstein (badly, but I can't be bothered to look up the exact quotation at the moment)

"The limits of my language are the limits of my thought"

Modern (ie C20)philosophy of language got really into this - see for example the 1st chapter of Simon Blackburn's "Spreading the Word". There he discusses the relationship between speakers, the world, and the language they use to describe it. The way we think about the rellationships between these things give us theories of truth (langugae <-> world), meaning (speakers <-> language) and knowledge (speakers <->world).

This may sound lik a bit of a digression, but it is important. The way we think is bounded by the the language that we use. While all computer languages in every day have equal expressive power (are Turing complete), some languages push ones thoughts in different directiosn to other - witness the different ways that functional and procedural programmers tend to approach problems.

Informally, we see this with natural languages as well.  Is there a better language to swear in than English? French is the language of love, German is the language of engineering etc...

Back to the original post: I'm not sure that learning lots of different natural languages really aids programming (although English may help you swear at your computer, French may help you chat up the cute girl in the next cube, German to write requirements etc...:-). Mind you, I'm not really sure how knowing lots of maths helps your programming ability either.

All the best,

treefrog
Tuesday, May 11, 2004

Oh, I think German is a much better language to swear in myself.  It's like English, but more abrupt sounding.

Although Afrikaans has some pretty decent swear words as well, at least I think my cube neighbor is swearing. If he isn't he should be.

Steve Barbour
Tuesday, May 11, 2004

Dear Treefrog,
                      The idea that one's language restrains one thought to the extent that speakers of one language cannnot think in the same way as speakers of another is called the Sapir-Whorf hypothesis, after an amateur linguist called Whorf who proposed it and one of the greats of American Linguistics who had nothing to do with it. In its strong form it is completely discredited, though many would accept that certain languages make it harder to conceive of things than others (it's easier to describe the forty different types of snow if you have a separate word for each in your language, but if the differences affected your life you would soon develop those forty terms and use a work-around until then).

                    I am glad that David has learned to use a dictionary; I am sure he will find the skill useful as he furthers his education. Unfortunatley he did forget to look up the definition of language when it does not refer to computer science, which is what the discussion is all about.

                    The ReaL PC suggested, succintly, that the difference between computer languages and human languages is one of complexity. I am not saying that this is impossible, but I am saying that I see no evidence for this, and my personal feelings is that the difference is a more fundamental one.

                      The reason I say this is that I believe meaning is the core to human language. Computer languages don't have meaning - they simply manipulate bytes. When a honey bee does its dance in front of the hive it is indicating by its gyrations the exact path to a flower bed, but there is still clear mapping from the symbol to the result. This is not true of human language - indeed often there may be no result at all intended.

                        When you send a message from your brain through your nervous system to your muscles telling you to open the door knob and thus open the door you are basically acting like a computer program, even though you are not using language. When you say "Whew, it's hot in here!" with the barely-disguised sub-text,"Will some bugger open the door before we all fry to death?",
your words may have the same effect, but they function in a different way.

                        True, human languages are structured, and use symbols, but the fact that you can find some similarities does not mean that things are akin or alike in any other respect than the ones pointed out. Both a plastic enema and David B. Wildegoose are made of structured hydorcarbons, but I would not claim that they are similar just because of this.

                          The fact that the best users of human language - the sales team and the HR team - are normally at daggers drawn with programmers ought to suggest that the use of the term languages to describe both human and computer languages does not imply great affinity. Human languages thrive on invention, ambiguity and extension - a computer program that had a lot of that would never compile.

Stephen Jones
Tuesday, May 11, 2004

in which stage of the programming process language losses its meaning?

you have said that humans communicate meanings (to other humans, who infer that meaning).  when we write computer programs we are creating a tool to communicate (people wil perform activities and collaborate at work).  that  could be seen as human - (computer) - interaction... at the end the computer and software are tools.

but what happens when you design and write (code) a computer application.  are you "talking" to the computer?

when you start designing a program of course you have in mind meaningful ideas.... you model them and transform them into code... where does the "meaning" get lost?

i think it is never lost.... when other programmers see your code, they will understand what you did they will extract the meaning from the code.... yes, code is language.

but if you are seeing coding as a human - computer interaction.... well... that is a different and narrow view of the problem... a computer does not infer meaning it just executes the instructions...

CLK
Wednesday, May 12, 2004

sorry, i made a mistake
in the second paragraph above,... it should say

human - (computer) - human interaction

CLK
Wednesday, May 12, 2004

Code is evil. Well it is sometthing else.

I view code as  a geek toy. It was built by geeks and they make sure it will allways be complicated enough that only geeks can understand it.

There is no reason that the human language could not be code by this point in technology. I mean sheesh why does it take so many stupid lines of crap to make a bare bones simple  app that draws a line accross the screen ? Why not the sentance of: draw line from X to Y. The computer should be able to understand what the hell you want by this time.

eh whatever

trip
Thursday, August 19, 2004

*  Recent Topics

*  Fog Creek Home