Supermarkets should not have to disclose their COST prices, because these are non public negotiations, not a public offer to buy/sell. That so many people wilfully choose not to understand this distinction frustrates useful conversation.
No the equivalent scenario would be a grocery store (or online store, hotel, airline etc.) not publicly advertising any prices at all. If you want something you have to take it to the cashier, and they will give you a personalized price based on whatever factors they choose.
Should that be legal? Maybe, maybe not. But there are plenty of laws out there that mandate that companies make pricing more transparent, because that is good for the end consumer.
Is the analog for hiring a software engineer closer to buying:
1. An economy round trip on Airline A, with max 2 checked bags, leaving from JFK at datetime D1 to SFO, returning at D2.
2. A round trip on a plane starting in New York in month M, all other details unknown.
Employees are different; how well matched they are for a given job is not knowable in advance of a first conversation, so for jobs were a range of value creation is possible, the range of possible agreement is wide and is certainly not a point.
I have two SWEs where one creates twice as much value as the other. If you hired both of them into your firm, which one created 2x as much value could easily switch.
I agree it's orthogonal to the original discussion, but I am interested in the hyptothesis that we'd be all better off if e.g. we could see the cost prices at supermarkets (and perhaps all their other relevant costs). E.g. is society better or worse off with less secrecy?