Jump to content

Can I ride the LV/TS train to retirement?


Phillip Brooks

Recommended Posts

16 hours ago, Neil Pate said:

Not for me though, my low level messaging uses events and that is just waaaaay to much drama to have separate events for every message. I wrap it up a layer with typedefs though, just the data is transported in a variant.

If only there were a way that one could use strings to define the event. We could call them, let me see, "Named Events"?.:shifty:

Link to comment
14 minutes ago, Neil Pate said:

I am not against your idea of adding a bit of love to the events implementation.

Actually. your particular problem is that the variant type is only a half-arsed variant type. It's easy to get something into a variant, but convoluted and unwieldy to get them out again. I think "Generics" were supposed to resolve this but they never materialised.

I shake my head with the recent push in the software industries to strict type everywhere. Most of the programming I do is to get around strict typing.

Link to comment
18 minutes ago, ShaunR said:

I shake my head with the recent push in the software industries to strict type everywhere. Most of the programming I do is to get around strict typing.

While I appreciate dynamic languages and the flexibility they offer I think this is pretty bold blanket statement and is totally context sensative. Would you want to write a driver for your GPU with a language that does not offer strict typing?

Link to comment
3 hours ago, Neil Pate said:

Would you want to write a driver for your GPU with a language that does not offer strict typing?

Oddly specific. I would want a method of being able to coerce to a type for a specific line of code where I thought it necessary (for things like precision) but generally...bring it on. After all. In C/C++ most of the time we are casting to other types just to get the compiler to shut up.

They broke PHP with class scoping. They are now proposing breaking it more with strict typing. Typescript is another. It's the latest fad.

Link to comment
1 minute ago, ShaunR said:

Oddly specific. I would want a method of being able to coerce to a type for a specific line of code where I thought it necessary (for things like precision) but generally...bring it on. After all. In C/C++ most of the time we are casting to other types just to get the compiler to shut up.

Easy typecasting in C is the main reason for a lot of memory corruption problems, after buffer overflow errors, which can be also caused by typecasting. Yes I like the ability to typecast but it is the evil in the room that languages like Rust try to avoid in order to create more secure code.

Typecasting and secure code are virtually exclusive things.

  • Like 1
Link to comment
21 hours ago, Neil Pate said:

Not for me though, my low level messaging uses events and that is just waaaaay to much drama to have separate events for every message. I wrap it up a layer with typedefs though, just the data is transported in a variant.

For me each message is it's own user event that is a variant, that gets created at the start. Then you can use it as a publisher/subscriber paradigm because you can create an array of these user events and register for them all at once.  This is great for debug since a probe can just subscribe for all user events and see all traffic between actors.  The Variant has an attribute that is Event Name, that is pulled out so the one event case handles them all, but the name is unique.  VI Scripting creates a case to handle each unique user event, with a type def on how to get the requested data out, and if it is synchronous, another type def to put the data back as a reply.  New cases are created with VI scripting to generate the VIs for request, convert, response, and the case structure.

Link to comment
5 minutes ago, hooovahh said:

For me each message is it's own user event that is a variant, that gets created at the start. Then you can use it as a publisher/subscriber paradigm because you can create an array of these user events and register for them all at once.  This is great for debug since a probe can just subscribe for all user events and see all traffic between actors.  The Variant has an attribute that is Event Name, that is pulled out so the one event case handles them all, but the name is unique.  VI Scripting creates a case to handle each unique user event, with a type def on how to get the requested data out, and if it is synchronous, another type def to put the data back as a reply.  New cases are created with VI scripting to generate the VIs for request, convert, response, and the case structure.

Sure I know this pattern well, just prefer to have a single "mailbox" type event inside my actors for messages into the actor. I don't want to deal with the drama and scripting just to be able to have different typed events. My layer above the variant is all typed, so I don't really have an issue with converting variants to their real types.

But of course everyone must do whatever pleases them most. I have way that works for me, my team, and the kinds of things that we build, so have no need to make it more complicated.

Link to comment
39 minutes ago, Rolf Kalbermatter said:

Easy typecasting in C is the main reason for a lot of memory corruption problems, after buffer overflow errors, which can be also caused by typecasting. Yes I like the ability to typecast but it is the evil in the room that languages like Rust try to avoid in order to create more secure code.

Typecasting and secure code are virtually exclusive things.

Don't have that problem with dynamic typing.

Typecasting is the "get out of jail" card for typed systems. This one seem familiar?

linger Lngr={0,0};
setsockopt(Socket, SOL_SOCKET, SO_LINGER, (char *)&Lngr, sizeof(Lngr));
DWORD ReUseSocket=0;
setsockopt(Socket, SOL_SOCKET, SO_REUSEADDR, (char*)&ReUseSocket, sizeof(ReUseSocket));
Edited by ShaunR
Link to comment
37 minutes ago, Neil Pate said:

Sure I know this pattern well, just prefer to have a single "mailbox" type event inside my actors for messages into the actor.

Oh yeah I'm not trying to convince anyone, I just was putting it out there in case others aren't aware of this style of messaging.  I prefer the design I described it because it makes life easier on the developer using the API, at the expense of extra work on the architect making it.

Link to comment
20 minutes ago, ShaunR said:

Don't have that problem with dynamic typing.

Typecasting is the "get out of jail" card for typed systems. This one seem familiar?

linger Lngr={0,0};
setsockopt(Socket, SOL_SOCKET, SO_LINGER, (char *)&Lngr, sizeof(Lngr));
DWORD ReUseSocket=0;
setsockopt(Socket, SOL_SOCKET, SO_REUSEADDR, (char*)&ReUseSocket, sizeof(ReUseSocket));

Of course it looks familiar. When not programming LabVIEW (or the occasional Python app) I program mainly in C. It's easy to typecast and easy to go very much ashtray. C tries to be strictly typed and then offers typecasting where you can typecast a lizard into an elephant and back without any compiler complaints 😀. Runtime behavior however is an entirely different topic 🤠

Link to comment
1 hour ago, ShaunR said:

I love Rolf's eggcorns. I never point them out because he knows my language better than I do. :P 

Interesting word 😀. Learned a new thing and that this was only invented in 2003.

As to knowing English better than you do, you definitely give me more praise than I deserve.

Edited by Rolf Kalbermatter
Link to comment
14 minutes ago, Bryan said:

I'm just now hearing of the word 'eggcorn' as well.  The definition sounds like something that I have often done intentionally while talking with friends for comedic effect. 

malapropism is similar but more common for comedy because it doesn't need to make sense in context (so it's easier and funnier).

Edited by ShaunR
Link to comment
17 hours ago, hooovahh said:

I knew of the malaphor only because my wife does it all the time, but then insists her phrase is the way people always say it.

I had a girlfriend like that. It turned out that her father used mix metaphors for comic effect but she didn't realise and thought it was the correct metaphor. When she said "everyone says it like that" what she meant was "my family says it like that"

Edited by ShaunR
  • Haha 2
Link to comment
  • 3 weeks later...

If you want the best of both worlds, you can try Flojoy, which is primarily no-code, but also allows extensibility in Python for those who want to dabble in code. 

If you try Flojoy (it's free, no-code, and open-source), please leave your thoughts, reviews, feedback, and suggestions in this post:

 

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.