3 ms·
Python is not exceptionally C-like, but a typical python script is readily understood by someone familiar with C. Smalltalk, on the other hand is not. This LOC
by dahfizz 6y ago
Python is not exceptionally C-like, but a typical python script is readily understood by someone familiar with C. Smalltalk, on the other hand is not. This LOC is from the wikipedia example page:
#($a #a "a" 1 1.0)
There's no way a C programmer can know what that means without looking it up.
- mumblemumble 6y agoThis comment makes me feel a little bit sad. It doesn't take too much breadth of knowledge to recognize those all as different kinds of literal syntax, even if you don't know the exact details. #(...) for some sort of collection, probably a list or vector, $a and #a for different kinds of atomic value, even if it's hard to guess whether any one of them represents a symbol, a character literal, a perl-style variable reference, or something else. If such prosaic syntax is really so unfamiliar-looking nowadays, it really speaks to a major gap in how people are taught about programming. Comparable to if it were common for younger mechanical engineers to not even recognize a slide rule when they see one.
- skohan 6y agoIs that a typical line of smalltalk? I mean if this is representative I can understand why C-like syntax won. Surely a language with descriptive names, and a call syntax resembling: subject.verb(arguments) Is more intuitive than the example you've given. Of course it's also quite possible to write an equally cryptic line of C code.
- scroot 6y agoNo, this is not a typical line of Smalltalk. That would be considered a very sloppy array indeed. I think it's just there to demonstrate the different literal notations in the language. Smalltalk is actually quite readable in practice, though the keyword syntax seems to throw off experienced programmers from other languages. It's worth noting that the language was originally tested on children, so it was also designed to be easy to read and learn. The equivalent of your C code above could be something like: MyObject doSomethingWith: anArgument
- PaulDavisThe1st 6y agoaka Objective C :)))
- arexxbifs 6y agoIf said C programmer has truly never seen or heard of anything but C, I'm sure a similar line of Python (and the end result) would seem quite confusing as well; ['a', ({1j}, {1: 1.0})]