Isn't in some sense, depending on the in-group you pretend to fit into, change the "dress-code" you're supposed to follow.
Some companies might be strictier, but I don't think I've ever had my capacity as a dev put into question due to my clothes
The only places where that mattered, was in-office work where customers could come-in and thus see you, and still then it didnt matter much if you weren't on a customer-facing role
That brings me to what I think is the most interesting contrast between your examples. Both #1 and #2 require an awareness of group social dynamics, whereas #2 requires a degree of self-awareness on top that I've found to be rare (or at least rarely revealed)