<p>A programmer writes the instructions for a computer to do its job. A program is a set of instructions for it to follow to accomplish or aid in performing a task. Sometimes the instructions can be rather abstract things like skipping certain instructions or doing others over and over. The programmer assembles instructions into smaller groups that accomplish a part of the task, called a subroutine (or function, method, etc). These are used as building blocks from which they construct the larger program.</p>

<p>Or, in one sentence: If computers are magic then coding is writing the spells.</p>

CC BY-SA 3.0
2017-06-21T21:37:55.770Z
Welcome to CSE! I hope we hear more from you in the future.
Ben I.
CC BY-SA 3.0
2017-06-23T16:58:58.297Z
No no, computers *are* magic. I should know, I'm an actual professional *friggin' wizard.* I got into [illusion magic](https://www.microsoft.com/en-us/hololens) recently, too. (In all seriousness, this comment is being serious).
Draco18s no longer trusts SE
CC BY-SA 3.0
2017-06-21T21:25:04.023Z
2017-06-21T21:25:04.023Z
bükWyrm
<p>Coding is like writing an instruction or assembly manual for a product.  Tell your parents its like them writing a manual for assembling something like a bicycle.</p>

CC BY-SA 3.0
2017-06-22T17:30:58.467Z
Welcome to CSE! This answer is a little short on details, would you mind fleshing it out a little? Otherwise, it's a pretty nice analogy. I hope we hear more from you in the future.
Ben I.
CC BY-SA 3.0
2017-06-22T17:26:34.223Z
2017-06-22T17:30:10.853Z
2017-06-22T17:30:10.853Z
Steveo250k
<p>When people asked me what I did, when I was a programmer/software engineer. I would tell them one of these.</p>

<ul>
<li>I am an author.</li>
<li>I write instruction manuals for computers. No not manuals on how to use computers, manuals <strong>for</strong> computers: The computers read the manuals, so that they know what to do.</li>
<li>I write poetry for computers.</li>
<li>I teach computers, how to be medical pumps. (My last job was programming medical pumps).</li>
<li>I am a wizard, I recite magic spells at computers, and they do what I want.</li>
</ul>

CC BY-SA 3.0
2017-07-14T16:35:00.173Z
2017-07-14T16:35:00.173Z
ctrl-alt-delor
<p>Tell them that you are making a computer work as per instructions, and the instructions we give are a sets of rules(syntax) with which one is able to produce many logical structures. Then explain that an engineer like you tries to think about the best possible logic to instruct the computer to do a specific task (such as "printing multiplication tables from 1 to 100 in a few seconds"). </p>

CC BY-SA 3.0
2017-06-21T12:43:58.323Z
Welcome to CSE!!
Ben I.
CC BY-SA 3.0
2017-06-21T12:30:45.913Z
2017-06-21T12:43:49.427Z
2017-06-21T12:43:49.427Z
Shekhar Reddy
<p>Coding/Programming is interacting with a computer or device with a language the computer can translate and actually use, because computers and other devices don't understand human languages.</p>

<p>Sometimes those interactions are things like asking questions, or taking notes to keep track of things, or looking up old information wherever you put it. </p>

<p>Programs are big collections of those designed interactions to achieve a specific goal, like, make a spreadsheet, send an email, or draw an object in three dimensions on the screen -- stuff like that.</p>

<p>Programming languages are just languages that humans code with so computers know how to translate and use their designed interactions. Those languages are usually a mix of human words and symbols to help with the creation of those instructions for those interactions.</p>

<p>The computer/device only cares about the instructions, not the language used to make those instructions, so it takes those translated, coded interactions as instructions for a language that the computer knows how to use that we humans can't really read without help of a translator.</p>

<p><strong>Coders/Programmers are basically the middle-men to help with communication and action between machines and humans.</strong></p>

CC BY-SA 3.0
2017-06-21T23:06:28.793Z
2017-06-21T23:12:06.617Z
2017-06-21T23:12:06.617Z
kayleeFrye_onDeck
<p>Code is like the rules of a game.</p>

<p>For instance <em>Hangman</em>. Explaining how the game works step by step is almost writing a computerprogram in pseudocode.</p>

<p>1 - Player 1 randomly picks a word out of a list.</p>

<p>2 - He writes down a number of dashes corresponding to the number of letters in the word.</p>

<p>3 - He askes player 2 to guess a letter.</p>

<p>4 - Does the letter occur in the word or not?</p>

<p>5 - Etc.</p>

<p>The purpose is not to really write the program, although 'we programmers' can  probably picture it by now, certainly the part where the the computer is the one thinking of a word for the other player to guess.</p>

CC BY-SA 3.0
2017-06-21T14:44:40.857Z
P.S. I am not great at computer science, but i am an educator! My answer is a 'lesson one' intended for a layperson.
Draakhond
CC BY-SA 3.0
2017-06-21T10:54:19.390Z
2017-06-21T11:49:43.137Z
2017-06-21T11:49:43.137Z
Draakhond
<p>I'm a programmer and when people ask me to explain what I do, I usually say that computers talk in bits, right? Zeros and ones. And it's hard for a human to understand that, so there are this tools called <strong>programming languages</strong> that are able to translate a more human-like text into zeros and ones.</p>

<p>The problem is that programming languages have lots of rules and each programming languages has it's own structure and rules (just like normal languages!) our job as programmers is to know this rules and play with them in order to get what I want.</p>

<p><strong>Example time!</strong></p>

<p>Let's say that we choose as our tool the Python programming language (not to be confused with the snake)</p>

<p>And our goal is to print 10 times on the screen "Hi"
We as smart programmers know that in python if we say:</p>

<pre><code>print("Hi")
</code></pre>

<p>It will show "Hi" on the screen, but it doesn't solve our problem, right? We want to see it 10 times in the screen, so we as <em>VERY</em> smart programmers tell python:</p>

<pre><code>print("Hi")
print("Hi")
print("Hi")
print("Hi")
print("Hi")
print("Hi")
print("Hi")
print("Hi")
print("Hi")
print("Hi")
</code></pre>

<p>And our goal is accomplished!</p>

<p><em>But</em> it's quite tiring to copy and paste that much code, so we as <strong>super</strong> programmers we know python's syntax and rules so we do:</p>

<pre><code>for x in range(1, 10):
    print("Hi")
</code></pre>

<p>And <strong>super saiyan</strong> programmers will do:</p>

<pre><code>print("Hi\n" * 10)
</code></pre>

<p><strong>TLDR:</strong>
Programmers are human beings trying to talk to computers through very strict and sometimes mean translators. But it's fun though!</p>

CC BY-SA 3.0
2017-06-21T11:47:29.273Z
Btw, I know in my answer I'm mixing a lot of concepts, but it was on the hope of not overcomplicating my answer
Safirah
CC BY-SA 3.0
2017-06-21T11:45:48.363Z
2017-06-21T11:45:48.363Z
Safirah
<p>Here is a fun, interactive, and impressively comprehensive-yet-easily-digestible article that covers all the basics of programming/CS for laypersons. It even explains many of the professional aspects of what a being employed as a programmer entails beyond just the theoretical and technical aspects. It's where I usually send people with a similarly un-technical background who display a curiosity about programming.</p>

<p><a href="https://www.bloomberg.com/graphics/2015-paul-ford-what-is-code/" rel="nofollow noreferrer">https://www.bloomberg.com/graphics/2015-paul-ford-what-is-code/</a></p>

CC BY-SA 3.0
2017-06-21T15:05:21.050Z
Nice article. Welcome to CSE! I hope we hear more from you in the future.
Ben I.
CC BY-SA 3.0
2017-06-21T14:57:13.870Z
2017-06-21T15:02:19.620Z
2017-06-21T15:02:19.620Z
Mitochondrion
<p>Coding is like writing a recipe for the computer to follow so that it solves your problem. The computer "reads" each step, and follows it, eventually reaching a solution. Some programs are better than others, just like some recipes are better than others - they are faster, they produce a better result, etc. Programmers aren't really the cooks, though - the computer itself produces the result. The programmers are more like the cookbook authors, producing the recipes (programs) for the computer to follow.</p>

<p>Now, I don't know about you, but I've followed a recipe before, and there have been times where I've been left wondering, "Have I put in 2 or 3 cups of flour?" or having mixed in an extra couple of chocolate chips (quite by accident, of course). A computer doesn't have these problems. It can make your "recipe" much more swiftly and accurately than you can. However, this gives you no excuse for providing the wrong recipe. No amount of accuracy will make brussels sprouts into ice cream, unfortunately.</p>

<p>Lastly, <a href="https://cseducators.stackexchange.com/questions/868/how-to-explain-what-code-is-to-my-parents#comment1503_891">@dckuehn</a> brings up a great point. No analogy is perfect, and this one is no <em>exception</em> (heheh). Whereas, in a recipe, you really try hard not to vary the input so as not to vary the output, most programs take different kinds of input and produce different kinds of output, according to the same rule. Sort of like you can put a bunch of different cookies in the oven to bake them - not the same input, not the same output, but a fairly similar process inbetween.</p>

CC BY-SA 3.0
2017-06-20T23:06:53.143Z
Very nice analogy.  "The programmers are more like the cookbook" :)
Ben I.
CC BY-SA 3.0
2017-06-21T07:09:09.487Z
Nice indeed ! Very simple, yet accurate. Maybe adding a simple real example of code (like do the sum of the first 100 integers as @Cort Ammon suggested) would make them understand better.
Shashimee
CC BY-SA 3.0
2017-06-21T12:45:16.460Z
I think it also helps to explain that computers do very simple things, but do them extremely quickly, and very reliably. Kind of like how a production line can build a car in lots of steps.
Sean Houlihane
CC BY-SA 3.0
2017-06-21T16:52:19.670Z
I think it would be worth explaining that programs differ from recipes in that the result is not always the same.  You expect (hope) a recipe to yield the same thing each time.  The program will react different to different inputs, similar to a math equation.
dckuehn
CC BY-SA 3.0
2017-06-22T07:23:49.573Z
Knitting recipies may be an even better analogy.  The result is much more well-defined even though you have different sizes.  Also they _resemble_ code.
Thorbjørn Ravn Andersen
CC BY-SA 3.0
2017-06-22T11:09:29.460Z
I very often use the 'recipe' analogy, so 1+ for that. But for a real-world demo, show them Robo Rally ([board game](https://boardgamegeek.com/boardgame/18/roborally)), or Chip Wits (brilliant ancient Mac game, [modern remake](http://www.chipwits.com/)), or Lego [Mindstorms](https://en.wikipedia.org/wiki/Lego_Mindstorms).
KlaymenDK
CC BY-SA 3.0
2017-06-22T12:28:21.990Z
The recipe and cookbook analogies are such great ways to deliver the idea of coding to people who don't know much code, that Chef ruby is based around them: https://docs.chef.io/ruby.html These ideas have proven to sell - they're worth a lot in term of business impact (and money, of course).
Nahshon paz
CC BY-SA 3.0
2017-06-22T13:08:05.013Z
You'll also have to convince your parents that computers are dumb machines which *have* to be told what to do. A lot of people will think of computers in terms of the function they provide.
Peeyush Kushwaha
CC BY-SA 3.0
2017-06-22T16:48:54.553Z
I like and use the recipe analogy a lot, but I usually add the caveat that a program is a recipe written for an entity that cannot think for itself.  A standard recipe will just say something like "add 2 cups of flour".

However, there's a lot of assumed knowledge there that a computer program has to include explicitly.  Where does the flour come from?  What should be used to bring it over to the bowl?  What if there's not enough?  What if it spills?
chazlarson
CC BY-SA 3.0
2017-06-23T06:45:44.560Z
"A computer is just a very fast electronic idiot"
Criticize SE actions means ban
CC BY-SA 3.0
2017-06-20T23:05:49.830Z
2017-06-22T22:35:44.607Z
2017-06-22T22:35:44.607Z
auden
<p>I tend to describe code as a contract. Most people know that if you read a contract, it's not in English - it's in "legalese". Legalese is a language that looks mostly like English, but it's full of odd phrases and very specific wording, and the punctuation is different. Contracts are written this way because each phrase has been interpreted by a court to mean something very specific, and so contracts will use the same precise wording so that they will be interpreted by a court in the way the lawyer wants.</p>

<p>Programming languages often look kind of like English too; they use English words, but have different structures and punctuation. This is because a compiler is like a court: it will interpret these specific phrases in a specific way, and each phrase will add a certain piece of behaviour to the program that the compiler produces.</p>

<p>A contract can have loopholes or grey areas. These are places where the wording of the contract is unclear, isn't an accurate representation of what the lawyer or their client wanted, or doesn't cover a certain scenario, which means that what happens is either up to the court, or not governed by the contract. For the lawyer, either of these scenarios is bad. A good lawyer can write you a contract with no loopholes or grey areas, but it can be very difficult, because legalese can be hard to read, the law is very complex, and some scenarios are very detailed.</p>

<p>A program can have loopholes and grey areas too: we call them "bugs". These are places where your code doesn't tell the computer what to do in a particular scenario, or it describes something that actually isn't quite what you wanted. A good programmer can write you a program with no bugs, but it's often very hard to do, because code can be hard to read, computers are very complicated, and the program might be doing a lot of very intricate things.</p>

<p>A <em>great</em> lawyer can write a contract that has no loopholes or grey areas, but is still relatively easy to read, even by someone who isn't a lawyer. This is good for the client, because they can understand their contract, but also for the law firm, because it means that any lawyer can understand the contract and make amendments without missing something subtle and introducing a loophole.</p>

<p>A <em>great</em> software engineer can write a program that has no bugs, but is still relatively uncomplex and easy to read. This is good for the client, because it means their program is easier to review and verify correct, but also for the software company, because it mean that any programmer can read the program and make alterations without missing something subtle and introducing a bug.</p>

CC BY-SA 3.0
2017-06-21T09:54:19.543Z
Welcome to CSE! This is an excellent analogy. I sure hope we will be hearing from you again soon.
ItamarG3
CC BY-SA 3.0
2017-06-21T10:32:55.003Z
And "language lawyer" is a real term! http://wiki.c2.com/?LanguageLawyer
Baldrickk
CC BY-SA 3.0
2017-06-21T14:29:13.047Z
"A good programmer can write you a program with no bugs" - Maybe, but depending on the complexity it may be impossible to determine that. I find that telling the layperson that it is possible to produce a program with no bugs is giving a flawed impression. Perhaps this would be better: "Good programmers can write you a program with few bugs." Gives a more nuanced impression about bug-checking and implies teamwork.
called2voyage
CC BY-SA 3.0
2017-06-21T14:42:53.763Z
Like I said, it can be hard to produce code with no bugs, because computers are complicated, languages are complex, and applications are varied. It *is* possible to produce a program with no bugs, but the difficulty of doing so grows exponentially with program scope and complexity. That's something you can explain alongside the analogy, but I don't think it's necessary to muddy the waters of something that is intended to illustrate the concept to laypeople with details of how difficult this job can be.
anaximander
CC BY-SA 3.0
2017-06-21T14:59:39.623Z
@anaximander Ok, let me nuance that further then. For a *good* programmer in most practical cases, producing a program with no bugs is a practical, if not theoretical, impossibility. An *outstanding* programmer in *some* cases may be able to produce guaranteed bug-free code. No, you shouldn't explain all this to the parents, but saying "Good programmers can write you a program with few bugs" is not complex and will suffice to give them a more accurate impression. See [this answer and associated comments](https://softwareengineering.stackexchange.com/a/195576/253910).
called2voyage
CC BY-SA 3.0
2017-06-21T15:08:40.403Z
@called2voyage As a professional software engineer, I'm painfully aware of that. All I'm saying is that, for the purposes of an analogy to answer the question "what is coding?", I don't think it's necessary to go into that much detail. Having used this analogy to explain my job to non-technical friends and family on several occasions, I do tend to go on to explain that the average computer program is so complex that it's nigh impossible to have zero bugs in anything beyond the truly trivial, but I'd consider that tangential to the actual answer to the question being asked here.
anaximander
CC BY-SA 3.0
2017-06-21T15:11:38.397Z
@anaximander We'll just have to agree to disagree then. From my perspective, saying "A good programmer *can*..." is a matter of possibility, and from the lay perspective it should be seen as simply *impossible*. Any discussion of possible bug-less code should be reserved for academic discourse where terms can be more clearly defined.
called2voyage
CC BY-SA 3.0
2017-06-21T23:25:08.607Z
@called2voyage A good programmer *can* write a (complex) program with no bugs.  Whether there exist any good programmers remains an open question.
Ray
CC BY-SA 3.0
2017-06-21T23:32:21.817Z
@Ray That's an overly restrictive definition of "good" for my tastes.
called2voyage
CC BY-SA 3.0
2017-06-21T09:41:03.457Z
2017-06-21T09:41:03.457Z
anaximander
<p>The best way to explain coding to someone is <em>very</em> dependent on their background.  You really need to tailor the story to fit what they understand.  That being said, they're parents so...</p>

<p>Coding is a way to give instructions to the computer, telling it what to do.  Think about the instructions you leave for a babysitter.  They tell the babysitter exactly what needs to happen while they are away.  Now, despite some appearances, the computer is not very smart.  It doesn't have good common sense.  Think of it like the first babysitter they ever hired.  Surely they wrote up a massive document with every last little tiny detail about how to take care of you, emergency contacts, emergency emergency contacts (in case the emergency contacts can't be reached), food allergies, medicine allergies, allergic reactions to allergy medications.  You name it.  They made sure every last detail was covered, so the babysitter had instructions to handle whatever may be encountered while they are away.</p>

<p>Now, computers are fast.  Really really fast.  They did a billion things while you read this sentence.  As far as this computerized babysitter is concerned, it's not like your parents are gone for a night - it's like they're gone for a month.</p>

<p>Now have them imagine the manifest they would have typed up for this brand new babysitter, babysitting you for the first time, for a month.  Imagine all of the precise instructions laid out in the best order the can manage so that the babysitter can just check off each instruction, line by line.</p>

<p>That's coding.  I have a feeling they appreciate <code>for</code> loops right about now.</p>

CC BY-SA 4.0
2020-06-11T05:42:27.077Z
For deeper example, assume that the babysitter is an alien so has no common sense.
Peter M. - stands for Monica
CC BY-SA 3.0
2017-06-21T00:03:22.150Z
2017-06-21T00:03:22.150Z
Cort Ammon
<p>My explanation would be:</p>

<p>The computer isn't some machine that can do a lot of intelligent things. Rather it is very dumb, but can execute instructions carefully, very fast and without getting bored.</p>

<p>For instance: given the task of adding up all numbers from 1 to 1 million, a human probably wouldn't make it past 100 without making some mistake and getting bored with it. A computer happily performs this task in a couple of milliseconds.</p>

<p>The job of the coder is to supply the computer with a detailed set of instructions to perform some task - this is the program or application.</p>

<p>It is not "the computer" that makes an error, usually it is the programmer that didn't forsee some combination of events and thus didn't provide instructions for that.</p>

<p>The instructions are in some computer language, of which there are many, each with it's own strengths and weaknesses.</p>

<p><strong>EDIT</strong><br>
Of course there is a formula to calculate the sum of consecutive numbers. This strengthens the point: a human might think "there has got to be a simpler way" and figure it out, a computer would never think that. It blindly continues counting (and still finishes sooner than the human with the formula).</p>

CC BY-SA 3.0
2017-06-21T10:51:57.100Z
Welcome to CSE! I like the way you've described bugs here. I hope we hear more from you in the future!
Ben I.
CC BY-SA 3.0
2017-06-21T15:14:52.720Z
Just as an aside. I wouldn't get bored of calculating the sum of 1 to 1 million.  It's 1,000,001*500,000 = 500,000,500,000
I _would_ get bored if I actually added them up.
Phil M Jones
CC BY-SA 3.0
2017-07-14T16:26:52.837Z
I recently asked my pupils to sum the numbers 1…100, I gave them 30 seconds. We then looked at how we could do it. We ended up with the formula $(n+1)\times{}n/2$ same as what @PhilMJones did.
ctrl-alt-delor
CC BY-SA 3.0
2017-06-21T08:54:09.130Z
2017-07-14T17:43:03.127Z
2017-07-14T17:43:03.127Z
Hans Keﬆing
<p>Simple: you let one of the best science teachers of all time explain it to them for you.</p>

<p><a href="https://www.youtube.com/watch?v=EKWGGDXe5MA" rel="noreferrer">Here's a video of Richard Feynman</a> introducing computers to a non-technical audience at some new-age retreat back in the 80s. Starts by explaining how computers work from the inside out, and goes on into heuristics and AI, all in his signature style of great analogies (army of filing clerks, dumber but faster).</p>

<p>As someone who had never come in touch with coding throughout my education, this lecture gave me quite a few <em>Aha!</em> moments and single-handedly encouraged me to start dabbling with programming.</p>

CC BY-SA 3.0
2017-06-22T01:56:58.130Z
Welcome to CSE! RF is, indeed, amazing. I hope we hear more from you in the future!
Ben I.
CC BY-SA 3.0
2017-06-22T01:18:48.777Z
2017-06-22T01:18:48.777Z
typo
<p>I've been a professional Software Developer for about 30 years, and a hobby programmer before that going back to the 70's. So I've been asked this a lot, and have had time to try lots of approraches. </p>

<p>The main issue is that you are talking a different universe than most everyone else's experience. In a social situation, you have one or two sentences before the eyes start to glaze over, so you can't really go into detail. So after decades of experimentation, the explanation I now give for what I do is:</p>

<blockquote>
  <p>I tell the computer what to do. It flips me off <em>(or insert
  offensive invective here to taste)</em> and merrily does something else.
  Then I spend the rest of the day trying to figure out why.</p>
</blockquote>

<p>I once gave this explanation to a room full of public school teachers, and got the rather amusing response:</p>

<blockquote>
  <p>That's the same as teaching!</p>
</blockquote>

<p>I think they are actually onto something there.</p>

<p>Note that <a href="https://en.wikipedia.org/wiki/The_Mythical_Man-Month" rel="nofollow noreferrer">Brooks' Mythical Man Month</a><sup>*</sup> devotes the last half of its first chapter to roughly this question (the sections titled <a href="http://home.adelphi.edu/sbloch/class/adages/joy.html" rel="nofollow noreferrer"><em>The Joys of the Craft</em> and <em>The Woes of the Craft</em></a>). I think what I wrote above is actually about the best possible tl;dr of Brooks' text. But if someone is really interested in reading 18 paragraphs about it, send them the link above.</p>

<p><sup>* - Generally considered The Bible of Software Engineering. As Brooks himself quipped, this is because "everybody quotes it, some people read it, and a few people go by it".</sup></p>

CC BY-SA 3.0
2017-06-21T12:45:14.100Z
That's a cute joke. Welcome to CSE!
Ben I.
CC BY-SA 3.0
2017-06-21T13:26:13.223Z
@BenI. - Thank you. Expanded it to make it more of a proper answer though (perhaps removing a bit of the punch. Sorry.)
T.E.D.
CC BY-SA 4.0
2019-11-29T03:31:52.653Z
Thank you for a hard laugh!
Bennett Brown
CC BY-SA 3.0
2017-06-21T12:36:17.183Z
2017-06-21T13:48:27.607Z
2017-06-21T13:48:27.607Z
T.E.D.
<p>Well, I would personally suggest you to show them the first lecture of <a href="https://www.edx.org/course/introduction-computer-science-harvardx-cs50x" rel="nofollow noreferrer">Harvard CS50</a> class and believe me they will not leave it without completing all of them. It is one of the best structured course for any student (well in this case you can call your parents as students :p) irrespective of the background of the person. </p>

<p>They have an interactive environment called as <a href="https://scratch.mit.edu/" rel="nofollow noreferrer">Scratch</a> in which you can design new interesting projects. Have a look at some featured projects, they are very good!</p>

CC BY-SA 3.0
2017-06-20T14:40:46.783Z
I don't think his parents want to learn *how* to code, but rather how to coding and programming languages work.
ItamarG3
CC BY-SA 3.0
2017-06-20T15:01:29.330Z
If they're willing to sit through that first lesson (and if they understand English well enough), they will certainly come out with a pretty good idea of what coding is. David Malan is absolutely electrifying!
Ben I.
CC BY-SA 3.0
2017-06-21T00:51:03.163Z
This is close to a link-only answer, which is frowned upon on Stack Exchange sites. Could you summarize what is discussed in the CS50 lecture, and what makes it compelling?
200_success
CC BY-SA 3.0
2017-06-20T14:39:51.253Z
2017-06-20T15:52:47.387Z
2017-06-20T15:52:47.387Z
Skand Vishwanath Peri
<blockquote>
  <p>"What is coding ?"</p>
</blockquote>

<p>A set of instructions written in human readable language (at least to developers) that is executed to perform a task or goal.</p>

<blockquote>
  <p>"what a programming language is"</p>
</blockquote>

<p>High level: Just like any language that exists in the world today, it has it's own alphabet, syntax and grammar that is for communication.</p>

<p>Technical: First off I just want to note that some languages are interpreted while some are compiled, as for their differences I believe it's off-topic. The idea is that your "code" is tokenized based on the language's alphabet and syntax and formatted into a parsing tree. The parsing tree is then translated into some intermediate code. Lastly the compiler translates the intermediate code into source code or machine code that can be executed by the CPU.</p>

<blockquote>
  <p>"how it is used"</p>
</blockquote>

<p>Since programming languages are made for humans to easily learn and write in, it is like writing a book. We choose alphabets of the language and write meaningful segments that perform tasks whether it is to loop over an array or read some files. </p>

CC BY-SA 3.0
2017-06-20T14:59:57.013Z
2017-06-20T14:59:57.013Z
Kaneki
<p>In addition to the excellent definitions already provided, consider taking a slightly different approach or at least augmenting it a bit. This comes back to good pedagogy: I wouldn't give students definitions without context. Moreover, I would support whatever concept I want to get across, no matter how broad or narrow, with <strong>specific examples and implementations</strong>. </p>

<p>To explain programming to someone who has no idea what it means, it is necessary to have short blocks of code at the ready. Explaining it in the abstract probably won't be too successful. Relatively straightforward ideas like printing "hello, world" or the even numbers from 1-100 or the sum of the integers 1-50 would show the bare minimum of logical and computational ability. Maybe even something relatively intuitive like bubble sort or linear search. From there, compiling the program - assuming a language like C or Java - would at least allow you to explain the notion of <strong>translation</strong>. </p>

<p>I like to use the metaphor that computers "speak" binary, but I speak C (or Python or Java or...). I need to translate what I want to accomplish into the language that the computer can understand. You can explain compilers/interpreters as a kind of translator that understands both computer-speak and human-speak and knows how to take your thoughts and turn them into "words" that the computer can understand. (You can optionally include the idea of assembly and instruction sets, but again, that's probably beyond the scope of this conversation.)</p>

CC BY-SA 3.0
2017-06-20T21:57:36.533Z
2017-06-20T21:57:36.533Z
Peter
<p>I think I would explain it like this:</p>

<blockquote>
  <p>What is a programming language?</p>
</blockquote>

<p>I'd say, it is a <strong>set of instructions</strong><sup>1</sup> (a "language", the words are the operators, sentences are expressions and so on) to <strong>tell a computer what it should do</strong>. There are instructions to do basic arithmetic or calculations, instructions you can use to interact with the user, and instructions that can control the program's flow, for example by repeating other instructions or branching, so it does different things when confronted with different inputs.</p>

<blockquote>
  <p>How is it used to make computations?</p>
</blockquote>

<p>As with the human languages, there are multiple programming languages. To develop in a certain language you usually <strong>write (text) files containing the instructions</strong> (you could now mention how this looks in a programming language you like). These text files are read and executed by the computer. Depending on whether the language is low- or high-level, the computer might need additional software (the interpreter) to understand the language.</p>

<p>Often, developers use so called <strong>IDEs</strong> which make development easier as they offer hepful features (for example, automatically creating instruction(s) you normally use a lot or immediately pointing out errors).</p>

<blockquote>
  <p>What is coding?</p>
</blockquote>

<p>This is just the process of <strong>making a program</strong>. The combined instructions that eventually make up your program are often called "<strong>code</strong>" by developers, so they use the verb "(to) code" to describe the process of writing down instructions to solve a particular task.</p>

<p><sup>1</sup> As <a href="https://cseducators.stackexchange.com/users/1151/brian-h">Brian H.</a> pointed out in <a href="https://cseducators.stackexchange.com/posts/comments/1474">his comment</a>, a more precise definition of a programming language would be "a set of syntactical and grammatical rules bundeled with a <a href="https://en.wikipedia.org/wiki/Standard_library" rel="nofollow noreferrer">standard library</a> that provides instructions to tell the computer what to do". However, as you asked for an explanation in layman's terms, I wouldn't recommend this definition to explain what a programming language is.</p>

CC BY-SA 3.0
2017-06-21T14:26:24.957Z
i don't agree with: `What is a programming language?`: `it is a set of instructions`. The set of instructions is called a program, and the language is a set of syntactical and grammatical rules to make sure the computer understands these instructions.
Brian H.
CC BY-SA 3.0
2017-06-21T14:53:11.360Z
@BrianH I'd agree that a program is a set of instructions. However, I do think the language is also a set of instructions as it defines them - I could only think of moving the instructions to the construct of the "standard library": "A language is a set of syntactical and grammatical rules combined with a standard library that provides several instructions that can be used following in a program". Would this be better in your eyes?
TuringTux
CC BY-SA 3.0
2017-06-21T14:57:52.707Z
Sounds about right i think.
Brian H.
CC BY-SA 3.0
2017-06-21T17:51:14.323Z
@BrianH. I've edited this into my answer as a footnote, I hope you're okay with it :)
TuringTux
CC BY-SA 3.0
2017-06-20T17:38:06.217Z
2017-06-26T06:54:58.783Z
2017-06-26T06:54:58.783Z
TuringTux
<p>I am an engineering student in computer science and recently my parents asked me to explain a bit what I do, which is their way of asking <strong>"What is coding?"</strong>.</p>

<p>They have no idea of what coding is, what languages are, lines of codes etc, and I wanted to explain briefly how it all works. I wanted to explain <strong>what a programming language is</strong> and <strong>how it is used</strong> to write algorithms, make computations... To me it seems very logical that the interpreter reads lines of code from top to bottom, understanding the statements of a particular language.</p>

<p>I can't find the right words and nice examples to help them understand globally how it works.</p>

<p>How can I explain this idea to them?</p>

CC BY-SA 3.0
2017-06-20T14:01:24.723Z
Do you just need to explain what is coding, or a little more in depth? The answer to the first is easy -- it's giving instructions to a computer, step by step.
Scimonster
CC BY-SA 3.0
2017-06-20T14:36:29.300Z
This question is being discussed [on meta](https://cseducators.meta.stackexchange.com/questions/138/site-scope-refinement-3).
Aurora0001
CC BY-SA 3.0
2017-06-20T14:36:41.753Z
@Shashimee - I tried to edit your prompt while leaving the question intact. I removed the bit about Python because it didn't seem related, but I may have misunderstood what you were going for. Feel free to roll back or edit again.
Ben I.
CC BY-SA 3.0
2017-06-20T17:33:33.987Z
Thanks for the question. Could you provide your parents' background? Not all parents are ignorant of computer science.  http://dilbert.com/strip/1998-07-15
Ellen Spertus
CC BY-SA 3.0
2017-06-21T06:56:48.250Z
@EllenSpertus They basically just know how to use a browser to check their mails, read forums and do basic researchs.
Shashimee
CC BY-SA 3.0
2017-06-21T10:18:53.750Z
I feel this is too broad. HTML is code, assembler is also code. Code is just that, a formal language that expresses *something*. If I were an average  C++ programmer, I would describe my job to my grandmother as such: *"I write computer programs, that is, I use a specialized formal language - akin, in this respect, to the language of mathematics - to express the behavior I want the machine to exhibit. My understanding of what the correct behaviour should be must be sound in order for this to work."* It's all kinds of wrong, technically, but I feel it conveys the idea.
Tobia Tesan
CC BY-SA 3.0
2017-06-21T20:50:22.463Z
*Unfortunately, no one can be told what the Matrix is*, @Aurora0001, is this you?
Ghanima
CC BY-SA 3.0
2017-06-21T22:03:32.293Z
I wonder... The oldest computers I know of might be the player pianos...
Malady
CC BY-SA 3.0
2017-06-22T03:53:54.390Z
It's not that hard to explain. *public static void main()*, \*ahem\*. *Lorem ipsum dolor sit amet, consectetur adipiscing elit...*
user541686
CC BY-SA 3.0
2017-06-22T04:33:02.423Z
"Ones and zeroes"
ave
<layperson>
How to explain what code is to my parents?
# How to explain what code is to my parents?

(Asked by: username_0 on 2017-06-20)

I am an engineering student in computer science and recently my parents asked me to explain a bit what I do, which is their way of asking **"What is coding?"**.

They husername_9 no idea of what coding is, what languages are, lines of codes etc, and I wanted to explain briefly how it all works. I wanted to explain **what a programming language is** and **how it is used** to write algorithms, make computations... To me it seems very logical that the interpreter reads lines of code from top to bottom, understanding the statements of a particular language.

I can't find the right words and nice examples to help them understand globally how it works.

How can I explain this idea to them?

**Tags:** layperson

> **Comments:**
> **username_1**: Do you just need to explain what is coding, or a little more in depth? The answer to the first is easy -- it's giving instructions to a computer, step by step.  
> **username_2**: This question is being discussed [on meta](https://cseducators.meta.stackexchange.com/questions/138/site-scope-refinement-3).  
> **username_3**: @username_0 - I tried to edit your prompt while leaving the question intact. I removed the bit about Python because it didn't seem related, but I may husername_9 misunderstood what you were going for. Feel free to roll back or edit again.  
> **username_4**: Thanks for the question. Could you provide your parents' background? Not all parents are ignorant of computer science.  http://dilbert.com/strip/1998-07-15  
> **username_0**: @EllenSpertus They basically just know how to use a browser to check their mails, read forums and do basic researchs.  
> **username_5**: I feel this is too broad. HTML is code, assembler is also code. Code is just that, a formal language that expresses *something*. If I were an username_9rage  C++ programmer, I would describe my job to my grandmother as such: *"I write computer programs, that is, I use a specialized formal language - akin, in this respect, to the language of mathematics - to express the behavior I want the machine to exhibit. My understanding of what the correct behaviour should be must be sound in order for this to work."* It's all kinds of wrong, technically, but I feel it conveys the idea.  
> **username_6**: *Unfortunately, no one can be told what the Matrix is*, @username_2, is this you?  
> **username_7**: I wonder... The oldest computers I know of might be the player pianos...  
> **username_8**: It's not that hard to explain. *public static void main()*, \*ahem\*. *Lorem ipsum dolor sit amet, consectetur adipiscing elit...*  
> **username_9**: "Ones and zeroes"  

---

## 18 answers

### Answer by username_19 on 2017-06-20. Score: 44 | Accepted answer

Coding is like writing a recipe for the computer to follow so that it solves your problem. The computer "reads" each step, and follows it, eventually reaching a solution. Some programs are better than others, just like some recipes are better than others - they are faster, they produce a better result, etc. Programmers aren't really the cooks, though - the computer itself produces the result. The programmers are more like the cookbook authors, producing the recipes (programs) for the computer to follow.

Now, I don't know about you, but I've followed a recipe before, and there husername_9 been times where I've been left wondering, "Husername_9 I put in 2 or 3 cups of flour?" or having mixed in an extra couple of chocolate chips (quite by accident, of course). A computer doesn't husername_9 these problems. It can make your "recipe" much more swiftly and accurately than you can. However, this gives you no excuse for providing the wrong recipe. No amount of accuracy will make brussels sprouts into ice cream, unfortunately.

Lastly, [@username_21](https://cseducators.stackexchange.com/questions/868/how-to-explain-what-code-is-to-my-parents#comment1503_891) brings up a great point. No analogy is perfect, and this one is no *exception* (heheh). Whereas, in a recipe, you really try hard not to vary the input so as not to vary the output, most programs take different kinds of input and produce different kinds of output, according to the same rule. Sort of like you can put a bunch of different cookies in the oven to bake them - not the same input, not the same output, but a fairly similar process inbetween.

> **Comments:**
> **username_3**: Very nice analogy.  "The programmers are more like the cookbook" :)  
> **username_0**: Nice indeed ! Very simple, yet accurate. Maybe adding a simple real example of code (like do the sum of the first 100 integers as @username_33 suggested) would make them understand better.  
> **username_20**: I think it also helps to explain that computers do very simple things, but do them extremely quickly, and very reliably. Kind of like how a production line can build a car in lots of steps.  
> **username_21**: I think it would be worth explaining that programs differ from recipes in that the result is not always the same.  You expect (hope) a recipe to yield the same thing each time.  The program will react different to different inputs, similar to a math equation.  
> **username_22**: Knitting recipies may be an even better analogy.  The result is much more well-defined even though you husername_9 different sizes.  Also they _resemble_ code.  
> **username_23**: I very often use the 'recipe' analogy, so 1+ for that. But for a real-world demo, show them Robo Rally ([board game](https://boardgamegeek.com/boardgame/18/roborally)), or Chip Wits (brilliant ancient Mac game, [modern remake](http://www.chipwits.com/)), or Lego [Mindstorms](https://en.wikipedia.org/wiki/Lego_Mindstorms).  
> **username_24**: The recipe and cookbook analogies are such great ways to deliver the idea of coding to people who don't know much code, that Chef ruby is based around them: https://docs.chef.io/ruby.html These ideas husername_9 proven to sell - they're worth a lot in term of business impact (and money, of course).  
> **username_25**: You'll also husername_9 to convince your parents that computers are dumb machines which *husername_9* to be told what to do. A lot of people will think of computers in terms of the function they provide.  
> **username_26**: I like and use the recipe analogy a lot, but I usually add the cusername_9at that a program is a recipe written for an entity that cannot think for itself.  A standard recipe will just say something like "add 2 cups of flour".  However, there's a lot of assumed knowledge there that a computer program has to include explicitly.  Where does the flour come from?  What should be used to bring it over to the bowl?  What if there's not enough?  What if it spills?  
> **username_27**: "A computer is just a very fast electronic idiot"  

---

### Answer by username_33 on 2017-06-21. Score: 16

The best way to explain coding to someone is *very* dependent on their background. You really need to tailor the story to fit what they understand. That being said, they're parents so...

Coding is a way to give instructions to the computer, telling it what to do. Think about the instructions you leusername_9 for a babysitter. They tell the babysitter exactly what needs to happen while they are away. Now, despite some appearances, the computer is not very smart. It doesn't husername_9 good common sense. Think of it like the first babysitter they ever hired. Surely they wrote up a massive document with every last little tiny detail about how to take care of you, emergency contacts, emergency emergency contacts (in case the emergency contacts can't be reached), food allergies, medicine allergies, allergic reactions to allergy medications. You name it. They made sure every last detail was covered, so the babysitter had instructions to handle whatever may be encountered while they are away.

Now, computers are fast. Really really fast. They did a billion things while you read this sentence. As far as this computerized babysitter is concerned, it's not like your parents are gone for a night - it's like they're gone for a month.

Now husername_9 them imagine the manifest they would husername_9 typed up for this brand new babysitter, babysitting you for the first time, for a month. Imagine all of the precise instructions laid out in the best order the can manage so that the babysitter can just check off each instruction, line by line.

That's coding. I husername_9 a feeling they appreciate `for` loops right about now.

> **Comments:**
> **username_34**: For deeper example, assume that the babysitter is an alien so has no common sense.  

---

### Answer by username_28 on 2017-06-21. Score: 11

I tend to describe code as a contract. Most people know that if you read a contract, it's not in English - it's in "legalese". Legalese is a language that looks mostly like English, but it's full of odd phrases and very specific wording, and the punctuation is different. Contracts are written this way because each phrase has been interpreted by a court to mean something very specific, and so contracts will use the same precise wording so that they will be interpreted by a court in the way the lawyer wants.

Programming languages often look kind of like English too; they use English words, but husername_9 different structures and punctuation. This is because a compiler is like a court: it will interpret these specific phrases in a specific way, and each phrase will add a certain piece of behaviour to the program that the compiler produces.

A contract can husername_9 loopholes or grey areas. These are places where the wording of the contract is unclear, isn't an accurate representation of what the lawyer or their client wanted, or doesn't cover a certain scenario, which means that what happens is either up to the court, or not governed by the contract. For the lawyer, either of these scenarios is bad. A good lawyer can write you a contract with no loopholes or grey areas, but it can be very difficult, because legalese can be hard to read, the law is very complex, and some scenarios are very detailed.

A program can husername_9 loopholes and grey areas too: we call them "bugs". These are places where your code doesn't tell the computer what to do in a particular scenario, or it describes something that actually isn't quite what you wanted. A good programmer can write you a program with no bugs, but it's often very hard to do, because code can be hard to read, computers are very complicated, and the program might be doing a lot of very intricate things.

A *great* lawyer can write a contract that has no loopholes or grey areas, but is still relatively easy to read, even by someone who isn't a lawyer. This is good for the client, because they can understand their contract, but also for the law firm, because it means that any lawyer can understand the contract and make amendments without missing something subtle and introducing a loophole.

A *great* software engineer can write a program that has no bugs, but is still relatively uncomplex and easy to read. This is good for the client, because it means their program is easier to review and verify correct, but also for the software company, because it mean that any programmer can read the program and make alterations without missing something subtle and introducing a bug.

> **Comments:**
> **username_29**: Welcome to CSE! This is an excellent analogy. I sure hope we will be hearing from you again soon.  
> **username_30**: And "language lawyer" is a real term! http://wiki.c2.com/?LanguageLawyer  
> **username_31**: "A good programmer can write you a program with no bugs" - Maybe, but depending on the complexity it may be impossible to determine that. I find that telling the layperson that it is possible to produce a program with no bugs is giving a flawed impression. Perhaps this would be better: "Good programmers can write you a program with few bugs." Gives a more nuanced impression about bug-checking and implies teamwork.  
> **username_28**: Like I said, it can be hard to produce code with no bugs, because computers are complicated, languages are complex, and applications are varied. It *is* possible to produce a program with no bugs, but the difficulty of doing so grows exponentially with program scope and complexity. That's something you can explain alongside the analogy, but I don't think it's necessary to muddy the waters of something that is intended to illustrate the concept to laypeople with details of how difficult this job can be.  
> **username_31**: @username_28 Ok, let me nuance that further then. For a *good* programmer in most practical cases, producing a program with no bugs is a practical, if not theoretical, impossibility. An *outstanding* programmer in *some* cases may be able to produce guaranteed bug-free code. No, you shouldn't explain all this to the parents, but saying "Good programmers can write you a program with few bugs" is not complex and will suffice to give them a more accurate impression. See [this answer and associated comments](https://softwareengineering.stackexchange.com/a/195576/253910).  
> **username_28**: @username_31 As a professional software engineer, I'm painfully aware of that. All I'm saying is that, for the purposes of an analogy to answer the question "what is coding?", I don't think it's necessary to go into that much detail. Having used this analogy to explain my job to non-technical friends and family on several occasions, I do tend to go on to explain that the username_9rage computer program is so complex that it's nigh impossible to husername_9 zero bugs in anything beyond the truly trivial, but I'd consider that tangential to the actual answer to the question being asked here.  
> **username_31**: @username_28 We'll just husername_9 to agree to disagree then. From my perspective, saying "A good programmer *can*..." is a matter of possibility, and from the lay perspective it should be seen as simply *impossible*. Any discussion of possible bug-less code should be reserved for academic discourse where terms can be more clearly defined.  
> **username_32**: @username_31 A good programmer *can* write a (complex) program with no bugs.  Whether there exist any good programmers remains an open question.  
> **username_31**: @username_32 That's an overly restrictive definition of "good" for my tastes.  

---

### Answer by username_35 on 2017-06-21. Score: 7

My explanation would be:

The computer isn't some machine that can do a lot of intelligent things. Rather it is very dumb, but can execute instructions carefully, very fast and without getting bored.

For instance: given the task of adding up all numbers from 1 to 1 million, a human probably wouldn't make it past 100 without making some mistake and getting bored with it. A computer happily performs this task in a couple of milliseconds.

The job of the coder is to supply the computer with a detailed set of instructions to perform some task - this is the program or application.

It is not "the computer" that makes an error, usually it is the programmer that didn't forsee some combination of events and thus didn't provide instructions for that.

The instructions are in some computer language, of which there are many, each with it's own strengths and weaknesses.

**EDIT**  
Of course there is a formula to calculate the sum of consecutive numbers. This strengthens the point: a human might think "there has got to be a simpler way" and figure it out, a computer would never think that. It blindly continues counting (and still finishes sooner than the human with the formula).

> **Comments:**
> **username_3**: Welcome to CSE! I like the way you've described bugs here. I hope we hear more from you in the future!  
> **username_36**: Just as an aside. I wouldn't get bored of calculating the sum of 1 to 1 million.  It's 1,000,001*500,000 = 500,000,500,000 I _would_ get bored if I actually added them up.  
> **username_13**: I recently asked my pupils to sum the numbers 1…100, I gusername_9 them 30 seconds. We then looked at how we could do it. We ended up with the formula $(n+1)\times{}n/2$ same as what @PhilMJones did.  

---

### Answer by username_37 on 2017-06-22. Score: 6

Simple: you let one of the best science teachers of all time explain it to them for you.

[Here's a video of Richard Feynman](https://www.youtube.com/watch?v=EKWGGDXe5MA) introducing computers to a non-technical audience at some new-age retreat back in the 80s. Starts by explaining how computers work from the inside out, and goes on into heuristics and AI, all in his signature style of great analogies (army of filing clerks, dumber but faster).

As someone who had never come in touch with coding throughout my education, this lecture gusername_9 me quite a few *Aha!* moments and single-handedly encouraged me to start dabbling with programming.

> **Comments:**
> **username_3**: Welcome to CSE! RF is, indeed, amazing. I hope we hear more from you in the future!  

---

### Answer by username_38 on 2017-06-21. Score: 4

I've been a professional Software Developer for about 30 years, and a hobby programmer before that going back to the 70's. So I've been asked this a lot, and husername_9 had time to try lots of approraches.

The main issue is that you are talking a different universe than most everyone else's experience. In a social situation, you husername_9 one or two sentences before the eyes start to glaze over, so you can't really go into detail. So after decades of experimentation, the explanation I now give for what I do is:

> I tell the computer what to do. It flips me off *(or insert
> offensive invective here to taste)* and merrily does something else.
> Then I spend the rest of the day trying to figure out why.

I once gusername_9 this explanation to a room full of public school teachers, and got the rather amusing response:

> That's the same as teaching!

I think they are actually onto something there.

Note that [Brooks' Mythical Man Month](https://en.wikipedia.org/wiki/The_Mythical_Man-Month)\* devotes the last half of its first chapter to roughly this question (the sections titled [*The Joys of the Craft* and *The Woes of the Craft*](http://home.adelphi.edu/sbloch/class/adages/joy.html)). I think what I wrote above is actually about the best possible tl;dr of Brooks' text. But if someone is really interested in reading 18 paragraphs about it, send them the link above.

\* - Generally considered The Bible of Software Engineering. As Brooks himself quipped, this is because "everybody quotes it, some people read it, and a few people go by it".

> **Comments:**
> **username_3**: That's a cute joke. Welcome to CSE!  
> **username_38**: @BenI. - Thank you. Expanded it to make it more of a proper answer though (perhaps removing a bit of the punch. Sorry.)  
> **username_39**: Thank you for a hard laugh!  

---

### Answer by username_40 on 2017-06-20. Score: 4

Well, I would personally suggest you to show them the first lecture of [Harvard CS50](https://www.edx.org/course/introduction-computer-science-harvardx-cs50x) class and believe me they will not leusername_9 it without completing all of them. It is one of the best structured course for any student (well in this case you can call your parents as students :p) irrespective of the background of the person.

They husername_9 an interactive environment called as [Scratch](https://scratch.mit.edu/) in which you can design new interesting projects. Husername_9 a look at some featured projects, they are very good!

> **Comments:**
> **username_29**: I don't think his parents want to learn *how* to code, but rather how to coding and programming languages work.  
> **username_3**: If they're willing to sit through that first lesson (and if they understand English well enough), they will certainly come out with a pretty good idea of what coding is. David Malan is absolutely electrifying!  
> **username_41**: This is close to a link-only answer, which is frowned upon on Stack Exchange sites. Could you summarize what is discussed in the CS50 lecture, and what makes it compelling?  

---

### Answer by username_42 on 2017-06-20. Score: 4

> "What is coding ?"

A set of instructions written in human readable language (at least to developers) that is executed to perform a task or goal.

> "what a programming language is"

High level: Just like any language that exists in the world today, it has it's own alphabet, syntax and grammar that is for communication.

Technical: First off I just want to note that some languages are interpreted while some are compiled, as for their differences I believe it's off-topic. The idea is that your "code" is tokenized based on the language's alphabet and syntax and formatted into a parsing tree. The parsing tree is then translated into some intermediate code. Lastly the compiler translates the intermediate code into source code or machine code that can be executed by the CPU.

> "how it is used"

Since programming languages are made for humans to easily learn and write in, it is like writing a book. We choose alphabets of the language and write meaningful segments that perform tasks whether it is to loop over an array or read some files.


---

### Answer by username_43 on 2017-06-20. Score: 3

In addition to the excellent definitions already provided, consider taking a slightly different approach or at least augmenting it a bit. This comes back to good pedagogy: I wouldn't give students definitions without context. Moreover, I would support whatever concept I want to get across, no matter how broad or narrow, with **specific examples and implementations**.

To explain programming to someone who has no idea what it means, it is necessary to husername_9 short blocks of code at the ready. Explaining it in the abstract probably won't be too successful. Relatively straightforward ideas like printing "hello, world" or the even numbers from 1-100 or the sum of the integers 1-50 would show the bare minimum of logical and computational ability. Maybe even something relatively intuitive like bubble sort or linear search. From there, compiling the program - assuming a language like C or Java - would at least allow you to explain the notion of **translation**.

I like to use the metaphor that computers "speak" binary, but I speak C (or Python or Java or...). I need to translate what I want to accomplish into the language that the computer can understand. You can explain compilers/interpreters as a kind of translator that understands both computer-speak and human-speak and knows how to take your thoughts and turn them into "words" that the computer can understand. (You can optionally include the idea of assembly and instruction sets, but again, that's probably beyond the scope of this conversation.)


---

### Answer by username_44 on 2017-06-20. Score: 3

I think I would explain it like this:

> What is a programming language?

I'd say, it is a **set of instructions**1 (a "language", the words are the operators, sentences are expressions and so on) to **tell a computer what it should do**. There are instructions to do basic arithmetic or calculations, instructions you can use to interact with the user, and instructions that can control the program's flow, for example by repeating other instructions or branching, so it does different things when confronted with different inputs.

> How is it used to make computations?

As with the human languages, there are multiple programming languages. To develop in a certain language you usually **write (text) files containing the instructions** (you could now mention how this looks in a programming language you like). These text files are read and executed by the computer. Depending on whether the language is low- or high-level, the computer might need additional software (the interpreter) to understand the language.

Often, developers use so called **IDEs** which make development easier as they offer hepful features (for example, automatically creating instruction(s) you normally use a lot or immediately pointing out errors).

> What is coding?

This is just the process of **making a program**. The combined instructions that eventually make up your program are often called "**code**" by developers, so they use the verb "(to) code" to describe the process of writing down instructions to solve a particular task.

1 As [username_45](https://cseducators.stackexchange.com/users/1151/brian-h) pointed out in [his comment](https://cseducators.stackexchange.com/posts/comments/1474), a more precise definition of a programming language would be "a set of syntactical and grammatical rules bundeled with a [standard library](https://en.wikipedia.org/wiki/Standard_library) that provides instructions to tell the computer what to do". However, as you asked for an explanation in layman's terms, I wouldn't recommend this definition to explain what a programming language is.

> **Comments:**
> **username_45**: i don't agree with: `What is a programming language?`: `it is a set of instructions`. The set of instructions is called a program, and the language is a set of syntactical and grammatical rules to make sure the computer understands these instructions.  
> **username_44**: @BrianH I'd agree that a program is a set of instructions. However, I do think the language is also a set of instructions as it defines them - I could only think of moving the instructions to the construct of the "standard library": "A language is a set of syntactical and grammatical rules combined with a standard library that provides several instructions that can be used following in a program". Would this be better in your eyes?  
> **username_45**: Sounds about right i think.  
> **username_44**: @BrianH. I've edited this into my answer as a footnote, I hope you're okay with it :)  

---

### Answer by username_10 on 2017-06-21. Score: 2

A programmer writes the instructions for a computer to do its job. A program is a set of instructions for it to follow to accomplish or aid in performing a task. Sometimes the instructions can be rather abstract things like skipping certain instructions or doing others over and over. The programmer assembles instructions into smaller groups that accomplish a part of the task, called a subroutine (or function, method, etc). These are used as building blocks from which they construct the larger program.

Or, in one sentence: If computers are magic then coding is writing the spells.

> **Comments:**
> **username_3**: Welcome to CSE! I hope we hear more from you in the future.  
> **username_11**: No no, computers *are* magic. I should know, I'm an actual professional *friggin' wizard.* I got into [illusion magic](https://www.microsoft.com/en-us/hololens) recently, too. (In all seriousness, this comment is being serious).  

---

### Answer by username_12 on 2017-06-22. Score: 1

Coding is like writing an instruction or assembly manual for a product. Tell your parents its like them writing a manual for assembling something like a bicycle.

> **Comments:**
> **username_3**: Welcome to CSE! This answer is a little short on details, would you mind fleshing it out a little? Otherwise, it's a pretty nice analogy. I hope we hear more from you in the future.  

---

### Answer by username_16 on 2017-06-21. Score: 1

Code is like the rules of a game.

For instance *Hangman*. Explaining how the game works step by step is almost writing a computerprogram in pseudocode.

1 - Player 1 randomly picks a word out of a list.

2 - He writes down a number of dashes corresponding to the number of letters in the word.

3 - He askes player 2 to guess a letter.

4 - Does the letter occur in the word or not?

5 - Etc.

The purpose is not to really write the program, although 'we programmers' can probably picture it by now, certainly the part where the the computer is the one thinking of a word for the other player to guess.

> **Comments:**
> **username_16**: P.S. I am not great at computer science, but i am an educator! My answer is a 'lesson one' intended for a layperson.  

---

### Answer by username_17 on 2017-06-21. Score: 1

I'm a programmer and when people ask me to explain what I do, I usually say that computers talk in bits, right? Zeros and ones. And it's hard for a human to understand that, so there are this tools called programming languages that are able to translate a more human-like text into zeros and ones.
The problem is that programming languages husername_9 lots of rules and each programming languages has it's own structure and rules (just like normal languages!) our job as programmers is to know this rules and play with them in order to get what I want.
Example time!
Let's say that we choose as our tool the Python programming language (not to be confused with the snake)
And our goal is to print 10 times on the screen "Hi"
We as smart programmers know that in python if we say:
print("Hi")

It will show "Hi" on the screen, but it doesn't solve our problem, right? We want to see it 10 times in the screen, so we as VERY smart programmers tell python:
print("Hi")
print("Hi")
print("Hi")
print("Hi")
print("Hi")
print("Hi")
print("Hi")
print("Hi")
print("Hi")
print("Hi")

And our goal is accomplished!
But it's quite tiring to copy and paste that much code, so we as super programmers we know python's syntax and rules so we do:
for x in range(1, 10):
    print("Hi")

And super saiyan programmers will do:
print("Hi\n" * 10)

TLDR:
Programmers are human beings trying to talk to computers through very strict and sometimes mean translators. But it's fun though!

> **Comments:**
> **username_17**: Btw, I know in my answer I'm mixing a lot of concepts, but it was on the hope of not overcomplicating my answer  

---

### Answer by username_18 on 2017-06-21. Score: 1

Here is a fun, interactive, and impressively comprehensive-yet-easily-digestible article that covers all the basics of programming/CS for laypersons. It even explains many of the professional aspects of what a being employed as a programmer entails beyond just the theoretical and technical aspects. It's where I usually send people with a similarly un-technical background who display a curiosity about programming.

<https://www.bloomberg.com/graphics/2015-paul-ford-what-is-code/>

> **Comments:**
> **username_3**: Nice article. Welcome to CSE! I hope we hear more from you in the future.  

---

### Answer by username_13 on 2017-07-14. Score: 0

When people asked me what I did, when I was a programmer/software engineer. I would tell them one of these.

* I am an author.
* I write instruction manuals for computers. No not manuals on how to use computers, manuals **for** computers: The computers read the manuals, so that they know what to do.
* I write poetry for computers.
* I teach computers, how to be medical pumps. (My last job was programming medical pumps).
* I am a wizard, I recite magic spells at computers, and they do what I want.


---

### Answer by username_14 on 2017-06-21. Score: 0

Tell them that you are making a computer work as per instructions, and the instructions we give are a sets of rules(syntax) with which one is able to produce many logical structures. Then explain that an engineer like you tries to think about the best possible logic to instruct the computer to do a specific task (such as "printing multiplication tables from 1 to 100 in a few seconds").

> **Comments:**
> **username_3**: Welcome to CSE!!  

---

### Answer by username_15 on 2017-06-21. Score: 0

Coding/Programming is interacting with a computer or device with a language the computer can translate and actually use, because computers and other devices don't understand human languages.

Sometimes those interactions are things like asking questions, or taking notes to keep track of things, or looking up old information wherever you put it.

Programs are big collections of those designed interactions to achieve a specific goal, like, make a spreadsheet, send an email, or draw an object in three dimensions on the screen -- stuff like that.

Programming languages are just languages that humans code with so computers know how to translate and use their designed interactions. Those languages are usually a mix of human words and symbols to help with the creation of those instructions for those interactions.

The computer/device only cares about the instructions, not the language used to make those instructions, so it takes those translated, coded interactions as instructions for a language that the computer knows how to use that we humans can't really read without help of a translator.

**Coders/Programmers are basically the middle-men to help with communication and action between machines and humans.**


---

