Earlier quoted context omitted.
FWIW I’ve never been at a job that allows exceptions...but smart pointers and RAII are great.
On the other side of the coin, I don't think I've ever had a job in which anyone would have ever considered banning exceptions (although I have worked at some where people did know that some other companies did ban them). The world of programming is a very broad church indeed.
How to write better game libraries
91–100 of 129 posts
Re: How to write better game libraries
#92Since this article lays so much emphasis on C, I have an honest question to everyone. What is a good way for a beginner to learn C in the current time? The minefield of undefined behavior is really overwhelming to a beginner. Are there any good resources that teach C the right way with good advice and best practices to navigate the UB minefield?
> the UB minefield While UB quirks exist, they are WAY off the beaten path and it takes an effort to run into them. Doubly so if you are just starting with the language. Just treat C as a thin convenient layer over the hardware that expects you to think and act responsibly in exchange for this nearly raw access.
Not to mention compilers make fun-times out of this by sometimes zeroing memory in debug and then not doing so for release builds (Hi MSVC!)..
The "thin layer over hardware" idea is a thing of the past as soon as optimizations come into the picture, and even then.
Re: How to write better game libraries
#93Earlier quoted context omitted.
Are you looking for a safe way to use your computer? Turn it off. Other than that, I'm not surprised the file in question is C. Even ignoring the fact that it was you to get the link. And even ignoring that it's about a security problem... Other than that, from a user perspective, software written in C is among the most reliable software I'm using. I'm looking at Linux, vim, xterm and so much of the infrastructure th…
The guys attending the Linux Kernel Security Summit seem to think otherwise, plenty of stuff there to entertain yourself.
Re: How to write better game libraries
#94I've used some libraries that do some of these things, but I can't think of any that does all of them.
Re: How to write better game libraries
#95Earlier quoted context omitted.
Code completion works very well with plain identifiers. No need for namespaces. > replace `using std::vector` with `using eastl::vector` and you’re done. The pipe dream of reusability.. If I ever happen to be in a situation where that will work, I'll happily use a text replace to change my identifiers. Or just link a different library if it has the same names.
> Code completion works very well with plain identifiers. It doesn’t on my PC. I’ve copy-pasted C enum from your example, when I type FPG there’s no way to auto-complete just the FPGAPARAM_ part, to be able to then press F to get FPGAPARAM_FOO. Using VC2017 here, with latest Visual Assist. Which C++ IDE are you using? > The pipe dream of reusability. Did it more than once. Here’s one open source project where I’ve re…
Re: How to write better game libraries
#96The problem for game libraries in general is that game dev lives in c++ world and c++ is awful for libraries. Most c++ devs I know would rather start writing a program by defining string than by learning to handle proper library management tooling. I'm not an expert so I'm not sure if it's just a culture thing or if there are inherent features in the language that make library usage hard, but yeah. That's that.
C is easier in this regard just because the language evolves so slowly that even though the build and library systems are bad, theyre a known bad that people can work around. No such luck with C++, where its bad and ever changing.
Re: How to write better game libraries
#97Earlier quoted context omitted.
> The * hard part * is making sure you release stuff every time, exactly once. Oy vey... you can't be serious. That's rudimentary basics of using any API.
It’s easy enough to correctly use a small API in a small program. It doesn’t matter at all for short-living apps which clean up their resources by exiting the process. There’re also other programs in wide use, which need to reliably work for hours, sometimes weeks. Some of them have huge amount of code they built from, written by many people over many years. Combine that with large enough APIs (some peripheral device…
If you need to rely on RAII in order not to screw things up, then it's an issue with the coding style or the application design. That's what needs fixing. Not the language choice. You got it backwards.
Re: How to write better game libraries
#98Earlier quoted context omitted.
FWIW I’ve never been at a job that allows exceptions...but smart pointers and RAII are great.
On the other side of the coin, I don't think I've ever had a job in which anyone would have ever considered banning exceptions (although I have worked at some where people did know that some other companies did ban them). The world of programming is a very broad church indeed.
Re: How to write better game libraries
#99Re: How to write better game libraries
#100Make is a much the lingua franca of build systems as C is for programming, so there's no reason not to provide a (simple) makefile. The alternative they suggest is worse anyway.