The wheel needs improvement
Peter Nachtwey said:
Fine, someone offered 'original' solutions and I am amazed the people would ignore the correct solutions provide by KentuckyMark and Alaric. Why would people ignore the orthodox solutions developed by thousands of programmer over the last 50 or so years?
The thread continued to go astray so I made my second post. I effectively said that the algorithm Alaric ( KentuckyMark too ) proposed are the 'orthodox' way of counting bits and 'original' methods are inferior. You would have Hakutsuru and imonline waste their time on developing inferior algorithms while I am am steering Hakutsuru and imonline straight to the orthodox solutions thus saving them time.
There was nothing more to add after KentuckyMark and Alaric first posts. The thread should have ended there but it strayed. Would you let it stray?
This is all old stuff. Ron you know that. You may have empathy for the rookies. That will not help them. The forum has history and knowledge. You know that too. Don't you think it is a little arrogant that the rookies come to this site thinking that they are the first to ever have a problem?
I missed ron's post, he must have deleted it, but I agree 100% with the parts you quoted. First off, look back at the first page, I *know* Kentucky Mark's solution was the best, I was about to post the same thing, but he beat me to it. That, in no way means its the only way it should ever be done. C'mon, this is programming, there are a hundred ways of doing things and we'll do them all 100 ways. Nothing at all wrong with that, and nothing wrong with learning about those other solutions. It doesn't mean we're ignoring the tried and true methods. Look, just because the first solution (the for-next loop) was the best in this case doesn't mean alaric's original solution was worthless, does it?
There will be situations where it is best. BTW, I think the person who posted the solution with the bit shifting was better than alaric's loop, but they're both only useful iff all the outputs you wanna count are consecutive (but talk like that might out this thread back on topic, so I'll stop it there). The same goes for the other solutions posted here (in all liklihood, I mean some may be rubbish). Its a flaw in your own personality that you cannot see how new ideas may be useful tomorrow, IMNSHO. I have no doubt that at some point in my career, a new problem (new to me) will come up, and I'll remember some alternative solution I saw on this board, and it'll be exactly what I needed. I gotta agree with Dan, this is a learning site. If you don't wanna learn, then fine, plug your ears and run away, but what you're doing here is actively attempting to BLOCK the learning process, please don't do that anymore. We understand that you think those 2 solutions are the only viable solutions. We understand you are the smartest man in the world and can therefore make those determinations. Now leave us alone and let us explore a little for ourselves.
And a couple more things, I'm not really a rookie when it comes to PLC programming.
No one on this thread thought this was the first time anyone had tackled this problem.
And from my point of view, the true arrogance is someone thinking they have all the answers. Every last one of them. No possibility whatsoever for any piece of knowledge or idea to exist that they do not already have.
When people do come here thinking they have a new problem (which does happen occasionally, but not nearly as often as the accusation is thrown around), thats not arrogance, thats ignorance. You deal with ignorance through education.
And finally, why re-invent the wheel? If the folks at goodyear had an attitude like that, we'd all still be rolling around on rounded rocks.
-jeff