Slashdot Mirror


Power of Modern Programming Languages is That They Are Expressive, Readable, Concise, Precise, and Executable (scientificamerican.com)

An anonymous reader shares a Scientific American article: Programming has changed. In first generation languages like FORTRAN and C, the burden was on programmers to translate high-level concepts into code. With modern programming languages -- I'll use Python as an example -- we use functions, objects, modules, and libraries to extend the language, and that doesn't just make programs better, it changes what programming is. Programming used to be about translation: expressing ideas in natural language, working with them in math notation, then writing flowcharts and pseudocode, and finally writing a program. Translation was necessary because each language offers different capabilities. Natural language is expressive and readable, pseudocode is more precise, math notation is concise, and code is executable. But the price of translation is that we are limited to the subset of ideas we can express effectively in each language. Some ideas that are easy to express computationally are awkward to write in math notation, and the symbolic manipulations we do in math are impossible in most programming languages. The power of modern programming languages is that they are expressive, readable, concise, precise, and executable. That means we can eliminate middleman languages and use one language to explore, learn, teach, and think.

17 of 268 comments (clear)

  1. What? by Anonymous Coward · · Score: 5, Insightful

    With modern programming languages -- I'll use Python as an example -- we use functions, objects, modules, and libraries

    Who writes this shit? Confirming that C uses neither functions nor objects nor modules nor libraries

    1. Re:What? by AchilleTalon · · Score: 4, Insightful

      My first, second and third reaction too. And what you say for C is also true for Fortran. That guy doesn't know what he is talking about. Neither Fortran, nor C are first generation languages as he states it anyway. This article is total crap. Shame on you Scientific American for publishing that shit.

      --
      Achille Talon
      Hop!
    2. Re:What? by PCM2 · · Score: 5, Informative

      Everybody simmer down. TL;DR:

      1. TFA is not an article in Scientific American magazine, it is a "guest blog." Quote: "The views expressed are those of the author(s) and are not necessarily those of Scientific American."

      2. The author teaches computer science at a private undergraduate college. He has written a series of books, all of which use Python examples to explain concepts.

      3. When he talks about "modern languages," he's clearly referring to languages that look and feel a lot like Python. Mainly Python.

      4. When he talks about "eliminating intermediary languages," he means things like pseudocode. He believes (and gives an example to illustrate) that Python is now expressive enough that anything you might previously have expressed in pseudocode you can now express in Python in one go.

      5. From there, he makes the leap that you no longer need to teach computer science from a "math-first" approach; you can instead use a "code-first" approach, where you teach students to "think" in Python.

      6. Hand-waving about the future from there.

      --
      Breakfast served all day!
    3. Re:What? by Anubis+IV · · Score: 5, Informative

      Neither Fortran, nor C are first generation languages

      In fact, every language he mentions in the article is a textbook example of a third-gen language (3GL). I didn't see any mention of even a single first generation language.

      I'll give him the benefit of the doubt and assume he was trying to keep his writing approachable, but "first generation languages" has had an established meaning in this field for the last several decades, so misusing the terminology just makes it look like he has no idea what he's talking about. A far better way to phrase it would have been "In early high-level languages like FORTRAN and C [...]", since that would have been accurate while also being descriptive enough for most lay people to understand well enough.

      For anyone who doesn't know about them, programming language generations refer to the level of abstraction, NOT to when they were introduced:

      1. 1GL = Machine code. Flipping bits to issue machine-specific instructions
      2. 2GL = Assembly. Using human-readable text to issue basically the same instructions
      3. 3GL = Most high-level programming languages. Abstracting away machine instructions (e.g. using loops and function calls to abstract away jump instructions) to the point that it's both easier to use and mostly machine-independent (e.g. Fortran, COBOL, C, C++, C#, Java, Python, Ruby, Go, Rust, Swift, etc.)
      4. 4GL = Languages that, among other things, abstract generating reports, generating UIs, and/or handling collections of information (e.g. SQL, some 3GLs with libraries, etc.)
      5. 5GL = Languages where you describe the problem and let the computer come up with the algorithm (e.g. Prolog)

      All of which is to say, starting off an article with a glaring misuse of established terminology is a great way to get anyone with a passing awareness of the topic to immediately dismiss anything he has to say. As a professor, I'd hope he'd have a better awareness about the importance of using those terms correctly. And as the publisher, I'd hope that Scientific American would have an editor who would recognize when they were out of their depth and would need to call in a domain expert to proof the text.

  2. Hey, hey, hey, don't recycle the charter of COBOL by 140Mandak262Jamuna · · Score: 5, Insightful

    I remember reading about why COBOL so much superior to FORTRAN. And sounds exactly like the summary!

    --
    sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
  3. The subborn human race. by geekmux · · Score: 4, Insightful

    "...That means we can eliminate middleman languages and use one language to explore, learn, teach, and think."

    One solution for all? Never gonna happen.

    Some prime examples:

    "That means we can eliminate the standard system and use one metric system to measure everything."

    "That means we can eliminate the right-side driving wheel and everyone will drive on the same side of the road."

    "That means we can eliminate all of the world's individual spoken languages and use only one language to communicate."

    Humans are stubborn. Like really fucking stubborn.

  4. concise? readable? by petes_PoV · · Score: 5, Insightful

    I don't buy this. A simple hello world in Java is much more complex and wordy than the same functionality in 50 year-old BASIC. And any language that relies on whitespace to modify the program flow cannot be described as readable.

    And many object-oriented programs have so much of their basic functions hidden away in inheritance and class definitions that a printed form of a program is impractical. I would not call that "progress".

    As for natural language, it tends to be incredibly imprecise: the meaning is only apparent when the context of its use is taken into account. I would love to see a translator that tried to convert "natural language" sarcasm into executable code. But I wouldn't want it running in my driverless vehicle or airplane.

    --
    politicians are like babies' nappies: they should both be changed regularly and for the same reasons
  5. I call BS. Modern programming languages = bloat by passionplay · · Score: 4, Insightful

    Unless you're talking about C, or D, the fact of the matter is that you've hidden all the computational overhead in multiple layers of automated translation behind your syntactical sugar.

    Case in point: non-memory managed languages don't need to manage memory - memory requirements for these programs are huge due to inadequate planning. How many programmers take into account object pooling?

    Case in point: The Motorola Startac was a very limited device but had its programming in hardware - you could not type faster than the device. New smartphones have 2-3Gb in memory and yet are less responsive.

    Case in point: a field programmable gate array was never intended for production use - yet every computer today uses these

    Case in point: how many Java programmers think about += string concatenation versus =+ string concatenation?

    While the K&R manual is correct that every complex problem can be further simplified by one more level of indirection, it is not true that there is no cost.

    Our computers today are 1000 times more powerful and solve the same problems as before. So what has changed? Our efficiency in coding as dropped and we are not using the resources at hand to make better solutions but sloppier ones that require less effort on our part but more computational overhead.

    We have become lazy and complacent and we call it progress. Until our programs can optimize to the level that we can generate by hand, I would not deem to consider our current state of programming languages an improvement in anything other than readability.

    1. Re:I call BS. Modern programming languages = bloat by networkBoy · · Score: 3, Funny

      #define unless(x) if(!(x))

      ^how to *really* piss off the Perl hater in your C development team.

      --
      whois gawk date unzip strip find touch finger mount join nice man top fsck grep eject more yes exit umount sleep dump
  6. Sounds fundamentally wrong by Archtech · · Score: 2

    If the assertion is that one language can be used for everyday purposes and also for specifying programs, it is hopelessly wrong. The merit of a programming language, like any other scientific specification, is that it is exact, precise, correct, and unambiguous. If it is easy to understand, that is a nice bonus - but it cannot be a high priority.

    Natural language, on the other hand, revels in deliberate ambiguity, multiple shades of meaning, and even saying slightly different things to different listeners. That's why synthetic languages like Esperanto never succeed beyond a small circles of fans: you can't write poetry in them, or even any stirring emotional prose.

    The purpose of programming languages is to eliminate doubt and ambiguity - to perfect communication. The purpose of natural languages, inasmuch as they have a single purpose, is to sell, seduce, persuade and - yes - confuse.

    --
    I am sure that there are many other solipsists out there.
  7. What kind of nonsense is this?! by the_skywise · · Score: 2

    Programming languages are "executable" now?

    Really...

    He's talking about interpreted vs compiled and interpreted languages have been around before C (BASIC anyone?!)

    And as others have posted COBOL made these same claims years ago.

    Expressive isn't necessarily better and really depends on your interpretation of such. It is far easier to "express" new hardware concepts/manipulations (like memory handling) in C than it is in Java. It is also easier to make "Expressive" code in C++ much to the detriment of most maintainers!

    Python and Java (like BASIC before them - and we're talking about the one with line numbers, not that MS bs) provide low barriers to programming - code, run, repeat. They're great for learning and beginners and to quickly hammer out program concepts. With faster hardware these days you generally can get away with the performance you get from these languages without having to transcribe them to a lower level language (C, Assembly).

    It used to be standard practice to write the algorithm in C then run the C parser to output the code directly to the assembly it was going to generate and then hand-tweak the assembly! That we don't need to do THAT anymore is a testament to the hardware and less to the languages used. (and in some cases because you can't anymore because the hardware is too disparate - IE phones)

  8. What a piece of crap by frovingslosh · · Score: 3, Insightful

    By executable the author actually means interpreted ..Any decent programmer knows this means the language is slower than need be. Translation is not a bad thing, it is another word for compiling and/or assembling, the process that converts human readable code into actual machine instructions. Any language could be compiled, but in practice some languages (for example C) are compiled (and assembled) while others (for example Basic) are typically interpreted. Interpreting makes the language slower, as a step that occurs one time in the creation of a compiled program before the program is ever run must now happen each time the program is run (and in many cases it happens each time a line of code is rerun, although there are "just-in-time" tricks that can avoid the repeated interpreting.). Interpreted languages are an unfortunate side effect of faster computers, people get lazy, want to not have to go through a separate compilation stem when making a simple change, and figure the interpreted language is "good enough" for the user, even though it means the program will run slower than need be each time every single user runs it.

    Interpreted languages have their place. Basic was a good introductory teaching language in its day, as it was intended to quickly let beginners write and test their code. But only the feeble minded would have tried to use it for production coding. There are great special purpose interpreted languages like AWK that are quite good for quick and dirty one time tasks. And I'm even saying all of this as being a Forth programmer who even was on a team that implemented a Forth on the C64. (Forth actually does a lot of the "compilation" when each line or word is written, but it is still inefficient as it spends most of its time in subroutine calls and returns). But interpreted languages will always sacrifice speed, and you can write a compiler to translate any interpreted language into true machine code (although in many cases it isn't worth doing).

    --
    I'm an American. I love this country and the freedoms that we used to have.
    1. Re: What a piece of crap by K.+S.+Kyosuke · · Score: 3, Informative

      I've read the article and I didn't notice any connection between "executable" and "interpreted" that you seem to be making. By "executable", the author very clearly means "executable". Executable means a computer can execute it, period. The mechanism is immaterial here. And had you actually read the article, it would have been obvious to you because of the contrasting comparison with pseudo-code example that *cannot* be executed - it's not something you can type into a computer in an unchanged form and still have it run.

      --
      Ezekiel 23:20
  9. Re:Hey, hey, hey, don't recycle the charter of COB by TWX · · Score: 2

    My dad was a COBOL programmer for more than 30 years, learned on an IBM System 36 in the late sixties and early seventies. He maintained that COBOL was very human-readable, especially compared to languages like C where something like

    for(;P("\n"),R--;P("|"))for(e=C;e--;P("_"+(*u++/8)%2))P("| "+(*u/4)%2);

    will clean-compile.

    If one considers the growth of business-computing, business has always been about what the nontechnical person can understand, as the nontechnical person is usually the business manager. That's in-part why nowadays everything is either GUI-only or at least has some kind of GUI presence whether it needs it or not, and why the web browser has found its way into tons of niches that it has no business being in. Back in the sixties though, GUI was not really possible, but languages with very easy to understand and follow terminology, used through a command-line interface or menu-system, would be possible.

    COBOL might well be the first piece of computing designed specifically to appeal to nontechnical managers.

    --
    Do not look into laser with remaining eye.
  10. That's an idiotic article by whitroth · · Score: 2

    Just from the quote.... Is that trying to suggest that C doesn't have functions?

    You can write good, modular code in almost any language. And I've *seen* spaghetti python, as well as enough other languages.

    And making the code clean and readable depends on the programmer, and whether they pay any attention to standards and best practices.

  11. Python sales pitch by OneHundredAndTen · · Score: 2

    Nothing much to see here - the author of the article is also the author of a book on Python and wants, understandably, drum up interest.

  12. Re:The Desk by Anonymous Coward · · Score: 2, Insightful

    Scientific American isn't what it once was. This as been going on for years. I speak as a long time (30+ years) subscriber. for at least the last eight years, through all the tenure of the current Editor and most if not all of the previous one, the magazine has been watering down it's presentation considerably.
    I suspect it all started when the Nature group bought it. They don't want a magazine that competes with Smithonian or Nature, they want it to compete more with Discover. So, few of the articles are now written by scientists, and more and more are written by journalists. The magazine is also no longer written for a community college audience, and more and more for a junior high school audience.
    You are treating this article as if written for a real programmer audience. It wasn't. It was written for teens who might be thinking about maybe someday perhaps trying to program a computer or something.