Hello! I’m looking for book recommendations for learning programming fundamentals.

To be clear, I’m not necessarily looking for a book on learning language(s), but rather, programming, theory I guess you might call it?

For example, I’ve been playing around a lot in my terminal writing bash scripts, and I just implemented my first function. Another example, I know the phrase “Object Oriented programming”, but have no idea what it means.

I learn well by doing, and I’ve learned a lot just writing scripts and reading about bash scripting, but I also realize there’s a lot about programming at a higher level that I know nothing about.

  • palordrolap@fedia.io
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    2 months ago

    95% of all “Introduction to <whatever programming language>” books tend to dedicate the first couple of chapters to the fundamentals but with a specific bias towards the language in question. Seek out a few of those at a library or online equivalent and you’ll start to see patterns cropping up.

    Anything that doesn’t have that bias is likely to use pseudocode which looks like a programming language anyway.

    Object orientation works around the concept that things in the program “know” things about themselves and how to do things for themselves rather than have some other part of the program do things to them. Commonly you’ll see things like doSomethingWith(someObject) being the non-OO way and someObject.doSomething being the OO way. That is, in the latter someObject contains the knowledge of how to doSomething, and the dot notation urges it to do whatever it is.

    For a silly but more concrete example, x ← 2 + 2 is non-OO, but x ← 2.add(2) is at least partially OO because the first 2 is expected to know how to add another 2 to itself and give out the correct answer. Presumably in whatever language that is, someone has created a method for numbers to know what to do when told to add. The other 2 doesn’t really get a say in things. We might also have, say, elephant.putOn(hat), but it might not be possible to hat.putOn(elephant) because no-one thought to teach the hat how to wear things, let alone elephants.