On 05.04.2021 14:37, Christopher Schultz wrote:
Or, more literarily, given that the syntax of most (all?) programming languages is based on English (if, then, else, new, for, while, until, exit, continue, etc.), we (*) do normally ask "is your coffee cold ?" and not "is cold your coffee ?".

On the other hand, in English, coffee which is not hot is called "cold coffee" but in e.g. Spanish, it's "coffee cold".

To nitpick, in Spanish one would rather say "cafe frio".
But that's a bit beside the point since - as mentioned above - most currently fashionable programming languages are based on English.
Nevertheless, just for the sake of it, and in some imaginary situation
in which the Java syntax would be based on Spanish, one would probably have 
this :

  si (nada == requerimiento.obtengaCodificaciónCarácteros()) entonces {

  } sino {

  }

as opposed to

   si (requerimiento.obtengaCodificaciónCarácteros() == nada) entonces {

  } sino {

  }

.. which makes it even more striking that the first form deviates from the human language, because "nothing" cannot really be equal to anything, and thus the first form should always evaluate to false. (*)

(Which would also lead to more concise Java programs, because if you already know the answer, then you don't even need to make the test in the first place.)

On the other hand, this provides an interesting insight into English-speaking people's thought processes, for example as to the expression "nothing matches a good coffee in the morning", which is undoubtedly evaluated as true by many, although logically it cannot be.

:-)


(*) actually, this appears to be false : in Java, (null == null) is true.
See here for an in-depth discussion : https://stackoverflow.com/questions/2707322/what-is-null-in-java

P.S.
If anyone is interested about how it would be to write programs based on a Latin-inspired programming language, I recommend this :
https://metacpan.org/pod/distribution/Lingua-Romana-Perligata/lib/Lingua/Romana/Perligata.pm
(in which language it would be very difficult to confuse "==" and "=")

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to