Why not just use puts()? Is formatting your own strings properly really so hard? Maybe if you went to a school with a name that ended in `.com'. If that's the case, enjoy your security holes when you fuck up and put an %n somewhere or do something stupid like printf(str) and loosing buffer overflows all over the place. Not only that, but it's inefficient and bloated. I am sick and tired of seeing new programmers wasting CPU time and memory to run this huge, buggy function.
In general, it's never a bad idea to use something simpler if available.
>>2
Not to mention format strings are better for localisation. (They still suck though. The Right Thing would be the ability to patch entire functions at run-time, seamlessly (i.e. without “dynamic” library nonsense). It would also help with different calendars, etc. as well as allow the extension of programs at run-time.)
Why not just use [ocde]puts()[/code]?
You mean fputs()? Most of the time you don't want a newline after every string.
I am sick and tired of seeing new programmers wasting CPU time and memory to run this huge, buggy function.
You're wasting even more by calling individual "output an integer" "output a character" "output a string" etc. functions. If your printf() implementation is buggy then you should either fix it yourself or find someone who can (or complain incessantly until it is.) Yes, printf() by itself is huge if you're outputting very little but the savings add up across all the programs that need to use it, just like everything else in the standard library. Fortunately the C stdlib is one of the few things that has paid off its reuse many many times over (unlike some platforms named after coffee or a TLD...)
In the DOS days, there was no dynamic linking so every program did have its own copy of all the stdlib functions it used, and in that case you could make a better argument for custom output functions, but now that almost all OSs --- even some 8-bit embedded ones --- have dynlink, it's become a moot point.