LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Coercion dots between typedef to non-typedef

Solved!
Go to solution

wiebe@CARYA wrote:

So to summarize:

 

1) Don't worry about the coercion dots, they don't do any harm

2) Make the indicators type defs too, no coercion dots.

3) Don't make the type defs, , no coercion dots.

 

Can we conclude that what works in which situation is going to depend on taste mostly?


With respect to coercion dots, definitely.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 11 of 20
(1,676 Views)

@billko wrote:

wiebe@CARYA wrote:

So to summarize:

 

1) Don't worry about the coercion dots, they don't do any harm

2) Make the indicators type defs too, no coercion dots.

3) Don't make the type defs, , no coercion dots.

 

Can we conclude that what works in which situation is going to depend on taste mostly?


With respect to coercion dots, definitely.


With respect to coercion dots on typed def'd scalar values.

 

Coercion dots are often not innocent, and should be taken seriously, as a rule.

Message 12 of 20
(1,672 Views)

wiebe@CARYA wrote:

@billko wrote:

wiebe@CARYA wrote:

So to summarize:

 

1) Don't worry about the coercion dots, they don't do any harm

2) Make the indicators type defs too, no coercion dots.

3) Don't make the type defs, , no coercion dots.

 

Can we conclude that what works in which situation is going to depend on taste mostly?


With respect to coercion dots, definitely.


With respect to coercion dots on typed def'd scalar values.

 

Coercion dots are often not innocent, and should be taken seriously, as a rule.


Didn't you just contradict your first point?

 

Coercion dots should always be considered - and taken seriously - so you understand what is happening.  Making them go away is, I think, mostly a matter of taste, since the coercion is going to happen whether you let the dot do it, or you do it yourself.  For example, I may do an explicit coercion if it's to an integer (typecasting if an enum) data type so it is plain what it is actually being coerced to.  I'm not aware of a manual coercion that does coercion differently than the dot, but if someone has an example, that would definitely be an eye-opener for me.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 13 of 20
(1,655 Views)

@billko wrote:
I'm not aware of a manual coercion that does coercion differently than the dot, but if someone has an example, that would definitely be an eye-opener for me.

In my links above I discuss an example where the coercion dot is faster than explicit conversion.

 

CoercionIsFaster.png

(it's actually 33%slower, but sitll there is a significant difference! I have not tested in the latest LabVIEW version)

Message 14 of 20
(1,645 Views)

@altenbach wrote:

@billko wrote:
I'm not aware of a manual coercion that does coercion differently than the dot, but if someone has an example, that would definitely be an eye-opener for me.

In my links above I discuss an example where the coercion dot is faster than explicit conversion.

 

CoercionIsFaster.png

(it's actually 33%slower, but sitll there is a significant difference! I have not tested in the latest LabVIEW version)


I agree.  What I meant was that I knew of no instance where the outcome would be different; I should've worded more concisely.  Coming to that conclusion, I only use it as a "crutch" occasionally, like when coercing one type of integer to another to make sure I'm enforcing a certain data type.  (If I get a coercion dot after an explicit coercion, I must have screwed up somewhere.  Sometimes I get quite confused.)

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 15 of 20
(1,626 Views)

@billko wrote:

wiebe@CARYA wrote:

@billko wrote:

wiebe@CARYA wrote:

So to summarize:

 

1) Don't worry about the coercion dots, they don't do any harm

2) Make the indicators type defs too, no coercion dots.

3) Don't make the type defs, , no coercion dots.

 

Can we conclude that what works in which situation is going to depend on taste mostly?


With respect to coercion dots, definitely.


With respect to coercion dots on typed def'd scalar values.

 

Coercion dots are often not innocent, and should be taken seriously, as a rule.


Didn't you just contradict your first point?


In the context (with respect to coercion dots on typed def'd scalar values), they are save to ignore.

 

In general, they are not.

Message 16 of 20
(1,616 Views)

wiebe@CARYA wrote:

@billko wrote:

wiebe@CARYA wrote:

@billko wrote:

wiebe@CARYA wrote:

So to summarize:

 

1) Don't worry about the coercion dots, they don't do any harm

2) Make the indicators type defs too, no coercion dots.

3) Don't make the type defs, , no coercion dots.

 

Can we conclude that what works in which situation is going to depend on taste mostly?


With respect to coercion dots, definitely.


With respect to coercion dots on typed def'd scalar values.

 

Coercion dots are often not innocent, and should be taken seriously, as a rule.


Didn't you just contradict your first point?


In the context (with respect to coercion dots on typed def'd scalar values), they are save to ignore.

 

In general, they are not.


I wouldn't ignore them, either.  They're telling you "I had to do some fancy footwork to get this to work out" and you should always consider whether or not it was an appropriate action.

 

Sorry if my previous post felt confrontational.  It wasn't supposed to.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 17 of 20
(1,598 Views)

A coercion dot is nothing more than the compiler telling you: "Hey, I fixed this for you. Make sure it is really want you want". (It does not mean "Hey, you made a big boo-boo here, you need to make that red disappear at all cost!")

Message 18 of 20
(1,589 Views)

@billko wrote:

wiebe@CARYA wrote:

@billko wrote:

wiebe@CARYA wrote:

@billko wrote:

wiebe@CARYA wrote:

So to summarize:

 

1) Don't worry about the coercion dots, they don't do any harm

2) Make the indicators type defs too, no coercion dots.

3) Don't make the type defs, , no coercion dots.

 

Can we conclude that what works in which situation is going to depend on taste mostly?


With respect to coercion dots, definitely.


With respect to coercion dots on typed def'd scalar values.

 

Coercion dots are often not innocent, and should be taken seriously, as a rule.


Didn't you just contradict your first point?


In the context (with respect to coercion dots on typed def'd scalar values), they are save to ignore.

 

In general, they are not.


I wouldn't ignore them, either.  They're telling you "I had to do some fancy footwork to get this to work out" and you should always consider whether or not it was an appropriate action.

 

Sorry if my previous post felt confrontational.  It wasn't supposed to.  🙂


That's OK, that happens (quite easily) over text. I imagine how it would sound when talking at a bar with a beer. That usually makes it far less confrontational Smiley LOL.

Message 19 of 20
(1,575 Views)

Thank you all for helping me.

 

I removed the type def from the 2d array, so the coercion dot disappeared.

And about the type def booleans, I did nothing, the coercion dots are still there.

But in this case they are harmless. Thanks for teaching me that

0 Kudos
Message 20 of 20
(1,533 Views)