Is It appropriate to put code in slides for a technical presentation?
It may or may not be appropriate, depending on your audience (I also feel this way about equations). A couple things to keep in mind:


If you have non-technical people in your audience, you'll likely lose them for these slides, and there's a risk you'll lose them entirely.
Even if people are technically-inclined, they now need to read your code block, interpret it in their mind, and think about it long enough to see your point. And they'll have the distraction of you talking to them at the time. That's a pretty steep thing to ask your audience to do.


Generally, I think you'll likely be better served talking about these issues conceptually, rather than with code, which will require people to wade through it. If you must include code blocks, make sure they are clear, in a very recognizable style (no personal quirks or idioms, clear variable names, etc.) and clearly annotated as you walk through it.

But honestly, I don't think I've ever seen a talk with code-as-content (beyond "These 2 lines instead of these 15!") that I thought was aided by having it there.