I really wish programming tutorials for absolute beginners were exactly like that. Like please program my dumb ass to learn programming.

Ideally a tutorial would Just assume I know nothing at all. In fact, assume I’m some medieval serf from 1320, motherfucker. Assume I’ve never heard of a computer before, never mind used one. Assume I’ve lost two dozen children to the plague, scurvy, smallpox, and conscription into wars with neighboring fiefdoms. Assume I’m currently imprisoned in the oubliette for hiding grain under my floorboards. Assume I speak in such a thick accent from bumfuck nowhere that it is entirely unintelligible to both contemporary nobility and modern English speakers alike. Assume I’m illiterate. Assume I’ve never washed my penis before. Assume I’ve never wiped my ass.

I’m talking about a tutorial that involves a thorough description of each and every click of the mouse. Rigorously define every single word that has programming relevance. Leave no stone unturned, if you’re even slightly vague about any step I guarantee you I will fuck it up! It’d be sick as hell if such a lesson plan existed for every common programming language

    • unperson [he/him]@hexbear.net
      link
      fedilink
      English
      arrow-up
      13
      ·
      2 years ago

      Python in particular is very well documented. There are two levels, the official tutorial that glosses over stuff and presents things conceptually, and the reference that tells you exactly what is happening and what the syntax does.

      That whole chapter about the data model is really useful when you try to do anything fancy with Python. It’s all in one page so you can Ctrl-F all the arcane definitions.

        • unperson [he/him]@hexbear.net
          link
          fedilink
          English
          arrow-up
          3
          ·
          2 years ago

          I doubt they worried about being condescending, lots of people fear that the official documentation will be too difficult and never read it. The logic is that the docs are arcana written by witches that know how to write programming languages, and the tutorials are written by regular girls that had to struggle to understand the language instead of the syntax just appearing on their heads.

          I pretty much learned how to program from the official Python tutorial. I had been struggling for years before that; I had some notions but I couldn’t put together anything really useful. The Python docs got me over the hump precisely because of what OP said: it starts from 0 and builds up until you have enough tools to write whatever project you have in mind. I imagine that having had to design and reason everything about the language actually gives the writer a great sense of how it fits together and what the logical increments are.

          Since then I always go first to whatever the language designers wrote; for example K&R’s The C Programming Language, the Rust book, the Postgresql manual, etc, and only once I feel that I know enough I complement it with other sources.

          This approach extends to libraries as well: first I read whatever official docs there are, then I search the source code for the functionality I need to learn about, and only if that fails I look elsewhere.

          It seems like a slow method but it’s so reliable that it works out for me. After a while of doing this you become the reference and people come ask you questions.

    • macerated_baby_presidents [he/him]@hexbear.net
      link
      fedilink
      English
      arrow-up
      9
      ·
      2 years ago

      I will say, there’s some amount of rote behavior in every programmer. There’s too much stuff to learn. Eventually you will import a library and call someFunction(), and you won’t investigate how it works until it stops working (hopefully never). Good tutorials strike a balance between excruciating explanatory detail and rote instruction-following. Sometimes you just want to set up the stupid npm package and get to programming. For Python specifically, I’ve heard good things about Automate the Boring Stuff.

    • Shinhoshi
      link
      fedilink
      English
      arrow-up
      8
      ·
      2 years ago

      Yes, the two underscores actually do matter. This method is a special method called a constructor and it’s supposed to initialize all the variables of a class. The method you showed is boilerplate code because it initialized all the values to the parameters passed in.

      If the method was called anything other than __init__, it would not be a constructor.