LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   What are the top few most human-readable programming languages? (https://www.linuxquestions.org/questions/programming-9/what-are-the-top-few-most-human-readable-programming-languages-4175542104/)

punchy71 05-09-2015 09:21 PM

What are the top few most human-readable programming languages?
 
Hello,
I am trying to consider the top three or so most human-readable computer programming languages. After doing a little research, I have pretty much settled on Python being one of them. Perhaps it would even be the number one... in terms of being easy to read and comprehend by human beings. But what would a few more be?
Thank you

dugan 05-10-2015 02:27 AM

1 Attachment(s)
You're really asking which languages are highest level. And framed like that, it can't answered with individual choices, but languages can certainly be categorized into "candidate" and "not a candidate".

That said, my Google result was highly amusing.

jmccue 05-10-2015 12:49 PM

Cobol :)

metaschima 05-10-2015 12:55 PM

Ruby and Bash are also pretty good examples.

NevemTeve 05-10-2015 01:33 PM

Why, $(shell) ~scripts are `counter`-examples: they are easy to write, hard to understand or modify.
Of curse brainfuck is worse, never mind Forth.

Myk267 05-10-2015 02:10 PM

It seems like most languages would be human readable if you knew how to read them.

John VV 05-10-2015 02:15 PM

Quote:

Cobol
how about BASIC or FORTRAN

but for "human readable"
all of them

there are people that are fluent in assembly

DJ Shaji 05-10-2015 02:29 PM

I'd say python, but yeah, depends on what human is reading them :D

dogpatch 05-10-2015 02:50 PM

Quote:

Originally Posted by jmccue (Post 5360436)
Cobol :)

Agree.

metaschima 05-10-2015 03:09 PM

It really does depend on if you know the language whether it is readable to you. I find bash very readable, but I'm sure others don't think so. C is not very readable even tho I know it reasonably well. It's all the special characters and nuances that get me. It is readable but hard to read. There are solutions to this tho, for example there is a way to add more readable keywords using a .h file, I just forgot the name of it.

sundialsvcs 05-10-2015 09:36 PM

A determined programmer (or, just a careless one) can write unreadable code in any language. . .

dogpatch 05-11-2015 09:47 AM

Quote:

Originally Posted by sundialsvcs (Post 5360629)
A determined programmer (or, just a careless one) can write unreadable code in any language. . .

lol. and i agree. But as a language, readability was always natural for Cobol (assuming the developer read English). For example, a typical line of Cobol code might be
Code:

Add ItemAmount to InvoiceTotal.
which code itself is self-explanatory, with no need of comments

The outline way of defining data is likewise self-evident and human readable. e.g
Code:

01 StudentDetails.
  02 StudentId        PIC 9(7).
  02 StudentName.
      03 FirstName    PIC X(10).
      03 MiddleInitial PIC X.
      03 Surname      PIC X(15).
  02 DateOfBirth.
      03 DayOfBirth    PIC 99.
      03 MonthOfBirth  PIC 99.
      03 YearOfBirth  PIC 9(4).
  02 CourseCode      PIC X(4).

makes obvious the relationship between the various fields. So that
Code:

Move spaces to StudentName
will obviously initialize all 3 fields associated, but will leave other fields untouched.

Perhaps I am not fully objective, since Cobol was my first programming language, and the intuitive nature of Cobol meant that I was able to concentrate on writing good logic without having to be a computer geek. I didn't have to understand how my logic was being converted into machine code. To learn C and other languages, I had to learn to think more like the computer and less like a human.

suicidaleggroll 05-11-2015 10:15 AM

Quote:

Originally Posted by dogpatch (Post 5360907)
Code:

Move spaces to StudentName
will obviously initialize all 3 fields associated

I never would have guessed that.

As has been said above, a language is only readable if you know it. If you know assembly, then assembly is perfectly readable. If you know C, then C is perfectly readable. I find your Cobol examples to be ugly as sin...WTF is "PIC 9(4)." or "PIC X(15)." supposed to mean? What does "Add ItemAmount to InvoiceTotal" do? Is InvoiceTotal just a running sum? A list? An array? What does "add" mean? Are you appending ItemAmount to a list or are you doing a simple mathematical sum? Not knowing Cobol, I find your examples to be very difficult to read and understand. That's how it is with all languages in my experience.

dogpatch 05-11-2015 10:54 AM

Quote:

Originally Posted by suicidaleggroll (Post 5360917)
I never would have guessed that.

Perhaps because from the beginning of your career you were programming in C or Assembly and had to learn to think like the computer you were programming. So you have a hard time understanding that 'add' means 'add' as any non-tech person would already know intuitively. The non-tech would not immediately wonder whether an array or list were involved. Likewise, most folks learned in elementary school how to use an outline with numbered levels. Applying this non-tech understanding to data storage is, in my opinion, much more intuitive and human readable than having to understand structures, arrays, pointers, indirection and such - which was the OPs original question.

johnsfine 05-11-2015 12:28 PM

Quote:

Originally Posted by DJ Shaji (Post 5360478)
I'd say python, but yeah, depends on what human is reading them :D

In the case of python, I think it depends a lot more on what human wrote it.

I would never include python in a list of the more human readable programming languages. Python was designed to be easy to write, not easy to read and it is especially easy to write bad python code than no one can read. Maybe some people write serious software in readable python, but I've never seen an example. The only big python projects I've had the misfortune to dig into were worse unreadable unmaintainable garbage than you are likely to find in almost any other language.

Pascal is more human readable than most programming languages for the same reasons it is a terrible language: It was designed to be readable by a really stupid compiler, without consideration given for the fact that making it that readable makes it much harder to write. While a human is very different from a really stupid compiler, there are many characteristics in common. Pascal is easier to read in ways that are independent of who is reading it.

Similarly, Java is easier to read than C++, in ordinary size projects, for pretty much the same reasons that Java is harder to use to write really large complicated software.

Ultimately, the size and complexity of the project becomes an overwhelming factor in whether the language is human readable. No one should claim C++ is high on the list of human readable programming languages, but as you scale up to bigger and more complicated projects, eventually C++ becomes the most human readable programming language, because it holds up better to bigger and more complicated projects than any other commonly used language.


All times are GMT -5. The time now is 05:14 PM.