3 ms·
// CPY loop to iterate from a down to b, c at a time for i a b -c // For comparison: pure C++11 and boost for(auto i : irange(a, b, -c)) After
by quietbritishjim 9y ago
// CPY loop to iterate from a down to b, c at a time
for i a b -c
// For comparison: pure C++11 and boost
for(auto i : irange(a, b, -c))
After CPY removes redundancy to this extent, sure there's still enough information for a compiler to parse this, but there's not enough information for me to parse this. Remember that you spend a lot more time reading code than pressing buttons on the keyboard, so the number of characters you need to type is pretty irrelevant to your productivity.
Maybe I'm getting too caught up on the name, which suggests a Python-like experience, which CPY definitely not. If anything it is less like Python than C++! Sure it has the indentation vs braces thing, but that is probably one of the least important reasons why Python is so readable. A more important reason is the excellent visual cues in the syntax, and forcing you to spell things out e.g. with named parameters; "explicit is better than implicit". CPY seems to strip out visual cues, as shown above, by its four print functions that are cryptically called !, !!, ? and ??, and by the fact that it's even harder to spot function declarations in CPY than in C++.