

Snprintf(filepath, sizeof filepath, "%s%s", Snprintf(utext, sizeof utext, "Hello %d", ui->update_count) Msg_f("Failed to compile shader but there are no error messages. Msg_f("Shader compile error messages: %s", errors->GetBufferPointer())
Approximately equal symbol in mathematica code#
These are all the format calls in there (used git grep):įatal_f("Failed to CreateBuffer(): %lx", err) įatal_f("Failed to register Window class") įatal_f("%s failed: error code %lx", what, hr) It currently clocks in at just under 6 KLOC. My current project is a GUI prototype based on plain Win32/Direct3D/Direct2D/DirectWrite. Thanks for the ad hominem, but let's put that into perspective. abstract classes in a lot of cases due to being a good tradeoff when taking all axes into account.

But from a pragmatic and ergonomic standpoint I still prefer them to e.g.

It is possible to get it wrong, it absolutely happens. People also like to bring up issues like this on HN like it's the end of the world, when it's not nearly as big of an issue most of the time.Īnother similar example like that are void pointers as callback context. Writing in those is like every line was a printf()!īut many people will through great troubles to achieve an abstract goal of type safety, accepting pessimisations on other axes even when it is ultimately a bad tradeoff. But people are writing untyped Python or Javascript programs, sometimes significant ones. I'll even go as far as saying that it's easy to have errors slip on refactors if there aren't good tests in place. It's absolutely possible and it has happened to me. I'm not saying it's impossible to write a bad printf line and never test it, only to have it fail years later in production. Or it can be easily tested during development by running it just once. Furthermore, a lot of that code - if the structure is good - will already have been tested after the program has been started up. It's a bit like a delayed type check.Ī lot of code is like that. 2) foo->x is indeed an integer and the printf() format is always going to be fine - it matches the arguments correctly. Unfortunately, we don't know about all the other times. What can you conclude? 1) foo was not NULL at least one time. Let's assume you run the code once and observe that it works. And the type of foo->x could be not an integer. Assuming it compiled but assuming no further context, what could break here at run-time? foo could be NULL. Take as an example printf("%d\n", foo->x).
