3 ms·
From the processing wiki http://wiki.processing.org/w/Python_Comparison http://wiki.processing.org/w/Python_Comparison: Python: a = [5, 10, 11] if c >= 1 and
by aimatt 14y ago
From the processing wiki http://wiki.processing.org/w/Python_Comparison http://wiki.processing.org/w/Python_Comparison:
Python:
a = [5, 10, 11]
if c >= 1 and c < 20:
# Statements
Processing:
int[] a = {5, 10, 11};
if ((c >= 1) && (c < 20)) {
// Statements
}
Python seems much more English-like and doesn't require the beginner to figure out and memorize what && means or that you have to memorize all the types or at least the ones you want to use for an array and where the brackets go when using an array. I program C and Wiring and early on I remember that I always had a hard time figuring out where the brackets go and whether I needed an array of doubles or float or integers, depending on what I need to do. Also they should warn you, you need to know how many elements are in the list beforehand and you can't resize them later.
The author of the article reminds me of a guy I worked with who still programmed in FORTRAN and said the use of whitespace to denote blocks seemed "icky" and hates it. Just keep an open mind and you'll do a lot better than him in the industry. He is out of work these days...
- RodgerTheGreat 14y agoI don't think it makes very much sense to evaluate a programming language for beginners on the basis of how "English-like" it is. Boolean operators, to reference your example, have a considerably more precise and restrictive meaning in both languages than the word "and" does in English. Sounds like misplaced skeuomorphism to me. If anything I've found that the apparent (and shallow) similarity to familiar concepts interferes with learning, rather than helping.
- KC8ZKF 14y agoI think it is a stretch to call "and" a skeuomorph. If a skeuomorph exists, it exists in Boolean algebra, because that is the word George Boole used.
- afhof 14y agoThis is a poor example since python can chain the comparison: if 1 <= c < 20: # statement I think this is more intuitive for someone first learning a language.
- alexchamberlain 14y agoIt is certainly more intuitive to a scientist.