11-06-2013 08:16 AM
@Ranjeet_Singh wrote:
But I agree INF is better then STRLEN because it doesn't need calculate the strlen in each loop iteration
But can be done using string length. I think using strlen is better then infinite constant?
You seem to be agree on everything.
If you are calculating string length every iteration then why not let constant folding ( using INF ) run its course?
11-07-2013 11:47 PM - edited 11-07-2013 11:51 PM
crossrulz wrote:
Did you read the thread that Hooovahh left earlier? It is Darren, from NI R&D telling us to use it.
Exactly I agree but why it is better then strlen? This is my conern. Moving each time to INFINITY should not be recommeded I think?
11-07-2013 11:50 PM
Neos wrote:
But can be done using string length. I think using strlen is better then infinite constant?
You seem to be agree on everything.
If you are calculating string length every iteration then why not let constant folding ( using INF ) run its course?
I think INF is better because in each iteration we dont need to calculate string length. From calculation point of view INF is better but according to better way of coding / actual way strlen is better.
Both
11-08-2013 10:01 AM
@Ranjeet_Singh wrote:
I think INF is better because in each iteration we dont need to calculate string length. From calculation point of view INF is better but according to better way of coding / actual way strlen is better.
Both
What does that even mean "better way of coding / actual way strlen is better". Why do you think using the actual string length would be better than just using infinity? You are just purely speculating with no reasoning presented to back your opinion up.
I can tell you that using string length is not better because you are using an extra CPU operation to measure the string length. Now in reality, with modern computers, that is not going to be costly.
You seem to have a habit of making statements, yet continuing to argue that you think you are right, without any valid justifications, even when others point out that what you are saying doesn't make anysense. It is tiresome.
You've had a lot of contributions to the forums that have helped a lot of people. But then you occasionally going into these spells where you make these uninformed conjectures that are just coming out of La-La land. It begins to undermine your credibility.
11-09-2013 02:43 AM
I said both sounds Ok becuse each one of them have their own pros and cons and also I stated why as I think.
@Ranjeet_Singh wrote:
I think INF is better because in each iteration we dont need to calculate string length. From calculation point of view INF is better but according to better way of coding / actual way strlen is better.
Both
INF-Calculation point of view in each iteration.
STRLEN- Instead of pointing to infinity pointing to valid value is more appropriate(And this works too).
11-09-2013 02:44 AM
Better we stop here. Thanks for your time.
11-11-2013 07:26 AM
@Ranjeet_Singh wrote:
INF-Calculation point of view in each iteration.
STRLEN- Instead of pointing to infinity pointing to valid value is more appropriate(And this works too).
INF-Constant that the compiler can optimize how it sees fit usually with constant folding. Value is just as "valid" as any other number for calculations.
STRLEN-Must be calculated each iteration.
BTW it is tiresome.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord