Hacker News new | past | comments | ask | show | jobs | submit login

strcpy and friends don't really have any benefits beyond just being there. The "safer" versions are still unsafe in many cases, while being less performant and more annoying to use.

Writing a strbuffer type and associated functions isn't particularly hard and the resulting interface is nicer to use, safer, and more efficient.




I argue strview (non-owning) is almost always what is needed. Most of string operations are searching and slicing.


You also need a strview. Not really relevant for avoiding strcpy and strcat though.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: