“All the little bits”

  • Diplomjodler@lemmy.world
    link
    fedilink
    English
    arrow-up
    20
    arrow-down
    1
    ·
    5 months ago

    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.

    • kshade@lemmy.world
      link
      fedilink
      English
      arrow-up
      12
      arrow-down
      2
      ·
      edit-2
      5 months ago

      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.

      • pseudo@jlai.lu
        link
        fedilink
        English
        arrow-up
        2
        ·
        5 months ago

        You can’t except learning the science of abstraction by making it concrete. Exampled are not more than examples and if one field required abstract theory, it is indeed the mathematics.