7 ms·
Frankly there isn't a language in existence that's "easy to read" and I'm kind of sick of seeing that claim. There's no way you can read anyone's code without k
by jameskilton 16y ago
Frankly there isn't a language in existence that's "easy to read" and I'm kind of sick of seeing that claim. There's no way you can read anyone's code without knowing at least something about the language.
That said, I really like the ideas this language is offering and I'm definitely interested in giving it at try.
- endtime 16y agoI'd argue that Python is very easy to read for someone new to programming, particularly someone familiar with mathematical notation. Something like: for animal in ['dog', 'cat', 'bear']: print animal strikes me as intuitive and obvious, both absolutely and also relative to the equivalents in other languages.
- groby_b 16y agoThat is not necessarily a sign of a good language, though. ADD 1 TO COBOL GIVING COBOL is also readable, and yet (thankfully!) we've mostly abandoned COBOL. And no, I'm not saying Python is bad, or like COBOL - just that readability and quality of a language are not necessarily related.
- frozenflame 16y agoI don't know that I agree, I really am not sure what "GIVING COBOL" means.
- a-priori 16y agoIt's the assignment part; it says where the result should go. In this case, back to the "COBOL" variable. But, it's optional if you're assigning back to the source: ADD 1 TO COBOL means the same thing as ADD 1 TO COBOL GIVING COBOL. But, you can also do ADD 1 TO COBOL GIVING FOOBAR to assign it somewhere else. (Yes, I just spent the last 10 minutes reading the COBOL pages on Wikipedia and Wikibooks.)
- groby_b 16y agoIt's a COBOL joke. (And a bad one at that) ADD 1 TO X GIVING Y is COBOL's way of saying y=x+1 ADD 1 TO COBOL GIVING COBOL is COBOL=COBOL+1. Or COBOL++ :)
- hetman 16y agoReally? I've never coded in COBOL and it was pretty obvious straight away that it was an assignment.
- endtime 16y agoI wasn't responding to a comment on language quality, I was responding to a comment on language readability.
- groby_b 16y agoYes, but the GP was commenting that they'd never code in that, given the "ugliness". I'd love to reply to both posts as a set, but alas, it doesn't offer that.
- mikeklaas 16y agoI don't think that "englishy" (COBOL, applescript) code is readable, and I bet many programmers agree. Python is readable because its syntax is very close to many people's version of pseudocode. This is why non-Python programmers find it easy to read.
- shadowfox 16y ago> Python is readable because its syntax is very close to many people's version of pseudocode Or at least that is what Python developers seem to believe
- pygy_ 16y agoI find Applescript quite readable, especially for its purpose, but it's a pain to write, because, unless you use it often, you never know which subset of English is valid.
- Tycho 16y agoAllegedly in the 80s software vendors sometimes advertised that their products were programmable/extensible in plain English. By which they meant BASIC.
- M1573RMU74710N 16y ago>I'd argue that Python is very easy to read for someone new to programming I'd agree that programming languages do have various levels of "readability", and that Python is better than quite a few... However I think the poster has a point. Someone familiar to programming concepts and new to Python could probably read that...but so could they read the equivalent statement in most languages. Someone completely new, and reading only that statement? I'm not convinced.... It seems obvious to you because you know it already. As a newbie, I could see that as assigning an entire list to animal and then printing it...or even other things. I wouldn't be sure what the : was about Additionally I think a similar for loop in any language will be basically just as readable to a complete newbie...in fact some may find a c-style for loop more readable. For example, do you really think a newbie will understand this: def __gen(exp): for x in exp: yield x**2 g = __gen(iter(range(10))) print g.next() Sure, it's pretty easy to understand once explained ...but so are most languages. It's obviously more readable than a Perl one-liner, and Python has properties that cause it to generally be more readable than many other languages....but I think the point about programming languages overall being "not so readable" stands. This makes sense though, as generally what people seem to mean by "readable" is "looks like English/forms a narrative"...and those often don't fit with what a computer program is (though sometimes they do).
- wvenable 16y agoThat's not really true since most languages are some what similar with some what similar constructs. Anyone who can read C, can read a multitude of other languages pretty well and figure out, just from the source code itself, the meaning of any unknown constructs.