Register
handmade.network»Wiki»How to write better (game) libraries
#21953 mmozeiko Dec. 8, 2019, 9:16 a.m.

I think this is really bad article for wiki. It is full of personal opinions and preferences.

It more belongs in personal blog or similar.

Did you post it here for only for linking it on HackerNews and/or getting useless karma points on HN?


Edited by Mārtiņš Možeiko on Dec. 8, 2019, 9:16 a.m.
#21954 zhumpel Dec. 8, 2019, 11:19 a.m.

You can express your dissatisfaction without descending to personal attacks and unsubstantiated innuendos.

With regards to the core of your comment - I completely disagree. I've been doing C library development for a long while now and every single item on the list is spot on. This is a fantastic article. This is basically what the library development guidelines look like after you hit all the rakes and accommodated to avoid them.

#21955 zhumpel Dec. 8, 2019, 11:23 a.m.

It's probably worth covering the on-disk arrangement of header files, to make sure their include paths are also prefixed.

1
#include "mylib/foo.h"

This sort of thing.

#21956 LucaSas Dec. 8, 2019, 2:06 p.m.

Sadly due to the nature of the topic there will always be room for disagreement on this topic. Possible solutions that I have mind include:

  1. Changing the title to something like "Advice on library development".
  2. Removing some of the more controversial points.
  3. Allow others to submit new ideas and changes.
  4. Better improve the language used in the article to highlight that there are other ways of doing things and that this advice is not authoritative.

I think it can be very educational to have a list of practical advice on designing libraries while keeping it open enough that it is not too opinionated. This is why I use language like "consider the following drawbacks" or "take this case into consideration".

I am sure there must be ways to present such ideas in an educational fashion without raising too many issues. If the community, however, considers that this topic might not be a good fit then I guess we could move it over to the forums. Right now the wiki is an experimental stage so consider this part of this experiment.


Edited by LucaSas on Dec. 8, 2019, 2:49 p.m.
#21957 Guntha Dec. 8, 2019, 3:25 p.m.

I agree with Mārtiņš here. The handmade philosophy is not about ordering people to "use this" or "do that", it is about making developers conscious of their choices, taking into account performance and quality of life (both user's and developer's) without necessarily following the latest developer trends.

This article is just turning Handmade into another trend.

I have to add I mostly agree with the points in the article, but something more fitting for Handmade would be an article about the thought process that led to these points. I think it's not necessary to remove the most controversial points (some people would argue everything happening in this community is controversial), just explain how you came up with these points.


Edited by on Dec. 8, 2019, 3:34 p.m.
#21958 LucaSas Dec. 8, 2019, 3:36 p.m.

I made some changes to reflect the nature of the article better. I do not want it to be an authoritative "do this or that" thing. I want it to be a list of advice and considerations that library developers should be aware of, based on existing quality libraries from the community.

I agree that it should not be authoritative and I am trying to make sure I remove any language that would imply that.

#21961 notnullnotvoid Dec. 9, 2019, 12:48 a.m.

you will need to provide precompiled binaries or ways to for your users to build your library for their target platform.

I'm pretty sure this is just wrong. How many programmers/game developers can really compile C on their target platform(s), but not C++? All the major C compilers you list (clang, MSVC, GCC) are also C++ compilers.

#21962 notnullnotvoid Dec. 9, 2019, 12:57 a.m.

you will need to provide precompiled binaries or ways to for your users to build your library for their target platform.

How many programmers/game developers can really compile C on their target platform(s), but not C++? All the major C compilers you list (clang, MSVC, GCC) are also C++ compilers.[/quote]

#21963 LucaSas Dec. 9, 2019, 11:21 a.m.

That quote is from the section on "If you want to use another language for the implementation, keep the interface in C.". While for C++ this most likely is not the case as all consoles have a C++ compiler, for other languages (Zig, Rust, Odin, etc) it is. Compiling code from those languages could be hard on other platforms or it could be hard for the respected developer depending on their experience and the language.