473,382 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Semantics for elimitating double-negative conditionals

I've been fighting with this issue for a long time. Let's say I want to do
something in a procedure only if something is not Null, not Empty, not
Nothing, not Missing, or not EOF. The conditional is always ugly. If there's
an Else condition, you can often reverse the condition to eliminate the
double-negative, but that can mean putting the If and Else parts in a less
logical order.

I figured out a while back that the loop until EOF issue can be handled
exactly that way = Do Until rst.EOF, so that helps, but sometimes, I still end
up needing Not rst.EOF.

I've been trying for a long time to figure out a nomenclature for functions to
invert these conditions that are not simply including the word Not in the
function names, and I finally think I've worked out a 1/2 way decent
nomenclature. It's idiomatic and imperfect, but so is the existing
nomenclature I'm working from, so if this or something like it became a de
facto standard, we would all get used to seeing and using it...

Current Antonym
----------- ----------
IsEmpty IsAssigned
IsNull HasValue
Is Nothing Exists
IsMissing IsSupplied
rst.EOF BeforeEof(rst)
Len(...) = 0 HasChars(...) Synonym would be EmptyString(...)

Other nice derivatives:
FirstAssigned(Arg1, Arg2, ...)
FirstHasValue(Arg1, Arg2, ...)
FirstExists(Arg1, Arg2, ...)
FirstSupplied(Arg1, Arg2, ...)
Nov 13 '05 #1
2 1369

"Steve Jorgensen" <no****@nospam.nospam> wrote in message
news:9l********************************@4ax.com...
I've been fighting with this issue for a long time. Let's say I want to do something in a procedure only if something is not Null, not Empty, not
Nothing, not Missing, or not EOF. The conditional is always ugly. If there's an Else condition, you can often reverse the condition to eliminate the
double-negative, but that can mean putting the If and Else parts in a less
logical order.

I figured out a while back that the loop until EOF issue can be handled
exactly that way = Do Until rst.EOF, so that helps, but sometimes, I still end up needing Not rst.EOF.

I've been trying for a long time to figure out a nomenclature for functions to invert these conditions that are not simply including the word Not in the
function names, and I finally think I've worked out a 1/2 way decent
nomenclature. It's idiomatic and imperfect, but so is the existing
nomenclature I'm working from, so if this or something like it became a de
facto standard, we would all get used to seeing and using it...

Current Antonym
----------- ----------
IsEmpty IsAssigned
IsNull HasValue
Is Nothing Exists
IsMissing IsSupplied
rst.EOF BeforeEof(rst)
Len(...) = 0 HasChars(...) Synonym would be EmptyString(...)

Other nice derivatives:
FirstAssigned(Arg1, Arg2, ...)
FirstHasValue(Arg1, Arg2, ...)
FirstExists(Arg1, Arg2, ...)
FirstSupplied(Arg1, Arg2, ...)


["Steve Jorgensen" is a charter member of Access Morons. When he is not
writing brilliant essays, he spends his time promoting the benefits of
medical marijuana.]
Nov 13 '05 #2
On Wed, 15 Sep 2004 15:46:38 GMT, Steve Jorgensen <no****@nospam.nospam>
wrote:

....

I've been trying for a long time to figure out a nomenclature for functions to
invert these conditions that are not simply including the word Not in the
function names, and I finally think I've worked out a 1/2 way decent
nomenclature. It's idiomatic and imperfect, but so is the existing
nomenclature I'm working from, so if this or something like it became a de
facto standard, we would all get used to seeing and using it...

Current Antonym
----------- ---------- ....Len(...) = 0 HasChars(...) Synonym would be EmptyString(...)


I'm now thinking HasText is preferable to HasChars
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Karl Smith | last post by:
Headless <invalid_address@dna.ie> wrote in reply to Christoph Paeper <crissov@gmx.net>: > Semantically <span>this</span> is 100% identical to: > Semantically <div>this</div> is 100% identical...
2
by: maxw_cc | last post by:
Hi to all of you, I was wondering what the Semantics part in C standard is really for? What should be on the constraints part and what should be on the semantics part? Is the implementation...
14
by: Dan Jacobson | last post by:
How is this for correct HTML 4.01 headers?: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="zh-tw"><head> <meta http-equiv="Content-Type"...
6
by: Prof.Stanley | last post by:
HELLO ALL I AM TRYING TO PUT UP A PROGRAM THAT DETECTS DOUBLE VOWELS AFTER RECIEVING AN INPUT STRING; MY MAIN PROBLEM LIES IN THE INPUT CAN SOMEBODY KINDLY HELP DETECT ANY SYNTAX OR SEMANTIC...
35
by: dragoncoder | last post by:
Just a simple theoritical question to the experts. What was the rationale behind making STL containers follow copy semantics rather than reference semantics. References almost always make things...
11
by: garyusenet | last post by:
I have 'cli via c# on order', and in the mean time am reading 'Pro C# 2005 and the .NET platform' (Andrew Troelson). I'm just reading about the 'five types defined in the CTS'. Specifically Struct....
10
by: gauss010 | last post by:
Suppose I have an object A of type char. Each A is a buffer containing a string, and I want to sort the M strings of A using the strcmp function. The description of the qsort function says that I...
2
by: =?Utf-8?B?QU1lcmNlcg==?= | last post by:
I would like to define a structure or a class with an array field that behaves like a simple value-semantics variable. For example, I want something like public structure polynomial public a()...
3
by: Evan | last post by:
Does anyone know of a library that will give me integers with saturation semantics? E.g. for a signed saturating number, INT_MAX + 1 should give INT_MAX rather than INT_MIN. Ideally it would be...
3
by: Gianni Mariani | last post by:
So I was put straight that double(v) is the same as (double)(v) recently and I'm somewhat surprised. I'm not the only one. I think T(V) should have exactly the same semantics as...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.