SQL between
-
Ugh, I just hate the bad usage of BETWEEN in SQL in some legacy SP's at my work. Horrible to use for finding values between a date range, when the date range can be 1 day, ugh!
"I have a theory that the truth is never told during the nine-to-five hours. " — Hunter S. Thompson
-
Ugh, I just hate the bad usage of BETWEEN in SQL in some legacy SP's at my work. Horrible to use for finding values between a date range, when the date range can be 1 day, ugh!
"I have a theory that the truth is never told during the nine-to-five hours. " — Hunter S. Thompson
I'm not keen on the between keyword either - I always have to test if between means exclude or include the bounds. I much prefer >= and <=.
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
-
I'm not keen on the between keyword either - I always have to test if between means exclude or include the bounds. I much prefer >= and <=.
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
I dunno - I do remember that between is inclusive, so I tend to see it as more readable, generally. However, most of the time I do use explicit tests instead, because I don't want to include the upper or lower bound. Ho Hum.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."
-
I dunno - I do remember that between is inclusive, so I tend to see it as more readable, generally. However, most of the time I do use explicit tests instead, because I don't want to include the upper or lower bound. Ho Hum.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."
I was thinking about why I find something like the word "between" so confusing. I think the reason follows on from the VB versus C# discussion[^] that was going on in the lounge. To explain this it goes something like this for me: if someone told me to kick a ball "between" the goal posts this would mean to me to hit anywhere "inbetween" the goal posts and not hit the goal posts themselves. So for me there is a certain ambiguity in the meaning of "between". Whereas >= and <= holds no ambiguity for me and this is partly why I like C# over VB - the lack of verbosity seems to make it easier for me to understand... Maybe I am just too curmudgeonly...
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
-
I was thinking about why I find something like the word "between" so confusing. I think the reason follows on from the VB versus C# discussion[^] that was going on in the lounge. To explain this it goes something like this for me: if someone told me to kick a ball "between" the goal posts this would mean to me to hit anywhere "inbetween" the goal posts and not hit the goal posts themselves. So for me there is a certain ambiguity in the meaning of "between". Whereas >= and <= holds no ambiguity for me and this is partly why I like C# over VB - the lack of verbosity seems to make it easier for me to understand... Maybe I am just too curmudgeonly...
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
:laugh: Yes, there is a difference between words in English and word in coding languages, generally in terms of precision. The main reasons I prefer C# to VB is that is is more precise: in VB
DataRows(17)
could be an array element or a function call, in C# the difference is clear. Plus I hate the general use ofvar
, automatic (and normally wrong) casting and don't get me started withOn Error Resume Next
:laugh:Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."
-
:laugh: Yes, there is a difference between words in English and word in coding languages, generally in terms of precision. The main reasons I prefer C# to VB is that is is more precise: in VB
DataRows(17)
could be an array element or a function call, in C# the difference is clear. Plus I hate the general use ofvar
, automatic (and normally wrong) casting and don't get me started withOn Error Resume Next
:laugh:Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."
OriginalGriff wrote:
in VB
DataRows(17)
could be an array element or a function call, in C# the difference is clearAs much as I prefer C# over VB.NET this is not true.
DataRows[17]
could either be an array access or a call to an indexer which is nothing else than a method call. Robert -
OriginalGriff wrote:
in VB
DataRows(17)
could be an array element or a function call, in C# the difference is clearAs much as I prefer C# over VB.NET this is not true.
DataRows[17]
could either be an array access or a call to an indexer which is nothing else than a method call. RobertRobert Rohde wrote:
DataRows[17]
could either be an array access or a call to an indexer which is nothing else than a method call.An indexer is an operator which is supposed to simulate accessing array's elements by sth like index, so the meaning is clear. A problem appears whe a coder implements an indexer which, for example, serializes an object to a file. However, if a coder knew about a "hidden feature" like indexers the he probably wouldn't be so unwise. In VB, if you see DataRows(17) and know that DataRows is a collection, then you think "well probably it is an indexer".
Greetings - Jacek
-
Robert Rohde wrote:
DataRows[17]
could either be an array access or a call to an indexer which is nothing else than a method call.An indexer is an operator which is supposed to simulate accessing array's elements by sth like index, so the meaning is clear. A problem appears whe a coder implements an indexer which, for example, serializes an object to a file. However, if a coder knew about a "hidden feature" like indexers the he probably wouldn't be so unwise. In VB, if you see DataRows(17) and know that DataRows is a collection, then you think "well probably it is an indexer".
Greetings - Jacek
Jacek Gajek wrote:
if a coder knew about a "hidden feature" like indexers then he probably wouldn't be so unwise
Nicely said :thumbsup:
Excuse me for my improper grammar and typos. It's because English is my primary language, not my first language. My first languages are C# and Java. VB, ASP, JS, PHP and SQL are my second language. Indonesian came as my third language. My fourth language? I'm still creating it, I'll let you know when it's done! :-D
-
I was thinking about why I find something like the word "between" so confusing. I think the reason follows on from the VB versus C# discussion[^] that was going on in the lounge. To explain this it goes something like this for me: if someone told me to kick a ball "between" the goal posts this would mean to me to hit anywhere "inbetween" the goal posts and not hit the goal posts themselves. So for me there is a certain ambiguity in the meaning of "between". Whereas >= and <= holds no ambiguity for me and this is partly why I like C# over VB - the lack of verbosity seems to make it easier for me to understand... Maybe I am just too curmudgeonly...
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
I agree with you here, it is a totally valid keyword, but ugh. I don't think that way. I feel like since it's not accurate, could be vague or ambiguous, and there is a better alternative, I prefer to use >= <=.
"I have a theory that the truth is never told during the nine-to-five hours. " — Hunter S. Thompson My comedy.
-
Ugh, I just hate the bad usage of BETWEEN in SQL in some legacy SP's at my work. Horrible to use for finding values between a date range, when the date range can be 1 day, ugh!
"I have a theory that the truth is never told during the nine-to-five hours. " — Hunter S. Thompson
Yar. In my opinion
BETWEEN
should be>= && <
-
Yar. In my opinion
BETWEEN
should be>= && <
Exactamundo. It should be [A,B) because those intervals can be put next to each other without overlap. I've had to deal with a few stored procs that have comments recording the changes from + ' 23:59' to + ' 23:59:59' to + ' 23:59:59.999' etc. as the edge cases were slowly uncovered.
Curvature of the Mind now with 3D