7

I'm a developer, and as part of the development process we'll often 'do something once if it hasn't been done before' in certain parts of our code.

For example, if I require a connection to a database I will connect only if I'm not already connected, I will not try to connect to the database if I am already connected.

I want the word that goes into these blanks:

I am acting or am coding [......] by checking for a connection first prior to connecting.

If I connected to the database twice it would not be [.......].

There is definitely a word for this, but it escapes me.

Apologies for the example, but it's the exact context in which I'd typically use this word. Another example may be only assigning a value to a variable if it hasn't already been assigned a value. Basically, avoiding redundant and unnecessary action by checking it had already been done.

Word It's Not:

  • Efficient/ly, efficiency
  • Optimal, optimisation
  • Concise
  • Singular, single
  • Elegant, elegance

EDIT

Since a bounty of 100 has been assigned, I think it deserves another example:

I will give my variable the value 'A123' if I have not, previously, gave my variable the value 'A123'

15
  • 2
    Elegant is a word often associated with clean, efficient code... Commented Jan 6, 2014 at 9:16
  • @ElendilTheTall - you're totally right, this would be considered elegant code, but that's not the word unfortunately. Thanks for your reply. Commented Jan 6, 2014 at 9:16
  • 1
    Hmm. Well, you help me with this MySQL problem I'm having and I'll find your word ;) Commented Jan 6, 2014 at 9:19
  • haha give me the link to your SO question and I'll do my best. Commented Jan 6, 2014 at 9:20
  • 1
    I'm confused. Are you looking for an adverb, adjective, verb, what..? Or can you not remember? Is this word related to OOP in anyway? Do you have any idea what letter it might start with?
    – dockeryZ
    Commented Jul 15, 2015 at 19:14

16 Answers 16

15
+100

If you want to impress the yokels with a real computery-sciencey word, try "idempotent". An idempotent process is one that you can run over and over again, but it will only change things the first time.

5
  • Brililant Doug! Been after this word for a while (as you can see). Thanks very much. Commented Jul 16, 2015 at 14:17
  • I was initially offended that you had poached my answer...but it seems your answer proceeded mine by 5 hours... I guess I should have read the existing replies more carefully. Commented Jul 16, 2015 at 14:17
  • 5
    I suppose the answer itself is idempotent. : ) Commented Jul 16, 2015 at 14:21
  • @DaveMagner - haha nice! And for what it's worth, I didn't find the decision an easy one to make: meta.english.stackexchange.com/questions/7004/… Commented Jul 16, 2015 at 16:03
  • It's not a computer science word -- it's a word from mathematics that's coming up on 150 years old. So it maybe predates anything you could call computer science by 75 years or so. As usual, computer scientists are stealthily corrupting the meaning of this word. Commented Nov 3, 2017 at 23:06
7

There are quite a few relevant programming concepts. Three I find particularly related:

singleton pattern — In software engineering, the singleton pattern is a design pattern that restricts the instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system. The concept is sometimes generalized to systems that operate more efficiently when only one object exists, or that restrict the instantiation to a certain number of objects.

lazy loading — Lazy loading is a design pattern commonly used in computer programming to defer initialization of an object until the point at which it is needed. It can contribute to efficiency in the program's operation if properly and appropriately used. The opposite of lazy loading is eager loading.

DRY — In software engineering, don't repeat yourself (DRY) is a principle of software development, a principle aimed at reducing repetition of information of all kinds, especially useful in multi-tier architectures.

Of these, only DRY would fit into your example sentence in any meaningful way but it doesn't exactly convey what you intend.

The only other term I know that would be related and fits the structure of your examples is "defensively":

I am acting or am coding defensively by checking for a connection first prior to connecting.

If I connected to the database twice it would not be defensively.

This relates to the specific term defensive programming:

defensive programming — Defensive programming is a form of defensive design intended to ensure the continuing function of a piece of software in spite of unforeseeable usage of said software.

In this case, the defensive action is protecting yourself from multiple connections by checking for an existing connection. This avoids unnecessary memory usage, memory leaks and poor performance.

4

I think you might be looking for the word 'idempotent'

Idempotence (/ˌaɪdɨmˈpoʊtəns/ eye-dəm-poh-təns) is the property of certain operations in mathematics and computer science, that can be applied multiple times without changing the result beyond the initial application.

An idempotent operation functions like a light switch, flipping it up won't change the state of the light if it's already up.

1
  • Thanks very much for this answer Dave! Your input is much appreciated, been after this word for ages - to see it suggested twice did me no harm at all! Commented Jul 16, 2015 at 16:02
3

Lazy is the key principle here.

Concepts like lazy initialization, lazy evaluation, and lazy loading represent a common pattern used in resource limited systems (like smart phones, for example) where you don't want the user to encounter long wait times or run out of available memory unless they actually need the product of the lazy operation.

In a smart phone, lazy initialization is used for creating complex objects like views and view controllers. For complex user interfaces with many views and their view controllers, keeping them around is simply too resource consuming, so a common practice would be to create on first use and destroy when not being used (usually only when limited resources are being demanded and with the understanding that it can be re-created if it needs to be used later).

Let me show how your example statements might be worded a little better if lazy is the word you are looking for:

I am acting or am coding lazily by checking for a connection at first use.

If I connected to the database twice it would not conform to the lazy design pattern of initializing at first use (and retaining for later use).

The lazy pattern differs from the singleton pattern, which deals with assuring that only one instance of a particular class is created. A singleton instance may be created lazily, but so can multiple instances (each created on its own first use).

For example, you may have two instances of a database controller for working with two different databases. This does not fit the singleton pattern, but the coding of the database controllers can still fit the lazy pattern.

2

How about something along the lines of initial. "Initially check for a connection"

2

It appears you're looking for both an adverb and an adjective, so here are some suggestions in both forms:

deliberate/ly

advised/ly

proactive/ly

2
  • I was going to say deliberate. Commented Jul 16, 2015 at 3:01
  • But after some deliberation, you chose the wiser course?
    – jsoteeln
    Commented Jul 16, 2015 at 3:44
2

I'm thinking initialise (or initialize for AmE speakers) might be what you're looking for?

to set (variables, counters, switches, etc.) to their starting values at the beginning of a program or subprogram.

Source: dictionary.reference.com

2

I will give my variable the value 'A123' if I have not, previously, gave my variable the value 'A123'

You might be using a "cached write" or a "write cache buffer".

I require a connection to a database I will connect only if I'm not already connected, I will not try to connect to the database if I am already connected

You might be using any of:

  • "Resource Acquisition is Initialization (initialize the connection when you acquire it)
  • "Object Pool" (a pool of reusable connection objects)
  • "Virtual Proxy" (which you have but don't initialize until you use it).

do something once if it hasn't been done before

That might be "lazy initialization".


If you're looking for an adjective it might be "just in time" (if that even counts as an adjective).

2

How about pragmatic/ly?

dealing with the problems that exist in a specific situation in a reasonable and logical way instead of depending on ideas and theories

source: http://www.merriam-webster.com/dictionary/pragmatic

2

I think the word you are looking for is economically/economical.

"in a way that uses no more of something than is necessary."

1

I believe the word you are searching for is optimal

Per Merriam-Webster:

most desirable or satisfactory

You could also use optimized (the present passive participle of optimize).

That's at least how I describe such practices when I do programming work.

But in a strictly linguistic sense, the word you are doing might be parsimonious under the definition "sparing; restrained".

4
  • You might also use 'efficiently' Commented Jan 6, 2014 at 9:10
  • Unfortunately this isn't it. You're spot on with the usage, and this definitely fits, but there's a particular word I had in mind, which I've forgotten. I'll edit the OP to include words it's not. +1. Commented Jan 6, 2014 at 9:11
  • 1
    "Optimum" is a terrible word to use around programmers.
    – Hot Licks
    Commented Jul 15, 2015 at 11:43
  • Actually I prefer parsimonious here. Commented Jul 16, 2015 at 9:05
1

Is the word close to troubleshooter, troubleshooting?

Anything else I could think of are: debugger-debugging, compiler-compiling,identifier- identifying, diagnosis - diagnosing.

1

I suppose you could use anti-redundancy in this context.

I am acting or am coding anti-redundantly by checking for a connection first prior to connecting.

If I connected to the database twice it would not be anti-redundant.

Though that second one is a double negative, so in that case, you'd want

If I connected to the database twice it would be redundant.

1

prudent sensible

`I am acting or am coding prudently by checking for a connection first prior to connecting.

If I connected to the database twice it would not be prudently.`

`I am acting or am coding sensibly by checking for a connection first prior to connecting.

If I connected to the database twice it would not be sensible.`

1

Conditional / Conditionally

con·di·tion·al

subject to one or more conditions or requirements being met; made or granted on certain terms.

0

How about 'nonredundant', as in a nonredundant system? I'm sure it's not perfect but it sort of works.

I am acting or am coding without redundancy by checking for a connection first prior to connecting.

If I connected to the database twice it would be doing more than necessary and hence redundant.

Resources: Nonredundant system. (n.d.) McGraw-Hill Dictionary of Scientific & Technical Terms, 6E. (2003) @ The Free Dictionary by Farlex

Redundant: Webster's Revised Unabridged Dictionary, 1913

4
  • Is 'redundance' a word? Commented Jul 15, 2015 at 10:02
  • 1
    @EleventhDoctor - Redundance is definitely a word, but exactly the opposite of the concept being discussed.
    – Hot Licks
    Commented Jul 15, 2015 at 11:44
  • 1
    That's almost trivial to fix if somebody accepts my edit...
    – Tonepoet
    Commented Jul 15, 2015 at 20:13
  • Ooh - so OP's example would now read: "I am acting or am coding nonredundantly by checking for a connection first prior to connecting." That could work! Commented Aug 20, 2015 at 11:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.