News for hackers. Stuff that matters.
Re:Anic -- Faster than C, Safer than Java, Simpler than *sh by jameskilton on Friday November 12, 2010 @02:07PM (#1898755)
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.

Re:Anic -- Faster than C, Safer than Java, Simpler than *sh by endtime on Friday November 12, 2010 @02:15PM (#1898797)
I'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.
Re:Anic -- Faster than C, Safer than Java, Simpler than *sh by groby_b on Friday November 12, 2010 @02:27PM (#1898858)
That 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.

Re:Anic -- Faster than C, Safer than Java, Simpler than *sh by mikeklaas on Friday November 12, 2010 @06:44PM (#1899732)
I 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.

Re:Anic -- Faster than C, Safer than Java, Simpler than *sh by shadowfox on Friday November 12, 2010 @07:06PM (#1899791)
> 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

Re:Anic -- Faster than C, Safer than Java, Simpler than *sh by pygy_ on Saturday November 13, 2010 @03:36AM (#1900578)
I 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.
Re:Anic -- Faster than C, Safer than Java, Simpler than *sh by frozenflame on Friday November 12, 2010 @03:52PM (#1899237)
I don't know that I agree, I really am not sure what "GIVING COBOL" means.
Re:Anic -- Faster than C, Safer than Java, Simpler than *sh by a-priori on Friday November 12, 2010 @05:05PM (#1899486)
It'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.)

Re:Anic -- Faster than C, Safer than Java, Simpler than *sh by groby_b on Friday November 12, 2010 @05:07PM (#1899494)
It'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++ :)

Re:Anic -- Faster than C, Safer than Java, Simpler than *sh by hetman on Sunday November 14, 2010 @09:34AM (#1903273)
Really? I've never coded in COBOL and it was pretty obvious straight away that it was an assignment.
Re:Anic -- Faster than C, Safer than Java, Simpler than *sh by Tycho on Friday November 12, 2010 @08:13PM (#1899919)
Allegedly in the 80s software vendors sometimes advertised that their products were programmable/extensible in plain English. By which they meant BASIC.
Re:Anic -- Faster than C, Safer than Java, Simpler than *sh by endtime on Friday November 12, 2010 @04:43PM (#1899407)
I wasn't responding to a comment on language quality, I was responding to a comment on language readability.
Re:Anic -- Faster than C, Safer than Java, Simpler than *sh by groby_b on Friday November 12, 2010 @05:09PM (#1899507)
Yes, 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.
Re:Anic -- Faster than C, Safer than Java, Simpler than *sh by M1573RMU74710N on Friday November 12, 2010 @06:48PM (#1899744)
>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).

Re:Anic -- Faster than C, Safer than Java, Simpler than *sh by wvenable on Friday November 12, 2010 @03:52PM (#1899236)
That'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.