32 ms·
Python does encourage the perspective that there is a single right way to do things. This isn't necessarily true at the high-level, but at the low level of a ha
by fusiongyro 8y ago
Python does encourage the perspective that there is a single right way to do things. This isn't necessarily true at the high-level, but at the low level of a handful of lines, it often is true.
Like Hillel, I have often thought that my solution to a problem in J was good, only to see much shorter solutions from prominent J programmers. What makes it shorter is usually that there are direct but less obvious ways of doing things using the primitives. I have the experience of having a first look at things like grade-up and remembering it as a way of sorting, but when you see the various ways that grade-up is used in practice, there are a lot of uses for it that do not strictly have to do with sorting. This is in contrast to Python where lists can be sorted and that's all sorting does for you. I frequently forgot about the match builtin and would do convoluted things like equals with rank (0 1) and insert-equals or sum. There's more than one way to do things, but often beginner code is obviously worse.