

Why are introspective verbs used for data in programming? - petar

Why are verbs like “be”, “believe”, “understand”, “sense”, and so on rarely seen in source code? When they are seen, why are they usually names of variables and not names of functions, as would befit a verb?
======
tjr
Just guessing / offering personal opinion... such words would rarely make
sense in source code.

What would a function called "believe" do?

I can imagine such function names in, say, artificial intelligence projects,
but even there used (probably) in a loose way. I suspect few web applications
or iPhone games or flight control programs would be doing any "believing",
real or imaginary.

Of the words you suggested, "sense" seems most likely to appear in real use,
as robotic software and such may be literally accessing sensors.

------
ACow_Adonis
Also, the last thing we need is more confusing language that gets in the way
of absolute beginners realizing there's no ghost/consciousness/intentionality
in the machine.

Indeed, unless you were doing, say, work on some scientific survey about
people's beliefs, or whether school children understood a passage, or a game
where these are literally mechanics, or something like that, i'd even be
loathe to suggest ever seeing those as either function names or as variable
names.

Its bad programming style 101 to give your variables/functions names that have
some kind of cognitive connection/bias in people's minds apart from the
function they actually serve in the code, and those are some pretty loaded
words in most cultures...

------
bjourne
The verbs aren't choosen at random. They are almost all a write-word (write,
set, create, put, save, update, dump, clear, reset, print, append, ...) or a
read-word (read, get, ensure, load, check, ...). But the verbs you list
doesn't fall into either category. Think of what it would mean to command
someone to "believe!" it doesn't make sense (to a non-sentient entity
anyways!). "print!" otoh, is perfectly understandable.

