There is a separate risk to be aware of in the context of work on software or hardware, independent of following a dress code.
I describe it here as an anecdote because I have actually seen it happening.
We had to install our software on the customers system. It was a conservative customer, like a bank. And a hot day. My coworker showed up in shorts. Totally inappropriate, but the reception took it with humor, and the server administrator turned out to be a bearded "real admin" - no problem there.
So it was the worst case - shorts not at the company, but at it's conservative customer. Showing up the first time.
And it worked out perfectly well!
But then, it stopped working out well.
The computer we needed to work on was in the main server room. Which was stuffed with computers. And had a really, really strong air condition, for the one room separate.
We did not care that the noise of the air condition was certainly above occupational limits for office work.
But it was cold, really cold. Much too cold for shorts. So he spent some hours freezing next to me. (I felt it was uncomfortably cold with long trousers.)
When working with computers at an unknown place, it is absolutely realistic to end up in a server room unexpectedly. They are normally chilly, but ok in office wear - and somewhat uncomfortable in shorts.
(I already mentioned it was a administrator with the appropriate beard: Cooling the server room how much? As cold as I can get it, with no budget limit to worry about)
Even if it's not playing out that bad:
- The possibility to end up in a cold place should be taken into
Also, if you suddenly find yourself
- at a place where clearly shorts are inappropriate, don't panic.
If you are with a colleague wearing a suit with tie, you can possibly play the role of "the tech guy" - which comes with an allowance of some weirdness.