4 ms·
That's not the point of programming languages. The point of programming languages is to be more productive, it has nothing to do with natural language. In fact,
by smabie 7y ago
That's not the point of programming languages. The point of programming languages is to be more productive, it has nothing to do with natural language. In fact, natural languages are a poor fit for programming languages (see Cobol).
- ben509 7y agoCounterpoint: SQL is incredibly successful and its syntax uses natural language structures quite heavily. The problem Cobol has is that uses some natural structures, but then becomes very verbose because it only uses a few, and they often can't be combined, so it is very repetitive. It's not natural to say, I will buy eggs at the grocery store. And I will buy ham at the grocery store. And I will buy cheese at the grocery store. > The point of programming languages is to be more productive... But you should be productive not only in initially writing the code, but also in reading it later when you do maintenance. And what you see with most languages is extensive commentary to help future authors understand what's going on, and that's partly because terse languages tend to be cryptic.
- strbean 7y agoI get anonymously downvoted to hell whenever I post this, but SQL is an absolutely awful language. Fundamental aspects like consistent representation of the same semantics in different places are missing in the very core of the language. The ubiquity of SQL generators is a sign of how little most people want to work with it, and a major reason we haven't jumped ship.
- ken 7y agoIn my experience, SQL is successful despite its syntax, not because of it. Wasn't it originally intended to be an end-user interface? It's failed at that. Now even programmers choose to use an ORM to insulate themselves from it. Even the programmers I know who don't use OO still use an abstraction library to avoid the need to touch SQL directly. SQL isn't even one language. It's a family of incompatible dialects. I've never written more than the most trivial SQL that would even be valid (much less the same result) on any other SQL dialect. Even though it has ISO and ANSI standards, every database in the world requires proprietary rules and conventions and extensions. How do you quote identifiers? Are strings case sensitive? Is '' the same as NULL? How do you create an index? What data types are there? We can't even agree on the most basic aspects of syntax. It's "incredibly successful" in the same way that early HTML and JS was. People wanted access to the underlying platform so badly they'll put up with a nutty design and gratuitous incompatibilities. They don't really have a choice, and many are going out of their way to build their own alternatives because the vendors won't.
- okareaman 7y agoI wasn't advocating programming in natural language. Much too ambiguous. I'm saying "closer" to natural language so our cognitive load is reduced reading and writing in the language so we can focus on what matters - to be more productive as you point out.
- AnimalMuppet 7y agoThere was an attempt to do so, so that professional programmers would be unnecessary. The result was COBOL. I don't want "close to natural language" because it's too verbose. It's like reading an article in The New Yorker - it takes so long to get anything said that you forget what the point was. Of course, "too terse" isn't the answer either. There's a sweet spot. I suspect that the sweet spot varies, depending on the person and the kind of code.
- okareaman 7y agoI'm not sure why ppl are misunderstanding what I am saying. I'm not advocating COBOL-like languages. I'm saying assembler is better than writing in machine code, C is better than assembler and it would appear for most programmers, Python and JavaScript are the best choice but nobody who wants to keep their job writes code in the style of minified JavaScript or obfuscated C.
- eggy 7y agoTo some APL and J are the equivalent of C to assembler. It is not obfuscated, it is concise: brief but comprehensive, and easy to understand if you take the time to learn it like you would other PLs. I think Ken Iverson's "Notation as a Tool of Thought" covers this pretty well [1 PDF]. [1] http://www.eecg.toronto.edu/~jzhu/csc326/readings/iverson.pdf http://www.eecg.toronto.edu/~jzhu/csc326/readings/iverson.pd...
- okareaman 7y agoThank you, that's a fascinating article and I'm going to finish reading it, but I'm ot arguing against languages that are designed to be terse and expressive to a certain mode of thought, but rather languages like JavaScript that are not designed to be terse and are deliberately made so at the cost of readability. I just don't find it interesting. It does not follow that the resulting machine code is faster or smaller, so I don't see the point beyond playing a game with language.