2 ms·
If what you need is strtok, use it as documented. If you do not use it as documented, that is a skill issue. Do you even need strtok? If you do, RTFM. > If the
by johnisgood 2y ago
If what you need is strtok, use it as documented. If you do not use it as documented, that is a skill issue. Do you even need strtok? If you do, RTFM.
> If they are things that are easy to misuse and many people do, then it's a reflection of the programming language. If they're well-designed and it's only you getting it wrong, then it's your limited skills.
Whatever "well-designed" means. At any rate, wonder where you got the "many people" from, who actually have read the manual.
For some of my use-cases, strtok is designed well enough. If I need something else, then I will use something else, and so should you. No need to re-implement strtok (or any other functions) readily available.
Plus, do you really think people who cannot use strtok properly can roll their own?
- IshKebab 2y agoThe fact that you don't get this is the real skill issue.
- johnisgood 2y agoSo you are resorting to ad hominems instead of answering me. I get it, strtok is difficult for you to use even after a hundreds of correct examples of its usage and having read the manual pages. Then do not use it. Stick to whatever you may for all I care. sighs
- IshKebab 2y agoI just don't know of a good way to help you understand the insane levels of hubris you have. Tell me this. Do you ever make mistakes? Do you always read the manual exhaustively and remember it perfectly?
- johnisgood 2y agoWhen I'm coding, I have at least 2 workspaces out of 10 dedicated to manual pages and documentation, so I don't need to always remember (sometimes incorrectly). I do make mistakes, but usage of strtok is not one of them.
- IshKebab 2y agoSo you do make mistakes. And despite having the documentation open you don't always read all of it, correct? Or are you trying to say you always read all of the documentation? You see where I'm going with this right? Either you never make mistakes and always read all the documentation (which is impossible), OR it's beneficial to avoid functions where mistakes and missed documentation are highly likely to result in misuse. That's just basic logic. Hopefully there are no skill issues understanding that?
- johnisgood 2y agoI 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.
- johnisgood 2y agoBTW, what issues do you have with strtok() exactly? It is straightforward to use after having read the documentation. I do not buy the "many people misuse" argument. Who? Wannabe script kiddies? People who are reluctant to read the documentation? From where do you get "many people"?