7 ms·
Just started using Raylib, bummed to hear about the limitations! As a novice C programmer, the simplicity and immediacy of results opened my eyes to how C can
by ederamen 2y ago
Just started using Raylib, bummed to hear about the limitations!
As a novice C programmer, the simplicity and immediacy of results opened my eyes to how C can feel as productive as higher level languages with robust standard libs.
- lelanthran 2y ago> As a novice C programmer, the simplicity and immediacy of results opened my eyes to how C can feel as productive as higher level languages with robust standard libs. TBH, once you have halfway-good libraries for dealing with `char *` strings as-is, dynamic arrays and hashmaps, you are not going to be much slowed-down using C than using a higher-level language. You even get much stronger isolation guarantees than most other high-level languages, while getting much more compatibility[1] with any other language you may wish to interface to: https://www.lelanthran.com/chap9/content.html https://www.lelanthran.com/chap9/content.html [1] I did a little Go project, and it annoyed me slightly when I wanted to do performant FFI. For Go, I think the situation has improved since I last checked, though.
- neonsunset 2y agoYou can trivially replace Go with C# in order to get almost zero-cost FFI (you can make it fully zero-cost with additional effort but even the baseline is better than the alternatives, hell you can statically link other .lib/.a's into AOT compiled .NET binaries).
- naasking 2y ago> TBH, once you have halfway-good libraries for dealing with `char *` strings as-is, dynamic arrays and hashmaps, you are not going to be much slowed-down using C than using a higher-level language. That can't possibly be true. Not having to even think about object lifecycles and ownership because all memory is GC'd saves a lot of time all by itself, not even getting into debugging issues when you get it wrong.
- jesse__ 2y agoIt's definitely true. Memory allocation takes a very small percentage of my time. I'd guess < 1%. Debugging memory issues used to take me more time, but these days it's basically inconsequential, too. Having written interpreted languages previously to jumping to C & C++ (>10y programming exp), there's a massive cost to using interpreted and/or GCd languages that comments like this one never seem to acknowledge. Random package bit-rot, high-difficulty memory leaks, high-difficulty AND high consequence manual memory management (to avoid the GC), poor performance tooling, nearly completely opaque performance characteristics, inability to optimize performance past a surface level... etc. If you're building anything more complex than simple web apps, this shit all adds up to a lot. I've worked at a couple shops that these issues hit like a ton of bricks.
- neonsunset 2y agoWhat kind of GC-based languages were the source of issues for these use cases? Was C# among them (in any recent time)?
- lelanthran 2y agoI've not used C# in recent years. While I actually liked the language, it's complexity is increasing with diminishing returns. There's no point in getting to a complexity level of, for example, C++ for any language - people who want such levels of complexity will be happy to use C++.
- neonsunset 2y agoWhile it certainly will eventually die C++'s death (can't remove language features, only add), it's luckily far from that predicament today. I don't think you could reasonably compare the two in amount of tacit knowledge one has to posses to avoid all kinds of footguns and get best results. The rule of thumb today for C# is to go with simplest way to do something and don't ignore IDE/analyzers' suggestions or warnings. A lot of focus has been put on terseness and simplicity.
- 2y ago