I often find that I find mathematical concepts much easier to understand if they’re presented as Python code rather than math notation. Someone should write a book like that.
Algebraic notation breaks just about every rule programmers are taught about keeping their code human readable. For example:
Variable and function names should be descriptive
Don’t cram everything into one line
Break up large statements
Consistency is key
Don’t be fancy for fancy’s sake, don’t over-optimize (this is for learning, remember?)
Add in-line comments for lines that aren’t easily grasped
Be explicit where possible (it’s a convention to omit the multiplication operator when multiplying variables because variables are only one letter anyway…)
And then we force kids to cram the whole stdlib (or rather its local bastardization) into their heads or at best give them intentionally bad (uncommented) documentation during exams while wondering why so many just don’t seem to get it, even resent it.
This was so much me with the concept of generalized Cartesian product. All the class was very confused with that topic, until a bright classmate pointed-out a relationship of that concept with Python list and it started to do so much sense.
I often find that I find mathematical concepts much easier to understand if they’re presented as Python code rather than math notation. Someone should write a book like that.
Algebraic notation breaks just about every rule programmers are taught about keeping their code human readable. For example:
And then we force kids to cram the whole stdlib (or rather its local bastardization) into their heads or at best give them intentionally bad (uncommented) documentation during exams while wondering why so many just don’t seem to get it, even resent it.
Very well put.
This was so much me with the concept of generalized Cartesian product. All the class was very confused with that topic, until a bright classmate pointed-out a relationship of that concept with Python list and it started to do so much sense.
Removed by mod