Handmade Network»Forums
117 posts
Code hacker/developer
Handmade Guideline
Edited by Todd on
So I'm new here and although I strive to be as handmade as possible, I'm wondering what a few general guidelines would look like for a beginner handmade dev? I've read the manifesto several times and I love every single line of it, but I just need some guidance in terms of what would you say a "handmade project" consists of.

For example, any libraries allowed to be used at all? For example, if I want to make a GUI in C do I need to write my own GUI library first and then make the application? Or are there some basic libraries which can be used in a handmade project? If the former is the answer, any links/resources to how to write a GUI library in C would be very appreciated. But this of course applies to all dev in general, is the goal to literally not use any other provided code or is it basically to use a few abstractions and dependencies as possible? Please excuse my ignorance but I come from the world of using 15 packages per project on C# web development projects (which I hated doing btw), so I'm new to this.
Mārtiņš Možeiko
2559 posts / 2 projects
Handmade Guideline
You can use whatever you want really.
My C++ profiler uses Qt for GUI :)
117 posts
Code hacker/developer
Handmade Guideline
Edited by Todd on
Awesome, thanks. Yeah nobody should worry, I definitely won't be loading up my project with unnecessary dependencies... I HATE THAT with a passion. I feel like it hinders maintainability and damages performance big time... For example, in web development, JavaScript has a pretty lousy/outdated GET/POST/PUT/DELETE (REST) interface, so most front-end web developers end up using jQuery's AJAX functions to do these requests... But what's crazy is they load a 10,000+ line file to do this when they are only using this tiny, tiny part of it... This to me is INSANE and that probably isn't even the best example.

It seems though that outside of web dev, especially in C and C++, the bigger libraries such as Qt and Boost are much more tried and true. Do you have any recommendation for a C-specific GUI? All I've heard of is something called GTK+.
Mārtiņš Možeiko
2559 posts / 2 projects
Handmade Guideline
There are no good cross platform library for native looking GUI in C.

There are some that are rendering in imgui style, but they won't look native. For example: dear imgui (C API). Or nuklear.

If you don't care about cross platform then you can use native Windows API for UI - it's C.
@Mattias_G
42 posts / 1 project
Amateur (ex-pro) game dev, making retro styled games and small public domain C/C++ libs.
Handmade Guideline
Edited by @Mattias_G on
At least for me, "handmade" is more a mindset than a set of rules or even guidelines. I think the important thing is to make a conscious choice about your code and your dependencies, rather than just blindly adopt popular libraries.

For me personally, it doesn't mean not using libraries, but it does mean using only libraries which meet the criteria I have set up - and if I can't find a library which does that, I will write my own. For me, in my domain (games) it means I only use libs which are self contained (they have no libraries which they, in turn, depend on). The must be single header libs (like the stb libraries), or possible for me to reasonably convert to single header libs myself. They need to have a very permissive license - ideally public domain, but sometimes I'll settle for something like MIT. They must allow me to overload memory allocation functions. They can't rely too heavily on OOP mindset. They need to be focused, as in doing only one thing (or a couple of related things).

Those are MY criteria, and I am often unable to find libraries which does meet all of them, which means I write a lot of it myself. But when I do find some that fits, like the stb libs, I do not hesitate to use them.

So I think if you look at your domain, and you decide on which criteria are important for you to maintain the level of quality and structure that you feel is necessary, then it shouldn't matter if you use an existing library instead of making your own. I would still consider your product to be "handmade".


As for the specific issue of a native GUI lib, I'm afraid I don't know of any. But I do think that it can be ok, depending on your application, to code directly to, for example, the windows GUI api, especially if you don't need to develop on multiple platforms. Sure, it will mean a bit more work when/if you port it to other platforms, but then again, you won't have to fight an abstraction layer which tries to hide the details of your native environment....
Dane Christenson
6 posts
Working as a carpenter while I learn, taking night courses for the paper, known on twitch and irc as supershocker75
Handmade Guideline
I would say a lot of the mentality is to minimize dependencies and abstractions and to just think about what you're writing and how you're writing it. Be critical of your assumptions and don't do anything because it's the way it's always been done. From my observation there are no real hard and fast rules though. More of a general philosophy.
117 posts
Code hacker/developer
Handmade Guideline
Awesome, thanks for this information! I feel the same way about software... But as I am still pretty new, I am still in my "molding" phase as a developer. But coming from web dev, good GOD I try to avoid dependencies and unnecessary libraries like the plague. I got so sick of fighting with that crap that its literally made me want to write everything from scratch in C haha.