> in the year 2020, why are we expecting people to write compilable code on a whiteboard
I think this is the bad assumption that's causing your confusion. Maybe this happens, but I think it's very uncommon.
The point of using whiteboards is to focus more on algorithms, data structures, and problem solving, not just spitting out code. If you make the applicant write actual code it limits the scope of the questions that can be asked.
So, it's actually beneficial that whiteboards aren't good for writing compilable code, because that's not what you want the applicant to do.
I think this is the bad assumption that's causing your confusion. Maybe this happens, but I think it's very uncommon.
The point of using whiteboards is to focus more on algorithms, data structures, and problem solving, not just spitting out code. If you make the applicant write actual code it limits the scope of the questions that can be asked.
So, it's actually beneficial that whiteboards aren't good for writing compilable code, because that's not what you want the applicant to do.