5 ms·
Am I the only one thinking this code looks ugly and hacky. I would never code in this.
by CoryMathews 16y ago
Am I the only one thinking this code looks ugly and hacky. I would never code in this.
- jameskilton 16y agoFrankly 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.
- Rusky 16y agoIf you can get past the syntax it's a lot nicer. They remind me of unix command-line tools, but on a much finer-grained level and without all the useless parsing and un-parsing.
- nathanwdavis 16y agoI think what you're trying to say is "it doesn't look like my favorite programming language". Never mind that it also is designed with completely different paradigms than what you are accustomed to.
- mcs 16y agoI've been writing a lot of unix system tools that deal with stream in Node.JS. This might replace some of them.
- Groxx 16y agoI don't know... I kind of like it. It's different, especially where the '\' is concerned, but the syntax as a whole has one thing I really really really like: Much of the language doesn't use the shift-key, especially in the number-row. And where it does, it's frequently on easier-to-hit keys like '<' or '{'. There are still parenthesis, but they appear to be used far less frequently than, say, C. Besides. You want ugly? Try K: http://en.wikipedia.org/wiki/K_(programming_language) http://en.wikipedia.org/wiki/K_(programming_language) . Or, heck, anything APL influenced.
- chrisaycock 16y agoAPL, k, and similar languages are terse. No need for loops, verbose variable/function names, etc. It's far more productive. Plus, since all actions are based on arrays, the compiler can very easily target vector processors (including SSE) and make cache-effecient memory allocations. And since the language is small, the interpreter is usually small enough to fit in L1 cache.
- Groxx 16y agoOh, they make sense, I have nothing against the language itself. It's just a special kind of ugly to anyone who's not fluent in it. I dare say it's worse than even regex.
- binaryfinery 16y agoLooks ulgy and hacky. But OTOH is mind bogglingly fast on multicore processors (i.e anything bigger than an iPhone). I think its just become the basis of my next project.
- Florin_Andrei 16y agoIt's not uglier than Perl. Can't be.
- nitrogen 16y agoI think it would make an excellent backend for a visual programming language. I've developed a simple data flow-based system that I use for home automation, and could see using something like this to replace my current "interpreter." Imagine something like Yahoo Pipes or Pure Data compiled directly into parallel code. Granted, tasks which have a natural sequence can be a lot more difficult in dataflow-driven languages, so use whatever works for a given situation.
- dkersten 16y agoActually, that is something we've discussed on the mailing list (I've been on the list since the last time this was posted to HN) and its something I'm personally interested in building once the compiler and runtime are far enough along. Dataflow-based visual programming is something I've been very interested for a while now and is even partially related to my startup stuff, so its something close to my heart.
- reinhardt 16y agoClassic Blub programmer reaction; extra bonus for dismissing a language just because of unfamiliarity/dislike of the syntax.