3 ms·
I find Norvig’s style of Python a bit odd as it diverges from PEP-8ish style I’m accustomed to. Nothing wrong with it but he’ll redefine things, put functions o
by wirthjason 5y ago
I find Norvig’s style of Python a bit odd as it diverges from PEP-8ish style I’m accustomed to. Nothing wrong with it but he’ll redefine things, put functions on one line, etc. The good thing is that I challenges my understanding of what you can do with the language and how simple and expressive it can be.
For example I found this line of code cute. So much going on — no function definition, just a string literal method being assigned to a name (which any Linux programmer would get but a windows one may not).
cat = ''.join
- globular-toast 5y agoAs a Python and Linux user for more than ten years that kind of thing gives me pause. It's great for recreational code as it expands the mind, but terrible for professional code. Idiomatic usage is really important in professional code. You want it to be like Cypher looking at the Matrix; "I don't even see the code, all I see is function, loop, conditional".
- BenFrantzDale 5y agoI like that Python let’s you name `’’.join`. I’ve done the same thing creating a linear form: `f = x.dot`.
- marai2 5y agoAnd j = json.loads For quick debugging: print( j( some_data_structure )) For some data structure that you'll eventually be sending out as json.