Can't really think of one that could be improved by writing it as pseudo code.
Can't really think of one that could be improved by writing it as pseudo code.
Even every proof can be expressed as a program, see Curry–Howard correspondence [1].
> and most variables don't have a fixed meaning.
I think this is kind of the point of the original comment. For a physicist PV=nRT is concise and clear but for everyone else? The letters P, V, n, R, T can have many meanings but in the context of this formula their meaning is fixed. Why not write:
pressure * volume = AVOGADRO * BOLTZMAN * temperature
> Can't really think of one that could be improved by writing it as pseudo code.See example above, but I think it strongly depends on what one is familiar with.
[1] https://en.wikipedia.org/wiki/Curry%E2%80%93Howard_correspon...
Well, that is true, but that's still pretty far removed from any common programming language. And readability doesn't usually improve.
>For a physicist PV=nRT is concise and clear but for everyone else?
You've somewhat got a point there, physics would be a lot easier if all formulas and variables were actually defined when needed. But symbolic notation is still a necessity, simply because symbolic manipulation is really powerful, and it's a pain to have to write 'BOLTZMAN_CONSTANT' every single time, instead of just k_B.
Also, your notation might work for simple equations like the ideal gas equation, but an equation that's only slightly more complicated, the van der Waals equation, would become quite hideous:
(pressure + number_of_particles^2 * attraction / volume^2) * (volume / number_of_particles + excluded_volume) == BOLTZMANN_CONSTANT * number_of_particles * temperature
I really wouldn't want to have to write that out several times just to do some calculations with it.