-
-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print.h add printf API #32
Comments
See #28 |
Adding printf seems obvious, but in the past, adding printf support has been discussed (on the mailinglist, I think, I don't have a link at hand), and the main (and so far, I think, decisive) argument against adding printf is that it is convenient, but not a very transparent API for the novice programmer audience. Also, lack of type safety makes it very easy to get hard-to-debug problems using printf. Of course, you could argue that this API is available for more advanced programmers that need it, but if it is offered by default, it will likely going to end up in examples that novice programmers use too and end up causing problems anyway. If an expert user really wants to use printf, there are some libraries that offer a similar thing as well. Also see the discussion in #28 for some links to previous discussions. Ideally, some more type-safe and convenient way of printing multiple values would be available (and I've been working on something a long time ago based on a variadic print function), but nothing definitive has come out of that so far. The issue for implementing something better is #34. I'm not sure if the stance on this has changed, but personally I would very much prefer something that is better to use than plain printf (and with new C++ features, implementing something that is convenient and type-safe is probably more feasible than when printf was conceived). There currently seem to be two PRs implementing this: #29, which prints byte-by-byte, and #28 which keeps a fixed-size buffer on the stack (which IMHO is needlessly limiting, so I closed it). |
No description provided.
The text was updated successfully, but these errors were encountered: