device programming best practices