5 ms·
Again, if people can't agree what type to use for integers, then it's not "simple". And yes, a tool being easy to misuse absolutely means we shouldn't use it u
by stupidcar 11y ago
Again, if people can't agree what type to use for integers, then it's not "simple".
And yes, a tool being easy to misuse absolutely means we shouldn't use it unless we have to. A competent adult would never use a chainsaw or a scalpel except for tasks where nothing else would work.
- EliRivers 11y agoPick the integer type that is best suited for your use, given your circumstances. I can't make it any simpler. There is no one true magical perfect solution for all circumstances in all places at all times. This is why I employ competent programmers; to make these choices. A competent adult would never use a chainsaw or a scalpel except for tasks where nothing else would work. Of course they would. I do, frequently; not chainsaws and scalpels, but there are dangerous tools that I am really good with that I can produce really good work with, quickly and efficiently, and there are safe tools that would mean I take longer and can't do exactly what I want to do and produce a less satisfactory result. I don't pick the safe tool; I pick the right tool for the job, given the circumstances and the requirements. Are there people who deliberately pick the tool that will give a worse outcome? If one of the tools available is something that the person using it isn't competent to use, that doesn't mean the problem is with the tool. I freely accept that a good C programmer needs knowledge and experience beyond that of many programmers. This is not somehow a bad thing.
- anon1385 11y ago>Pick the integer type that is best suited for your use, given your circumstances. >Pick the fission reactor type that is best suited for your use, given your circumstances.
- EliRivers 11y agoI cannot tell if you are in favour of, or against, the principle that one should pick the right tool for the job.
- anon1385 11y agoSaying "just pick the right tool" is a worthless statement when the question is the difficulty of doing that. Would you enter a discussion about curing cancer or depression and announce "just pick the right cure for the disease" and then get upset when people don't agree with you?
- EliRivers 11y agoNow I can understand your argument. I upvoted you because I like to encourage clarity. This sounds patronising but that's the limitations of a text interface for you. I think you're arguing that sometimes it's difficult to work out what the right tool is for the job. That's true, and not what I'm talking about. I'm saying that the principle of selecting the right tool for the job is sound, and that sometimes C is the right tool for the job and should be selected.
- anon1385 11y agoThe chain of discussion: >Because [C] is simple >Again, if people can't agree what type to use for integers, then it's not "simple". >Pick the integer type that is best suited for your use, given your circumstances. It had nothing to do with deciding to pick C. It was about the difficulty of picking integer types in C being a demonstration of how C isn't simple. That doesn't mean C isn't sometimes the right tool for the job. It does mean that C isn't simple.
- stupidcar 11y agoLook, nobody cares how clever and talented a programmer you are, or think you are. Please just drop the unsubtle boasting and passive aggressive insults, they only make you sound like an insecure egotist. Concentrate on the actual issue. In 99.9% of languages, there is one true magical perfect solution to a question as basic as "what type should I use for integers?", and it's "use the integer type". The fact that C not only has options in this case, but that experienced developers seemingly cannot even agree on best practices, is a very good reason to avoid using the language unless you have to.
- jevgeni 11y agoThe reason why C has several integer types, is because there are different ways to represent integers for computers. Everything else is convention. I mean, if that bothers you, then meta-programming in Ruby and Python, as well as different lisps should really bum you out.