Shouldn’t there be a distinction between the person writing the code and the person who chooses to use the code? An engineer shouldn’t be responsible for knowing the law and doesn’t have access to corporate lawyers that executives do. You could argue that there are legitimate reasons to write code that’s illegal for research purposes but never implemented. Why should an engineer be responsible for that?