In a properly oriented programming class. The primary focus shouldn't be on learning to program, but using the computer to solve problems, where learning to program is just a big part of that. However, large-scale SE tasks don't belong there either (e.g. document requirements/plan development comes way later, but the first two points apply to all scales and should come in the very beginning).