60
submitted 8 months ago* (last edited 8 months ago) by cosecantphi@hexbear.net to c/chapotraphouse@hexbear.net

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

you are viewing a single comment's thread
view the rest of the comments
[-] DamarcusArt@lemmygrad.ml 11 points 8 months ago* (last edited 8 months ago)

Assume I’ve never washed my penis before. Assume I’ve never wiped my ass.

Pretty sure the peasants bathed fairly frequently, it was the nobles that didn't, because they wanted to show off how little work they actually did that they didn't "need" to wash themselves.

Though I agree, trying to learn Python right now and it'll be giving me a bunch of code like:

class Item(store.object):
    def __init__(self, name, desc, icon=False, value=0, act=Show("inventory_popup", message="Nothing happened!"), type="item", recipe=False):
        global cookbook
        self.name = name
        self.desc = desc
        self.icon = icon
        self.value = value               
        self.act = act # screen action
        self.type = type # type of item
        self.recipe = recipe # nested list of [ingredient, qty]   

And just assume I already know what all of this does and provide 0 explanation on any of it, except for a couple of comments that don't help. Like yeah, "type" is going to be the type of item, but why are we def init here? What does that mean? Does it need the two underscores? Do they do anything different if I do one instead? Why are we organising things this way, is there another way, or is this the only way? No step by step instructions or education, just assumptions that I know what any of this means. I'm an artist, not a programmer dammit! I don't want to just copy-paste stuff and hope that it works, I want to understand it so I can expand upon it and actually Learn from tutorials!

[-] unperson@hexbear.net 13 points 8 months ago* (last edited 8 months 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.

[-] DamarcusArt@lemmygrad.ml 4 points 8 months ago

Thanks for that, I was more trying to make a point about how this "beginner level" tutorial isn't actually in the business of explaining things in a beginner friendly way and assumes a lot of pre-existing knowledge, but the documentation will be extremely helpful going forwards, I've asked for help from people in the past and this is the first time someone actually just linked the official tutorial to me. (I wonder if others were worried about being too condescending or something, because it's exactly what I've been needing to cross reference things and make sure I understand them.)

[-] unperson@hexbear.net 3 points 8 months 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.

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@lemmygrad.ml 8 points 8 months ago* (last edited 8 months 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.

[-] DamarcusArt@lemmygrad.ml 6 points 8 months ago

Thanks for that, I come here making a jokey complaint and people give very informative and helpful replies, it's great!

this post was submitted on 14 Feb 2024
60 points (100.0% liked)

chapotraphouse

13482 readers
933 users here now

Banned? DM Wmill to appeal.

No anti-nautilism posts. See: Eco-fascism Primer

Vaush posts go in the_dunk_tank

Dunk posts in general go in the_dunk_tank, not here

Don't post low-hanging fruit here after it gets removed from the_dunk_tank

founded 3 years ago
MODERATORS