If the Handmade Hero series has taught me anything in its first week, it is that it's very much possible to build directly using system libraries if you wanted to. Without having to use other libraries that make it easier for you to use. In the last couple of weeks I've been able to print stuff into an X11 window and this morning almost got audio working with Alsa. Before I started the series I made the mistake of looking up others' experience trying to follow handmade hero in Linux. It was a mistake because it made me think that X11 was going to be really difficult and buggy and that I shouldn't even try it. There was a large explanation as to why as well. I figured he'd tried it out and did not want others to make the same mistake. Yet when you follow Handmade Hero, you'll notice that Casey uses nothing except the Win32 API to get the window going. Same thing when he wants to get audio working. So I decided to stay true to the ethos of Handmade and try out X11. To my surprise, even though it took me a couple of days to get a window to open, once I did it wasn't very difficult to get going. There is not a lot of help online for Alsa and X11 which forced me to read the docs and find stuff out for myself. Which is slower but once I got the hang of it, perusing through the Alsa docs was much faster. In just about two hundred lines of code I have audio and window working. It needs some cleanup but still that can be done in the future and over time I'll have a starter for anytime I need one.
If anything it's given me the confidence that I too can build stuff if I wanted to. Build stuff that excites me and seemed quite out of reach before. Like a game. I know I'm getting ahead of myself but so far I absolutely love the series.
Audio jump scare
Even though I was expecting it, testing audio was quite scary. It's something I've experienced second hand when others work with it and it goes wrong. First hand it's quite a different beast. It got me every time I tried to play audio but after a while I was so happy that I got audio working that I did not even care. Anyway tomorrow we are going to be playing a sine wave and I'm hoping it's a lot more pleasant to hear.
Why program in this uncertain future of programming?
Now I don't have a clear answer to this. As I have no idea how things are going to play out. I'll say this much. The AI stuff is really good. At the same time the last few months I've had so much fun simply programming I cannot explain it. I got to experience a small level of competence and it was exhilarating. I've always dreamed about being half as good as I am now. Reality is way better. If you like me do enjoy programming, give it a go. See what you can do. I know the AI can do it but let's put the outcomes aside for a minute and just enjoy the craft of programming. As long as you have a computer you are free to build anything you wish. That sounds fucking good to me. You can choose to solve any strange problem you choose to. Most of all the feeling of understanding something that you thought was way beyond your capabilities is unexplainable. You should try to experience that at least once in your life. Programming is hard and the temptation to jump to an AI for an answer is tempting. Which I think makes it even harder. Simply because if there is an easier way most of us will take it.
I use AI when I'm working on a deadline but the early hours of the morning where I spend time on building things I want out of curiosity and for fun I try to avoid getting the answers as much as I can. Just wanted to put it out there.