Obviously it's impossible to cover all cases in a HN comment. I was perhaps a bit too broad when I suggested that the legal system doesn't treat code as speech. It does, sometimes; but even when it does, not all speech is treated alike for the purpose of legal analysis.
In the Bernstein cases, the Government was trying to squelch the author from publishing code that he personally wrote, that had scientific expressive value, and of which the Government required prepublication review, and the Ninth Circuit held:
"We emphasize the narrowness of our First Amendment holding. We do not hold that all software is expressive. Much of it surely is not. Nor need we resolve whether the challenged regulations constitute content-based restrictions, subject to the strictest constitutional scrutiny, or whether they are, instead, content-neutral restrictions meriting less exacting scrutiny. We hold merely that because the prepublication licensing regime challenged here applies directly to scientific expression, vests boundless discretion in government officials, and lacks adequate procedural safeguards, it constitutes an impermissible prior restraint on speech."
The Court, as you can see, was trying very hard not to declare some sort of framework or test to be applied to future cases.
In the Bernstein cases, the Government was trying to squelch the author from publishing code that he personally wrote, that had scientific expressive value, and of which the Government required prepublication review, and the Ninth Circuit held:
"We emphasize the narrowness of our First Amendment holding. We do not hold that all software is expressive. Much of it surely is not. Nor need we resolve whether the challenged regulations constitute content-based restrictions, subject to the strictest constitutional scrutiny, or whether they are, instead, content-neutral restrictions meriting less exacting scrutiny. We hold merely that because the prepublication licensing regime challenged here applies directly to scientific expression, vests boundless discretion in government officials, and lacks adequate procedural safeguards, it constitutes an impermissible prior restraint on speech."
The Court, as you can see, was trying very hard not to declare some sort of framework or test to be applied to future cases.