Racism is ok outside of the workplace? Thought not...
The workplace is a special situation where people's freedoms and rights are heavily restricted, and some conformist norms are imposed upon them, greatly limiting what actions and speech they are allowed, as people in a workplace are expected to behave in a "professional" prim-and-proper manner while they are present in a workplace, to promote productivity, successful business, and productive worker-coworker relationships within the environment.
The same constraints generally exist with employee-customer relationships outside the workplace and employer functions, But when the employee is off the clock and not representing the boss --- they can go to the bar and get drunk.
So long as they don't break any laws and get arrested or otherwise make themselves into a figure of infamy among the public or their coworkers/business associates, outside the workplace people can do pretty much what they like, without affecting their employment or business arrangements required to support themselves or their family.
Racial discrimination is not okay, period, but racially prejudiced comments would be possible in a personal code project, and such speech would fall under 1st amendment protection and free speech.
Such comments would presumably reflect their beliefs, and they might as well make those comments. That way other people have a chance to embrace the matter of fairly rebutting the comments using rational arguments, to help persuade the person the error of their ways.
On the other hand, if they didn't make the comments: they are likely still feeling the same way, and noone sees the need or does the work to help reject the comments and let everyone learn what some racist people are thinking exactly and help make sure everyone understands that the particular thinking is wrong.