2 ms·
I do read most documentations of most functions that I am not entirely sure how to use. I am not going to reimplement strtok if it already exist and is the rig
by johnisgood 2y ago
I do read most documentations of most functions that I am not entirely sure how to use.
I am not going to reimplement strtok if it already exist and is the right tool for the job AND is perfectly documented.
> OR it's beneficial to avoid functions where mistakes and missed documentation are highly likely to result in misuse.
That is where you got it wrong. If you do not know how to use strtok, check the documentation (which exists) or examples of proper usage (also exist), or do not use it. How can you even implement strtok if you know jack shit about what it does, anyway? Don't you need the documentation for that to begin with? If not, then you are reimplementing something that already exists. I'm not going to reimplement strlcpy. Sometimes I copy the implementation of asprintf into the codebase because I may want to avoid GNU extensions, that's about it.
I get it, you (and many people who refuse to read the manual pages) can't use strtok properly, that is fine, don't use it then.
The basic logic is: don't use functions you are not sure how to use, look up the readily available documentation. Hell, ask an LLM. It applies to the whole field. FWIW, you do know you can read manual pages from the IDE these days, too, right?
I'm sorry, but you sound just like my friend who wanted to learn how to use Linux without actually wanting to read Wiki pages about it (installation guide, for one). "Make Linux easier to use [because I cba to read]", well, install an Ubuntu then, but you will still not be a power user or learn anything. In this case it does not matter then if you use Windows or Linux if you are just sticking to using a browser.
I don't know where or how you work, but why would anyone spend time writing documentation if you are not even willing to read it through? At least not everyone avoids reading like a plague.