Hacker News new | past | comments | ask | show | jobs | submit login
Fantastic Learning Resources (matklad.github.io)
205 points by ingve on Aug 7, 2023 | hide | past | favorite | 30 comments




Oh I love your stuff! Currently going thru the awk one


Thanks for the kind words!

I'm currently revising my awk book (expect to release by end of this month). You can check out the interactive TUI app (https://github.com/learnbyexample/TUI-apps/tree/main/AwkExer...) that I released recently.


Awesome! And I knew that sounded familiar…

> As mentioned before, I have several projects in my todo list. The next one I want to try is an app for interactive exercises for my ebooks.

From your textual TUI post, which I recently read as well haha


No matter how much we learn, the percentage that we know of the relevant total declines year over year. Focus on learning how to find specific answers without having to take on the burden of learning it all, and learning the deep truths that cannot help but be true. And on how to design systems that protect you from having to learn a lot, but let you keep a small number of things in mind, while you focus on solving your specific problem.


I understand why you say this, but there is some base amount of learning and practice that you need to do if you want to get a job as a SWE.


Crucial among them is the ability to combine googling and experimenting to get solid answers without having to go full monty on the framework/library/API that you are need to have work in a certain way. And knowing when to do that quick shallow hack vs. starting to step into the code in depth, and when to read the fine manual, or even, heavens above, to sign up for training/conventions/etc. on the ecosystem.


> We teach algorithms so that students learn to think about invariants and properties when writing code. ...To write correct, robust code at work, you need to think about invariants.

Dumb question, what are invariants? I've been writing code for about 15 years and I haven't heard this term.


The way I think of invariants is in less formal terms, but which I find helpful on a day-to-day basis. Often, we write code that manipulates state. It can be difficult to reason about code that manipulates state if we can't narrow down the possible states an object or struct can be in during execution.

Invariants in our code or design can help narrow down this space of possible states by ensuring that certain combinations are impossible.

For instance, assume I have an object that contains an array of integers and a boolean called `hasNegatives` which should be true if and only if the array contains at least one negative integer. If the boolean can be updated or set independent of the array, then the object can't really guarantee that the array and `hasNegatives` will always be "in sync" so to speak.

If your code promises to maintain that invariant (by, for instance, making `hasNegatives` read only and privately updating it when the setter for the array is called to match what's inside the array) then when using this object or seeing an instance of it elsewhere in the code you can happily use it with confidence knowing that the field is always correct with respect to the array within.

Obviously, this is a simplified example, but when applied to an object with many fields, knowing that only certain valid combinations are possible can radically simplify the rest of your code that interacts with that object.


Essentially a constraint that is true about the variables, which helps you reason about the code.

A good example is:

// Invariant: x[i-1] < target, x[j] >= target.

In the golang implementation of binary search:

https://github.com/golang/go/blob/master/src/slices/sort.go#...


I wish I could upvote this more than once. Not only because of the clear first line, and the inline example, but especially because you linked to a specific function in a real code base.


> Dumb question, what are invariants?

The term that you want to Google or ask ChatGPT is "Design By Contract". An invariant is something that is true during the lifecycle of a class, function, loop, service, system, etc. Invariants, preconditions, and postconditions are the three primary constructs in DbC.


Thanks. I asked ChatGPT about the relationship between invariants and Design by Contract: https://chat.openai.com/share/dd2313ac-6088-455c-9d03-01795e...


In computer science, an invariant is a logical assertion that is always held to be true during a certain phase of execution of a computer program. For example, a loop invariant is a condition that is true at the beginning and the end of every iteration of a loop.

https://en.wikipedia.org/wiki/Invariant_(mathematics)#Invari...


Sounds really Platonic — like, a loop invariant maintains the Platonic form of a loop?


IIRC invariants are pre-conditions and post-conditions, the context/state before and after an instruction/function is executed.


The three books I recommend are these: {0,1,2}. The first two are best read together and maybe sprinkle in a bit of [2]. If you are on Linux or Mac then the last one obviously has to be substituted for something else.

[0] https://deitel.com/c-how-to-program-8-e/

[1] https://en.wikipedia.org/wiki/Code:_The_Hidden_Language_of_C...

[2] http://www.charlespetzold.com/pw5/


Relearning C has been on my todo list for a while so your suggestions are appreciated. The first book's writer took an interesting approach to sharing the book's accompanying source code though :P

https://github.com/pdeitel/CHowToProgram8e


Anybody have anything like a "hall of fame" for easy-to-read beautiful working code?


The book "Beautiful Code", maybe?


I know this is Hacker news but it would be more helpful if the title is changed to "Fantastic Learning Resources for Programmers"

no?


> I know this is Hacker news

And honestly given the interest in topics unrelated to programming, I don’t think it’s implied at all so agree on the specification


loved this as someone looking into a career in product and wanting to understand engineering better.

will def look more into Ted Kaminski's blog.

any advice on how deep should I go?


Is there something similar for kids? I'm thinking under the age of 9 and haven't learned multiplication yet.


How could you write that title and not add "...and where to find them"?!


Anybody got one for IP networks, firewalls and network security?


I’m sure there are better/free resources, but 30 years ago I got my jumpstart on those topics via what was then the UNIX System Administration Handbook

https://browse-prod-us-east-1.pmc.pearsonprd.tech/en-us/subj...


That does look like a serviceable intro to those topics and fantastic in total though. I think I'll get myself a copy of the latest edition. I recognize the design, but I've never looked more closely before. Thank you!


a look back at one of the authors, Evi Nemeth: https://blog.adafruit.com/2018/07/27/remembering-evi-nemeth-...


This list is fantastic.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: