code generation pitfalls