"Code" is a four letter word


"Source code"

"Bedroom coder"

"Can someone explain why this code isn’t working?"

"He’s such a natural, he thinks directly in code"

These are dirty, dirty phrases…

code (kohd) noun
A system used for brevity or secrecy of communication, in which arbitrarily chosen words, letters, or symbols are assigned definite meanings.
http://dictionary.reference.com/browse/code

Yet all the best programmers I know strive to make their programs as clear, consistent, elegant, and easily readable as possible.

Ironic that we refer to the fruit of our labors using a term that generally means the exact opposite of how we hope this fruit will turn out!


Comments (25)

  1. Davis says:

    I have never really though of that.

    That is funny!

  2. David Black says:

    A good coder always blames his tools. ack C++/CLI (despite the fact it gets the job done:-).

  3. Jeff says:

    You might say the same thing about something cryptic to you.  For instance, when some programmers look at assembly, they may think the same thing, yet it is just code as well.  It makes sense because we have trained our brains to understand it, yet to someone who has not, it looks like gibberish on the screen.  Just think about the first time you saw assembly, or C++ or C#… well before you knew how to write software.

    If you look at the definition for brevity "Concise and exact use of words in writing or speech", the above definition for code actually makes perfect sense.  We can leave out the "or secrecy of communication" from the definition because it really doesn't apply.  You are left with "A system used for concise and exact use of words in writing or speech, in which arbitrarily chosen words, letters, or symbols are assigned definite meanings."  We use concise and exact keywords and symbols that are arbitrarily chosen to define meaning.

  4. Remi Gillig says:

    Actually, doesn't the term come from how the compilers understand it rather how humans write it? What I mean is that compilers (usually) tell you that they don't understand the code you have written for them to parse.

  5. ShawnHargreaves says:

    > You might say the same thing about something cryptic to you.  For instance, when some programmers look at assembly, they may think the same thing, yet it is just code as well.

    I'd call that 'language' rather than 'code'.

    I don't speak Russian, so anything written in Russian makes no sense to me, but that doesn't make it code. It's just a language that I don't happen to speak.

    'code' implies a deliberate encoding (pun intentional!) which sacrifices clarity for the purpose of secrecy or brevity.  Good programming languages, like good use of spoken languages, should be the exact opposite of that!

  6. David Black says:

    > 'code' implies a deliberate encoding (pun intentional!) which sacrifices clarity for the purpose of secrecy or brevity.

    More like code implies sacrificing inexactness so that the computer can understand it and do what we want with it. Although historically brevity was probably another important aspect(eg before assembly language).

  7. Jeff says:

    > I'd call that 'language' rather than 'code'.

    So, would you not consider those that speak a native language in front of a non-native language speaker to be speaking in code?  Especially if they are speaking in said language to be secret…I call that…speaking in code.

  8. ShawnHargreaves says:

    > More like code implies sacrificing inexactness so that the computer can understand it

    I can't find any definition of the word "code" that mentions inexectness vs. precision as part of its meaning…

  9. David Black says:

    > I can't find any definition of the word "code" that mentions inexectness vs. precision as part of its meaning…

    Well dictionaries are not all encompassing. But perhaps in a larger or more specialized dictionary further meanings might be mentioned.

  10. ShawnHargreaves says:

    > So, would you not consider those that speak a native language in front of a non-native language speaker to be speaking in code?  Especially if they are speaking in said language to be secret.

    It depends on the intent.

    If my Russian friend is speaking to his Russian friend in front of me, for the purpose of sharing information from one Russian speaker to another, then this is not code.  The fact that I do not happen to understand it is irrelevant to the nature of their communication.

    If they say the exact same thing, but for the purpose of sharing information while keeping it a secret from me, then yes, that would make it a form of code.

    When we write computer programs, keeping intent secret is (rarely) our goal.  In fact my goal is almost always the exact opposite: to make my intent as simple and obvious as I possibly can!

    Therefore, what I am writing is not code.

  11. LillianH says:

    LOL! Oh my gosh. This made me laugh so hard. My husband used to come home and sit on the recliner, when suddenly his eyes would glaze over and he would begin…speaking in a foreign language…code!! (You know you've been programming too long when, right?)

    I didn't understand it until I started working on websites and started learning how to speak the language. Now we happily geek out together!

    Thanks for a fun article,

    LillianH

    http://www.yurdigital.com

  12. Fredrik says:

    United States Code anyone? No one understands that one though, so I guess it's accurate there.

  13. David Black says:

    >LOL! Oh my gosh. This made me laugh so hard. My husband used to come home and sit on the recliner, when suddenly his eyes would glaze over and he would begin…speaking in a foreign language…code!! (You know you've been programming too long when, right?)

    Perhaps some sort of exorcism would have been better?

  14. Michael says:

    Shawn is there comming hardware float point math SMID VECTOR and custrom shaders to windows phone 7 , xbox 360 , windows

    i can not find any info on the mix page and i have seen a lot of sessions

    i saw that in silverlight 5 there is custrom shaders pixel shader 2.0

    hope you can help on clear some words out here

  15. Eckish says:

    Programming is writing in code.  In fact, the higher the level the languages climb and the more human readable they are, the stronger the code is.

    Computers have and may always speak in on/off switches.  It is the only language they know.  Everything a programmer writes gets translated, sometimes several times, until it becomes machine readable on/offs or 1s and 0s.  And the smarter that compilers get, the less direct this translation becomes.

    So, yes, the "code" that you wrote that clearly spells out its intent to fellow programmers would appear to be plain as day.  But, that just assumes one destination of the message.  The coded portion of the message goes to the computer.  And it is probably a complete secret to both the coder and his/her colleagues as to what was actually said.

  16. ShawnHargreaves says:

    > it is probably a complete secret to both the coder and his/her colleagues as to what was actually said.

    But "translation" is not the same thing as "coded".

    The word "code" specifically implies opacity, secrecy, incomprehensibility.

    Sure, the coder may not know exactly what machine code his program is translated into, but I seriously hope there is no secrecy as to what the program actually said! Programming only works if both forms are equivalent, so it should be obvious and easy to understand exactly what was said just by reading the source program.

    Hence I contest that this source program is not "code" at all, and that "langauge" is a better word for us to use.

  17. Eckish says:

    Translation is a vital step of coding and decoding.  I don't agree that to be code, the intent has to be secrecy.  Even your quoted definition above has 'brevity' as an alternative intent.

    Using an 'if' statement instead of comparison and jump operations can arguably be brevity.

    And regardless of the programmer's intent, the intent of the compiler designer's is absolutely one of secrecy.  The better a language and compiler are designed, the less a programmer has to know about the internals of the device they are programming.  We get closer and closer to giving human commands to perform computer operations.

    It becomes apparent in things like multi-threaded programming.  You said do A, then B, then C, but the compiler decided that it was better to do B then A, then C and that there would be no difference in the result.  And sometimes it decides that C is completely useless and doesn't do it at all.  When these changes occur is deterministic, but it is never made known to the programmer without investigation.  So, writing a 2nd thread that depends on the specific order of events causes confusion when problems arise.  And it gives rise to constructs that many languages now have to prevent compiler 'secrecy'.

  18. Eckish says:

    I prefer Wikipedia's definition of code =)

    en.wikipedia.org/…/Code

  19. ShawnHargreaves says:

    Information hiding via abstraction is not the same thing as information hiding via secrecy. The former separates important information (the program source) from unimportant implementation details, and hides the implementation details. The program source is not made secret in any way: if anything, it is made less secret because its core intent is no longer confused by irrelevant details. The latter, on the other hand, encodes important information in such a way that it cannot (easily) be read or understood.

    Brevity can be an intent of encoding data, yes, but I do not agree that brevity is the intent of a well designed programming language.

    (some languages like Perl do indeed have brevity as a primary goal, as a direct result of which I tend to agree that Perl programs can legitimately be described as 'code' :-)

    For most languages, though, the intent is clarity. Optimizing for clarity will sometimes also result in brevity, but there are many places where opportunities for brevity are ignored because they would hurt clarity.

    (if languages like C++, C#, Ruby or Python really were designed with brevity as a primary goal, I'd say they failed pretty spectacularly at that given how trivially compressible non-obfusticated high level program source is!)

    I think the origin of the word "code" to refer to programming languages is much simpler than this. When computers were new, it all seemed very strange and complicated and impossible to understand: a special (secret) form of information that only a special few people knew how to read. Early programmers enjoyed this aura of mystery, and were happy to play into the idea that they were cool and special, ya know, kinda like an espionage agent who has the secret keys and is thus the only one able to read the top secret plans for the underwater base…

    But words are important, and seemingly casual choices tend to influence our subsequent behavior. I find it unfortunate that we so widely use a term which implies it is ok (even expected!) for programs to be hard to read.

  20. Eckish says:

    Disagreement aside, what would you propose to use instead?

    When writing with the English language, I tend to state what I am reading/writing in an object oriented sense.

    -I'm writing a "letter"

    -I'm finishing up my "term paper"

    -That "peom" was beautiful

    Or in a more profesional setting, I often hear or use the medium being used.

    -This "Word document" is taking forever to finish

    I have used these types of references with coding, but only in specific cases.

    -I'm working on that "comparison function" now.

    -This "sorting algorithm" is giving me a lot of trouble

    But, what about the more general cases?  I can't say that I've ever told anyone to backup their "C# documents".  I would tell them to backup their "code".  What would we use for canned terms like "Code Review"?

  21. ShawnHargreaves says:

    > Disagreement aside, what would you propose to use instead?

    I would go with "source" or possibly just "program".

  22. Daniel says:

    Never really thought if it like that; though, going on this, I suppose it does make sense. I generally like my source to read nearly identical to sentences–I usually make sure my parameter orders fit sentence structure. Logically speaking, if we're writing something that we hope to understand, it would make sense that we try to mimic something we're already familiar with–in this case, our primary language.

    Interesting thought Shawn.

  23. Daniel says:

    Another thought… code is only meant to appear crypitic to those not intended to receive the code. Perhaps in terms of whichever language you particularly use, you are considered inclusive of the "message" and can thus decode the code.

    Also, where does Jargon fall into this? What if we considered the higher leveled languages such as C# and C++, etc, to be considered the jargon form of the lower levels, like assembly. Assembly would then be the "code" and thus something not understood by all. (just kind of throwing this second though out there).

  24. James says:

    One definition of the word <b>Encode</b> is: <i>To convert (as a body of information) from one system of communication into another</i> (<a href="http://www.merriam-webster.com/…/a&gt;). I would argue that any form of communication – written, spoken, or digitally transmitted – could be considered 'code'. We encode our thoughts and ideas into words and encode those into letters and other symbols in order to communicate them to our audience. The same holds true for programming code – we use predefined symbols and key words to communicate to the computer what we want it to do. By this logic, a language <i>is</i> a code.

    <p>

    On another note, coding does not necessarily imply encryption. Take, for example, concepts such as <i>character encoding</i> (such as ASCII), <i>genetic codes</i> (mapping codons to amino acids) and <i>color codes</i> (such as on electrical resistors or the U.S. terrorism alert system). These aren't meant to be cryptic or secret. In fact, they're meant to be widely known so that the information can be more easily, quickly and precisely communicated, which I personally believe is a more accurate description of what 'code' is.

  25. Cari picknitting revision 1.1 (beta) says:

    Knitpicking picknitters

    ———————————-

    There are knitters who pick

    and pickers who knit

    There's code that is quick

    but reads like s**t

    WHat shall I call a picker that knits?

    What shall I call a knitter that picks?

    picknitter is new

    but used by few

    knitpicker though old

    known by everyone polled

    I think I'll stick with venerable "code"

    shut my ears to these semantics crowed

    Language is code and code is language

    no matter the mode of the harranguage

    So I leave you all here with your semantic abusage

    To go get me a beer or some other nice beverage….er drink. I meant drink.