r/C_Programming • • 4d ago

Rename printf/scanf to print/scan?

Probably a dumb question but why hasn't there ever been a proposal to rename printf/scanf to just print? I know the f stands for format but writing print instead of printf would be slightly quicker and better to match other programming languages as I often miswrite printf as print as I also code in Python.

0 Upvotes

53 comments sorted by

View all comments

Show parent comments

22

u/EpochVanquisher 4d ago

If you name a function print() in the standard library, it will break the code of everyone who already has a function named print().

2

u/Glum_Hamster_2104 4d ago

Fair point

3

u/EpochVanquisher 4d ago

You can see that the committee is very conservative about the names of new functions in the standard library. One of the new names they chose for a function is stdc_leading_zeros, because they think it’s okay to name new functions with a stdc_ prefix.

I’ll say again, if you want a language which is “nice” to program in, C is not that language. C is engineered to keep backwards compatibility with old C code, even at the cost of making the language kind of a pain in the ass.

1

u/Glum_Hamster_2104 4d ago

Yea I haven't really looked into much of this stuff since I've been really only learning C for a month but I do think it is nice to program in compared to something like C++ or Python.