LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
tst

String case structures should default to being case insensitive

Status: New

Today, when you create a case structure and wire a string to it, the case structure becomes case sensitive. This may have been relevant in the 1970s, when every bit was important, but these days I'm guessing that in at least 95% of the cases the structure should be case insensitive, although most people are probably not even aware that you can change it.

 

So, why not make the structure default to being case insensitive instead of case sensitive?

 

Actually, I would possibly even suggest removing the case sensitive option altogether, but this is probably required for some things and would break existing code which relies on this.

Message Edited by tst on 20.04.2010 04:43 PM

___________________
Try to take over the world!
14 Comments
JackDunaway
Trusted Enthusiast
Would case insensitivity make a more difficult migration toward a Unicode IDE? This question is not rhetorical, I do not know the answer - comments welcome - I have not given thought to case sensitivity above U007F until now.
tst
Knight of NI Knight of NI
Knight of NI
Maybe it would (I don't know either), but I don't think that's relevant. The case-insensitive option already exists, I just want it to be the default.

___________________
Try to take over the world!
Intaris
Proven Zealot

I generally avoid wiring strings to case structures at all due to the inherent likelihood of introducing a bug that way (not to mention having to keep all strings in synch if any of the change).

 

I personally don't see the need to have case insensitive cases by default.  Maybe an environment switch?

tst
Knight of NI Knight of NI
Knight of NI

I use string case structures relatively rarely too, but I still use them, and when I do, I don't want to have to start worrying about whether I have the correct casing. In most interactions with computers, case doesn't matter, nor should it.

 

Environment variable? Maybe. It seems to me that you don't care what the default is either way, and another option just creates more work and noise, thus making this change less likely to happen, so I would probably prefer not to have it that way.


___________________
Try to take over the world!
RobCole
Active Participant
I prefer the idea of an environment variable for case insensitivity. I envision this have wider ranging effects than case structures though. Imagine if case insensitivity covered equals and search string functions (all string functions) as well. This would be for default operation and should be selectable. As an environment variable, you could choose what you want the default to be.
Intaris
Proven Zealot

Tst,  you're correct I'm pretty ambivalent about the option.  For myself probably best not to change anything, but I'm only a single voice.

 

I would be wary of the "case doesn't matter, nor should it" statement though.  Not sure I'd agree with that.

CrystalTech
Member

I'm continually having to make it case insensitive also.  I only use string for small case structures, but usually have a few in my program (I use Type Def Enums otherwise). I also think when "comparing" strings there should be a case insensitive option somehow.  I have to make the string lower case before it goes into the comparator, then make the sample string lower case.  This should somehow be selectable as a default option chosen by the programmer so it doesn't have to be selected every time, and to remain "AS IS" if the programmer prefers it this way.  My 2 cents.

I sure am glad web addresses and email addresses are case insensitive... that would otherwise be a nightmare!! 

jmorris
Active Participant
I can think of examples where I've used both in the past.  As long as it doesn't break old code, and both options are easily available on a case-by-case basis, I don't really care which is the default.  Having an easy checkbox (ideally with accompanying graphic) on the properties of case structures, equals comparisons, etc. would be ideal in my opinion.
Spectre_Dave
Active Participant

I also use string cases all of the time and case insensitive should be default.

 

I have scores VIs that use string cases and I find them much more flexible than enums.  I encourage you to check out the  Asynchronous Message Communication (AMC) Reference Library also see JKI State Machine

 

You do need a case to trap typing errors - I set this case to default and catch my occasional typo.

Visualize the Solution

CLA

LabVIEW, LabVIEW FPGA
TCPlomp
Trusted Enthusiast

While we are at it, when a boolean case structure gets altered to a string case structure, the 'True' and 'Default, False' case should be removed.

 

This leads to unwanted bugs.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!