Programming languages that are closer to the language of humans.

How close programming languages are to human language is, among other things (mostly technical factors like how the system that is to be commanded is structured), a question of how the programmer names their subroutines and variables/objects.

  • "Hey, invoice generator. Add the price of this product to your list."

  • the_invoice_to_be_shown_to_the_customer.add_this_price_to_the_list(a_product_object.the_field_whose_name_is_price);

  • theInvoiceToBeShownToTheCustomer.addThisPriceToTheList(aProductObject.theFieldWhoseNameIsPrice);

  • invoiceToBeShown.addPriceToList(productObject.thePriceField);

  • invoice.addPrice(product.price);

  • i.add(p.price); // This is taking it a bit too far.

All but the first are valid code (in this case, Java, but probably also a few other languages). The way I wrote it is a bit awkward, it could have been written in a more human-language-like fashion.

But you see: Eventually, while coding, you would reduce what you're trying to tell the machine to the absolute minimum, as long as it's still clear what's going on.

I'm saying that basically, in some areas it is an abbreviated form of human language.

The previous sentence can't reasonably be put into code, because it states a clarification. The computer doesn't need such a thing, because the code written earlier would already have been 100% clear, but if I omit the clarification part (the first part):

final float humanLanguageIsh = 0.4;

"Create a constant value, meaning one that doesn't change any more. The kind of data it can store shall be decimal numbers, and it shall be very fast. Set the value to 40%."


Could you give an example code snippet that you'd like to be more human language like? My "add price" example probably is not one of those.

Posted by Nixon 6 March, 2017

I’ve been intrigued by languages for a very long time. Back at home in Poland I studied English and German and planned to go on to do a degree in Chinese. When I moved here and decided to study programming I noticed all the patterns that both human and coding languages share.

What is language?

So to begin, what do we mean by language? According to Wikipedia, ‘language is the ability to acquire and use complex systems of communication, particularly the human ability to do so, and a language is any specific example of such a system.’

In other words, languages are simply systems of communication.

A brief history of language

Human languages, such as English, Polish and German, are created through use over time. They’ve existed and evolved over thousands of years to become the tongues we speak today, and they continue to mutate.

The origins of programming languages are very different: they are designed and created over a short space of time by an individual or a group who is trying to solve a specific problem following a particular structure. Rather than growing organically, they’re created with a purpose in mind.

Programming languages that are closer to the language of humans.

Family tree

Languages are generally a part of a family – a group of languages that come from a common ancestor. For example English and German are Germanic languages, whereas Polish comes from the Slavic family. Similarly, in programming there are families such as the C languages, Lisp and Audio.
Languages from the same family share many similarities, and this applies to both human and programming languages.

Looking at the example below, it’s clear that English and German both come from the same family – both syntax (noun, verb, determiner, noun, determiner, noun) and vocabulary are very similar – while Polish has a completely different structure (verb, noun, noun) and the words are derived from different roots.
 
German: Ich gab dem Jungen einen Ball.
English: I gave the boy a ball.
Polish: Dałam chłopcu piłkę.

Likewise, the syntax and vocabulary of programming languages differ from family to family. Syntax in C-family languages, such as PHP and JavaScript, is as follows: condition in brackets, block in braces. In Python, however, there are no brackets and no braces – only whitespace is used to create blocks of code.

PHP

Programming languages that are closer to the language of humans.

JavaScript

Programming languages that are closer to the language of humans.

Python

Programming languages that are closer to the language of humans.

Following these examples, we could assume that if we know one language in a family of languages then learning another one in the same group would be fairly easy. Of course it’s not that simple. Vocabulary differs even in languages of the same family, and some languages have words that don’t exist in related tongues. The German word kummerspeck is one such example, and translates to English as ‘excess weight gained from emotional overeating’. In programming, you might know the syntax but won’t be able to create an application not knowing the language specifications, such as the API (application programming interface) or the standard library.

Say what?

Ultimately, programming language is made for human readability (though it may not seem this way to non-coders). Professors Harold Abelson and Gerald Jay Sussman at the Massachusetts Institute of Technology write that ‘programs must be written for people to read, and only incidentally for machines to execute.’

Coding is about us communicating to computers what we want them to do, so we need to be able to read and write it too. Programming languages contain words such as ‘for’ and ‘if’ because it makes it easier for us humans to understand, and we often indent our code – like with paragraphs in human languages – to make programs more digestible.

Vocabulary also applies to the words in our code, like variable names. We don’t go around calling everything ‘thing’ or ‘it’ because that would get very confusing very quickly. Badly named variables can lead to misunderstood code, which can lead to bugs, and names that are too long can be hard to remember, hard to type out correctly, and hard to spot errors in. Variable names should be concise yet descriptive.

Another way we make code more readable is to avoid nesting, i.e. grouping large functions together. By splitting one large function into a few smaller, properly named ones, the code is often optimised and easier to understand.

How does it all help?

So, as we’ve seen, human and coding languages aren’t all that different. Both are about communicating using a certain syntax and a specific vocabulary, and, once you know the rules, both are easy for humans to understand. So how does learning human languages have a positive impact on coding and vice versa?

One positive impact is that you quickly develop an eye for patterns. You begin to see the way in which a piece of text or code is structured, the rules that govern that structure, and the vocabulary, words or commands used. This makes it easier to understand large sections of code and spot errors quickly. It also makes it easier to learn new languages, both human and programming.

Another benefit to learning languages is that you’re forced to think about things in different ways. This is important for everyone, not just programmers and linguists. When exploring a new syntax or vocabulary, you often need to approach what you want to say from an unusual angle. In programming we could take the example of Java and Haskell. Java is an OOP (object-oriented programming) language, which means that when you code, you need to think about objects rather than actions. Haskell, on the other hand, is a purely functional programming language focused on actions. Each language can solve the same problem but in totally different ways.

As such, when you approach a problem you can view it from more than one angle. Even if you can’t necessarily use a different language or code in a particular situation, that extra perspective often provides depth and leads to an intuitive solution, which is valuable whatever your line of work.

Are you an aspiring coder? Take a look at our tips for getting your first web dev job.

Share this post

You’ve successfully signed up to the Nixon newsletter – thank you! In return, we’ll share with you a range of blog posts filled with brand advice and marketing tips to help your business grow.

In the meantime, follow us on Twitter and Instagram for all the latest from the studio, plus a little inspiration whenever you need it.

Stay in the loop

For easy access to the latest marketing news and advice, just enter your email address.

View our privacy policy.

Which human language is best for programming?

Easy programming languages.
HTML. Hypertext Markup Language (HTML) is the language that is used to code most web pages. ... .
JavaScript. Along with HTML and CSS, JavaScript makes the internet. ... .
C. C is a general-purpose language that most programmers learn before moving on to more complex languages. ... .
Python. ... .

Are programming languages similar to human languages?

Similarities between programming and human languages Programming languages can be used to help people learn complex concepts through games, or to save and display information that leads to decision making and change. Another similarity is that both human and programming languages have developed over time.

Which programming language is closest to English?

The Shakespeare answer reminded me of Inform 7, which is a serious programming language for writing interactive fiction. It's probably the language most closest to English that exists and has a well-defined semantics.

Which generation languages are similar to human language?

Fourth Generation Languages : These are languages that consist of statements that are similar to statements in the human language. These are used mainly in database programming and scripting. Examples of these languages include Perl, Python, Ruby, SQL, MatLab(MatrixLaboratory).