What is with some school's honor code for computer science?

I have been a self-taught programmer for quite awhile now. If that has taught me anything it is to use google, stack overflow, and GitHub as a resource. No, I don’t steal all of my code just occasional lines of it. Sometimes though someone did something in such an efficient way that it would be stupid to “reinvent their wheel” by coding it myself.

This is quite at odd with honor codes that I have found. For example, Stanford says:
“You must not look at solutions or program code that are not your own.”

Does this mean I am not allowed to use stack overflow, or learn from other people’s solutions to similar problems? Does this mean I can’t work together on assignments with other students, or talk to them about how to make it most efficient? Or am I just misunderstanding? Perhaps this only applies to specific homework assignments?

The idea is to learn how to solve the problem and learn how to apply topics on your own. The goal is to write correct code, but it won’t necessarily be most efficient. You’re not learning how to code if you’re copying other people’s answers, especially if you don’t understand how and why they wrote their code the way they did.

Typically, looking up library/ syntax things is ok (example: “how do you do a for-each loop in java”), as well as googling error messages, but you should not be looking up solutions to your assignments/similar problems. You should not be discussing coding assignments with your fellow students, unless explicitly told that it’s allowed.

I grade hw and labs for several CS classes at my university (for a couple years now) and all of the professors I’ve worked with have had similar policies (as well as professors I’ve taken). Labs are either individual or pair assignments and you cannot work with anyone other than your lab partner, the professor, and the lab assistant. Programming assignments and hw assignments can usually be discussed with classmates at my university, but you may not share or view each other’s code, and are supposed to have no written notes on your conversation (although most professors don’t enforce the latter- since things like Facebook messenger have changed the way students hold conversations).

I should also note, that as a grader, I can usually tell if someone didn’t write their code themselves. It’s usually fairly obvious.