[Development] Avoid overloading of 'error'

Thiago Macieira thiago.macieira at intel.com
Wed Jun 10 18:42:03 CEST 2015


On Wednesday 10 June 2015 15:14:07 Hausmann Simon wrote:
> Hi,
> 
> I think renaming the getter to lastError is nice! I however do like error as
> signal name and it looks good in qml as onError:...

"onError" screams of Basic to me...
	ON ERROR GO SUB foo
or worse
	ON ERROR RESUME

I don't mind the getter still being named "error" because it's a noun and we 
name our properties (and thus the getters) after nouns.

The problem is the signal: the coding style is that signals are named after 
verbs in the past, indicating that something happened. "error" has no verb in 
the past. Even "errored" would be better, though that's unusual.

I think "error" + verb in the past is best, so here are my suggestions, in no 
particular order:

	errorHappened
	errorCaught
	errorEncountered
	errorOccurred		(people will get the double r wrong)
					https://en.wiktionary.org/wiki/occured
	errorFound
	errorDetected
	errorDiscovered
	errorNoticed
	errorSeen
	errorObserved

alternatively, with the verb in the active:

	caughtError
	foundError
	detectedError
	discoveredError
	noticedError
	sawError
	observedError

If I break out the thesaurus, then we also have

	errorBefell
	errorCameAbout
	errorTookPlace
	errorMaterialized
	errorRemarked		(reminds me of [1])
	ranIntoError
	ranAcrossError
	cameAcrossError
	remarkedError
	chancedUponError	(even more so!)
	pickedUpError

[1] https://www.addedbytes.com/blog/if-php-were-british/
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list