Is code protected as speech by the First Amendment?

Is computer code protected as speech by the First Amendment? If the government passed a non-intellectual-property-related law that made a certain type of software illegal, without a compelling interest, would the law be constitutional? For example, suppose Congress passed a law banning hello world programs. Would that be constitutional? What about the code "translated" into English, as in the hello world haiku above?

asked Sep 18, 2022 at 5:09 17.1k 11 11 gold badges 91 91 silver badges 184 184 bronze badges

Worth looking into the history of the PGP encryption software. There was a time when exports were controlled from the US but it was apparently exported in the form of printed books of source code under free speech law protection.

Commented Sep 18, 2022 at 15:59

1 Answer 1

Is computer code protected as speech by the First Amendment?

Why wouldn't it be? Media of expression that are far more distant from speech, even to the point of having no linguistic content whatsoever, enjoy first amendment protection (flag burning comes to mind).

Having said that, I should note that first amendment protection is not absolute.

suppose Congress passed a law banning hello world programs. Would that be constitutional?

No, unless the law stands up to strict scrutiny. This means that it must be narrowly tailored, using the least restrictive means to advance a compelling government interest.

Now, it's certainly difficult to imagine a compelling interest served by banning "hello world" programs, but there are many other programs that could be subject to a ban, and indeed there are some kinds of programs that already are illegal (for example, it is not legal to write a program that sends daily death threats to someone).