Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. What's the Most Concise, Human-Understandable Practical Language?

What's the Most Concise, Human-Understandable Practical Language?

Scheduled Pinned Locked Moved The Weird and The Wonderful
javascriptpythoncomgame-devtools
40 Posts 24 Posters 45 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K kalberts

    Richard Deeming wrote:

    And yes, the language was designed.

    I'd certainly like to see those design documents. Which alternatives were considered, the rationale behind each, the arguments for the selected solution. I have never ever heard even the tiniest little suggestion that any such thing exists. What was the rationale for not having a proper argument list in the function header, in the initial K&R, but listing the arguments below the header? What was the arguments when the language was redesigned for changing it to how other Algol-class languages did it? What was the rationale for not defining a statement to be a block, as in most other Algol-class languages? What was the rationale for defining the syntax of conditional statements like while-loops and if-statements so that parentheses are required around the condition - it is not in languages like Pascal, CHILL, Algol? What was the rationale for using the equals sign for assignment, so that an equals condition must be represented by two equals signs? What was the rational for deviating from the ISO standard interpretation of the CR, LF and NUL character codes? What was the rationale for not including enumeration types, as a first class type, in the language? For Algol-60, you can find discussions of it in the design douments, but lack of resources prevented them from implementing it time for the deadline, so it was omitted from the specificatin - but Pascal implemented it a few years later. Why didn't C? This thread has said a lot about exception handling. The first generation of C/C++ execption handling was not part of the language definition, but a cludge realized by macros and longjmp so that programmers could pretend that C had the same facilites as (some) other languages. Was there a design document for this? Was there a design document specifying how to incorporate this cludge in the language itself? Writing a book a couple of years after the implementation, to tell: See what we have implemented! - that is not a language design process. Algol was through a design process. CHILL was through a design process, where several competing proposals were analyzed, and after critical evaluation of each feature, a choice was made to how it ws to be defined in the final specification. Starting with Fortran 77, Fortran has been further developed in a similar way, but of course with strong dependencies on earlier language versions. SUN tried to make ISO accept Ja

    Richard DeemingR Offline
    Richard DeemingR Offline
    Richard Deeming
    wrote on last edited by
    #29

    Going back to Kate's message that started this branch[^], we were talking about C#. Since 2013, all C# design discussions have been public on GitHub: GitHub - dotnet/csharplang: The official repo for the design of the C# programming language[^] Earlier discussions were not made public, but some information was available on various MSDN blogs. The language was originally designed by a team lead by Anders Hejlsberg. As for C/C++, the details of those decisions are likely lost in the murky depths of the dim and distant past of 1972, unless Dennis Ritchie kept some notes somewhere. :)


    "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

    "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

    1 Reply Last reply
    0
    • U User 13269747

      I wold go with some Lisp dialect. It looks weird until you get used to it, then all other languages look hard to understand. The reason I found it easy is because the grammer is so simple there's really not much to learn.

      R Offline
      R Offline
      Rob Grainger
      wrote on last edited by
      #30

      Smalltalk has similar properties - the syntax literally fits on an index card.

      "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

      1 Reply Last reply
      0
      • M Member_14564709

        BASIC. The only problem with any of the modern BASIC variants is the the name. It should have been changed years ago to something that sounds better. BASIC is the direction that programming languages should have been taking for decades. A programming language is a tool. A tool is something that makes work easier. C, Java and the like make simple jobs complicated, and complicated jobs - well, we won't go there. Unfortunately BASIC has been all but killed off because it scared the crap out of the C guys. VB was arguably one of Microsoft's biggest successes - suddenly anyone smarter than a manager or an accountant could write useful programs. They weren't always fast, or efficient, but they solved real world problems, then and there. And here lies one of the less understood issues with software - many, many programs are written as quick one offs to answer a question, or extract some data. They do not need the .NET framework or the latest C++ or Java support libs, or some horrendously expensive and complicated Studio Suite to create them BASIC was able to do this AND produce high quality complicated full fledged applications. And it still can. My favourite is PowerBasic - PowerBASIC[^] There are a few others. It seems to me that all the 'new' languages we see are based on C syntax. A whole bunch of cryptic punctuation marks interspersed with some unreadable, unintuitive bits of code. It's time to move on. C was never meant to last this long. It was an interim replacement to FORTRAN, until the 'new' languages came along. Sadly they never did.

        J Offline
        J Offline
        Jalapeno Bob
        wrote on last edited by
        #31

        I concur. Before I was retired from my last paying job:java:, "mangle-ment" dictated that all applications be written in VB, ostensibly "so the auditors can read it." It worked: very seldom did I have to explain my VB code. :) If I had to explain code, it was usually my SQL code. :zzz:

        __________________ Lord, grant me the serenity to accept that there are some things I just can’t keep up with, the determination to keep up with the things I must keep up with, and the wisdom to find a good RSS feed from someone who keeps up with what I’d like to, but just don’t have the damn bandwidth to handle right now. © 2009, Rex Hammock

        1 Reply Last reply
        0
        • J johnywhy

          Here's my fantasy rewrite of some Javascript. Which one do you find more understandable? Which one's function and structure is more instantly obvious? Be honest. JS

          var home = {
          cit : "Boston",
          get City () {
          return this.cit;
          },
          set City(val) {
          this.cit = val;
          }
          };

          Fantasy Rewrite

          home
          City 'Boston'

          That's sort of what i'm looking for. Notice the lack of punctuation. Notice judicious use of whitespace as syntax. Notice how the getter, setter, variable, and default value are all encapsulated into two words. What language is like that?

          What's "Human understandable"?

          I mean, easy to understand at a glance. Here's Game of Life in APL. Extremely concise! And totally NOT human-understandable.

          {≢⍸⍵}⌺3 3∊¨3+0,¨⊢

          Here's the Whitespace language. Extremely concise, and totally NOT human-understandable. Seeking characters found on a normal keyboard.

          By "human-understandable", i DON'T mean "natural language" or "sounds like spoken English". I mean, provided you have learned the special programming syntax, and that learning that syntax is no more challenging or time-consuming than learning, say, Python.

          What's "Concise"?

          Here's some COBOL. Very human understandable. But not concise:

          ADD YEARS TO AGE.
          MULTIPLY PRICE BY QUANTITY GIVING COST.
          SUBTRACT DISCOUNT FROM COST GIVING FINAL-COST.

          What's "Practical"

          By "practical" i mean, it's a wise choice for real-world programming. Ie, not just an academic experiment. It has community, tools, rich programming features.... things a language needs to be usable for real projects.

          J Offline
          J Offline
          James Curran
          wrote on last edited by
          #32

          I would say you rewrite fails the "Human understandable" test, as because my understanding of your code is quite different than what the original javascript does. I'd assume it was closer to:

          var home =
          {
          get City ()
          {
          return "Boston"
          }
          };

          Truth, James

          J 1 Reply Last reply
          0
          • B B Alex Robinson

            No one has mentioned Python?!? That's interesting.

            V Offline
            V Offline
            Vikram A Punathambekar
            wrote on last edited by
            #33

            That was exactly my thought, and I had to scroll down way too much to find this :)

            Cheers, विक्रम "We have already been through this, I am not going to repeat myself." - fat_boy, in a global warming thread :doh:

            1 Reply Last reply
            0
            • L Lost User

              The major problem with your idea is "Human understandable" you didn't define the audience, and saying "everybody" is not the answer. my old mother trying to use a DVD player - one with not that many buttons:

              "how do I make it go"
              "press the 'Play' button."
              "you mean this one '|> Play', with a triangle on it."
              "yes."
              "what does the triangle mean?"

              and that's not even adding in complications of her first language being English. Let's look at your concise [anti] example

              ADD YEARS TO AGE.
              MULTIPLY PRICE BY QUANTITY GIVING COST.
              SUBTRACT DISCOUNT FROM COST GIVING FINAL-COST.

              ahh the layman says, I see. but then the accountant

              it's all wrong, you've mixed up terms, "'cost' is purchasing, 'price' is selling." "price times quantity is selling price, not even 'nett cost' let alone 'cost'"

              understandable to some, an abject failure to others, even the programmer and his audience spoke a different language - probably should fire the project manager for that stuffup. Consider the image they placed on the Voyager space probe: the guy/gal in a circle with arms and legs stretched out in a circle - supposedly according to experts 'understandable' by anything that finds it. There's people on Earth, the very concept it's meant to represent that look at that and scratch their heads. Early explorers would encounter 'natives [perhaps chanting] and shaking their spears' - in some cases it meant 'go away, this is our [special] place, any closer we will attack' - in others 'welcome strangers [yes we have weapons but we are choosing not to use them so be nice]' Sorry, but "Human Understandable" is not possible, not without defining/limiting the audience and even the language.' Does say a Lithuanian farm hand that's never gone outside know what 'city' means? Even pictures don't help, how long were Egyptian hieroglyphs - pretty plain to the people of the time of writing - undecipherable before the Rosetta stone was found? short answer is: it's impossible

              pestilence [ pes-tl-uh ns ] noun 1. a deadly or virulent epidemic disease. especially bubonic plague. 2. something that is considered harmful, destructive, or evil. Synonyms: pest, plague, CCP

              J Offline
              J Offline
              johnywhy
              wrote on last edited by
              #34

              Quote:

              The major problem with your idea is "Human understandable" you didn't define the audience

              But i did define it:

              Quote:

              By "human-understandable", i DON'T mean "natural language" or "sounds like spoken English". I mean, provided you have learned the special programming syntax, and that learning that syntax is no more challenging or time-consuming than learning, say, Python.

              The audience is people who have learned the special programming syntax.

              1 Reply Last reply
              0
              • J johnywhy

                Here's my fantasy rewrite of some Javascript. Which one do you find more understandable? Which one's function and structure is more instantly obvious? Be honest. JS

                var home = {
                cit : "Boston",
                get City () {
                return this.cit;
                },
                set City(val) {
                this.cit = val;
                }
                };

                Fantasy Rewrite

                home
                City 'Boston'

                That's sort of what i'm looking for. Notice the lack of punctuation. Notice judicious use of whitespace as syntax. Notice how the getter, setter, variable, and default value are all encapsulated into two words. What language is like that?

                What's "Human understandable"?

                I mean, easy to understand at a glance. Here's Game of Life in APL. Extremely concise! And totally NOT human-understandable.

                {≢⍸⍵}⌺3 3∊¨3+0,¨⊢

                Here's the Whitespace language. Extremely concise, and totally NOT human-understandable. Seeking characters found on a normal keyboard.

                By "human-understandable", i DON'T mean "natural language" or "sounds like spoken English". I mean, provided you have learned the special programming syntax, and that learning that syntax is no more challenging or time-consuming than learning, say, Python.

                What's "Concise"?

                Here's some COBOL. Very human understandable. But not concise:

                ADD YEARS TO AGE.
                MULTIPLY PRICE BY QUANTITY GIVING COST.
                SUBTRACT DISCOUNT FROM COST GIVING FINAL-COST.

                What's "Practical"

                By "practical" i mean, it's a wise choice for real-world programming. Ie, not just an academic experiment. It has community, tools, rich programming features.... things a language needs to be usable for real projects.

                J Offline
                J Offline
                johnywhy
                wrote on last edited by
                #35

                For anyone interested, i created a git project with more description of the fantasy language, and several examples of how the hypothetical language would look. If you like it, please join the project! Homepage: https://github.com/contextual-project/contextual.js More examples: https://github.com/contextual-project/contextual.js/wiki

                1 Reply Last reply
                0
                • J James Curran

                  I would say you rewrite fails the "Human understandable" test, as because my understanding of your code is quite different than what the original javascript does. I'd assume it was closer to:

                  var home =
                  {
                  get City ()
                  {
                  return "Boston"
                  }
                  };

                  Truth, James

                  J Offline
                  J Offline
                  johnywhy
                  wrote on last edited by
                  #36

                  James Curran wrote:

                  I would say you rewrite fails the "Human understandable" test, as because my understanding of your code is quite different than what the original javascript does.

                  You're interpreting "human readable" to mean "js-programmer readable". That's not what i mean. My rewrite throws out much js syntax, and can't be interpreted through a js lens. It's a different language.

                  1 Reply Last reply
                  0
                  • K kalberts

                    I think of it more at a concept level rather than saving typing. Avoid reduncancy. Avoid tokens that serve no purpose. Remove clutter. As I argued earlier in the thread: A language such as CHILL allows any block to have an exception handler attached. Putting "try{...}" around the block before the handler is redundant: If the handler is present, then the block has a handler - no need to pre-announce it! Removing the need for that pre-announcement simplifies the code. (The real reason for the C/C++ try{} is purely historic: C didn't have any such thing, while several other languages did. So to "compete", a macro-based solution was devised, that required no extension to the underlaying compiler. When adopted into the C/C++ language, it could have been given a cleaner syntax, but to be backwards compatible with all the code that had been written for the macro-based implementation, the syntax was kept unchanged.) In Pascal (or CHILL), you write a condtion without enclosing parethes like in prose text: If it is raining, then you better wear a raincoat. You need not clutter up that sentence with parentheses markup. You remove the conceptually informationless tokens.

                    var matching = new List();

                    rather than

                    List matching = new List();

                    removes redundancy, risk of inconsistency, and the reader has fewer tokens to interpret. I do not see what we gain by repeating the type information when it can be infered. (var has other uses as well unrelated to this.) A language recognizing a statement as a block avoids redundant bracketing: At the spur of the moment, I cannot think of a single case where single-statement block and a single statement are both valid but with different semantics. So I see no reason why some languages insist on adding these extra tokens that carry no semantic information. The idea is that non-information-carrying elements (that you nevertheless have to relate to) are bad. The fewer elements you need to process mentally, the better. This is, of course, assuming that the programmer/reader easily relates to the concepts repersented by the tokens. E.g. to a matehmatician, matrix inversion is such a basic and common concept that giving it a separate symbol (analogous to multiply and divide) as it done in APL (created as a mathematical notation, not as a programming languge) is perfectly fine even though non-mathmaticians says "Huh?". For those who are "only engineers", powers are essential, so languages with that user

                    J Offline
                    J Offline
                    johnywhy
                    wrote on last edited by
                    #37

                    Member 7989122 wrote:

                    I think of it more at a concept level rather than saving typing. Avoid reduncancy. Avoid tokens that serve no purpose. Remove clutter.

                    Both are important to me. In the end, we still have to type. i like your thinking. Please check out my git. If you like it, please join the project! Homepage: https://github.com/contextual-project/contextual.js More examples: https://github.com/contextual-project/contextual.js/wiki

                    1 Reply Last reply
                    0
                    • K Kirk 10389821

                      Why? Why optimize for concise? To save YOU time typing? I write code in a pseudo code format for the first pass, then have to translate it to one of many languages depending on the target. Most concepts are clear enough. What about R? (Functional languages?) But again... I prefer a language that has the libraries/components/tools that I need. If I gave you your "perfectly" concise language, without a bunch of caveats, like no libraries, no classes, no protocol support. Would you want to use it? If you had to implement AES, SMTP, HTTP, etc all by hand? == The most important thing I ever learned... Once you know how to write the program properly. The language is not usually what is holding you back. Especially with UDFs. == For me. C was the most elegant language and always my favorite. It was PDP Macro Assembler as a language with indentation and code blocks, UDFs, etc. etc. And probably a bit too concise, LOL!

                      J Offline
                      J Offline
                      johnywhy
                      wrote on last edited by
                      #38

                      Kirk 10389821 wrote:

                      If I gave you your "perfectly" concise language, without a bunch of caveats, like no libraries, no classes, no protocol support. Would you want to use it? If you had to implement AES, SMTP, HTTP, etc

                      i never said anything about eliminating libraries, classes, or protocol support.

                      1 Reply Last reply
                      0
                      • M Member_14564709

                        BASIC. The only problem with any of the modern BASIC variants is the the name. It should have been changed years ago to something that sounds better. BASIC is the direction that programming languages should have been taking for decades. A programming language is a tool. A tool is something that makes work easier. C, Java and the like make simple jobs complicated, and complicated jobs - well, we won't go there. Unfortunately BASIC has been all but killed off because it scared the crap out of the C guys. VB was arguably one of Microsoft's biggest successes - suddenly anyone smarter than a manager or an accountant could write useful programs. They weren't always fast, or efficient, but they solved real world problems, then and there. And here lies one of the less understood issues with software - many, many programs are written as quick one offs to answer a question, or extract some data. They do not need the .NET framework or the latest C++ or Java support libs, or some horrendously expensive and complicated Studio Suite to create them BASIC was able to do this AND produce high quality complicated full fledged applications. And it still can. My favourite is PowerBasic - PowerBASIC[^] There are a few others. It seems to me that all the 'new' languages we see are based on C syntax. A whole bunch of cryptic punctuation marks interspersed with some unreadable, unintuitive bits of code. It's time to move on. C was never meant to last this long. It was an interim replacement to FORTRAN, until the 'new' languages came along. Sadly they never did.

                        J Offline
                        J Offline
                        johnywhy
                        wrote on last edited by
                        #39

                        Member 14564709 wrote:

                        Unfortunately BASIC has been all but killed off because it scared the crap out of the C guys.

                        i like your thinking. Plz check out my git. https://github.com/contextual-project/contextual.js/wiki

                        1 Reply Last reply
                        0
                        • F Fred2834

                          Hello, The question must be looked at from several perspectives. I would start by saying that if you give me 3 sliders to grade "practical", "concise" and "human readable", there is no way you will reach 100% on each, I would argue that not even an 80-80-80 is possible. Everything is a trade-off, and you will sacrifice in one area because there are things you definitely want to keep in another, and those things have a cost. It is up to you to decide which area you want to favor. Or rather, which language you want to support based on your style as a programmer. Then comes the question of the language's purpose. One should not compare a system language vs a scripting language for example. By nature, they have different purposes, have been build to solve different issues. One is compiled, the other is interpreted, and like it or not this has an impact on its design. Each area you suggest deserve its own debate, almost. "Human readable" for example. In your example, I would not want a very long hash table to be described without any special character. In the real world, large XML or JSON files are a reality. Imagine those without anything to identify what goes where. Tab separated ? or indentation dependent ? I personally think Python is an abomination for that reason alone, but there I am going against the majority, so let's avoid waking up the beast :) But you see, right here, by giving more focus to "human readable", you have already lost in practicality. Trade-off as I said. "Practical" : you mentioned "it has community, tools, …" => well those things are not the language itself, and they do not make it practical. The language itself should be self sufficient, you want to compare apples with apples. The fact that a language has a huge community is just showing its popularity, not its intrinsic worth. If I look at my own experience in scripting languages, I have done many, and I firmly believe that the best of them is Lua, but the world favors Python. So which is more practical ? Probably Python if you look at the community and tools, but I think it is Lua for the human-readable part. As for conciseness, I think it is not really the biggest problem. At some point, you have to tell the computer what to do. The real question is how much you want to work to get there. The real question is : "how much work should be accomplished by the programmer and by the compiler ?" If it is hard to write, it is probably easy to parse (think C++). If it is easy to write, it is probably hard to parse (

                          J Offline
                          J Offline
                          johnywhy
                          wrote on last edited by
                          #40

                          Fred2834 wrote:

                          I would not want a very long hash table to be described without any special character. In the real world, large XML or JSON files are a reality.

                          I would. If i had to enter/edit the data manually, then i would want a long hash table to be described without any special character. I had to achieve exactly that with a new Javascript tool i created. I had to figure out a way to store human-editable data in html -- ie, plain text. So, no formatting, no tabular display. Here's my solution. It uses no special characters at all, no tags, and unlike XML/JSON the fieldnames aren't repeated for every record. I find this quite readable. It's optimized for low-risk editing. There are no syntax to screw up or special symbols to put in the wrong place, no punctuation to get wrong. And it's far less laborious without having to type all those tags or braces.

                          	NAME
                          	LINK
                          	DESCRIPTION
                          
                          	Genevieve Dupre
                          	https://www.genevievetattoos.com
                          	This isn't what you expected.
                          
                          	Joey Armstrong
                          	https://thunderhandtattoo.com
                          	The most amazing.
                          

                          GitHub - johnaweiss/HTML-Micro-Templating: Lightweight, robust HTML templating system.[^] Granted, this would quickly become unwieldy with a lot of fields. The solution above isn't intended for data with a ton of fields. But if i had a lot of fields, then i wouldn't be manually editing raw data in plain text format. Dude, why are you doing that? XML/JSON are best suited for machine manipulation, not human reading/editing. But this thread is about human readable languages, not machine languages. So i'm unclear how your XML/JSON contradicts my desire for human-readable code.

                          https://github.com/johnaweiss?tab=repositories

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups