There are two ways to break down the learning of a more complicated process. Either you teach the student each individual piece and you let them work it all together into a total process, or you teach the whole process and let the student work out the individual steps and what they mean. So I'm referring to PHP in particular here so let's go through the example I have in mind.
As soon as the student has a handle on how to deal with variables we move onto using forms to submit data to a secondary page using $_POST or $_GET. This is primarily done because it can give a student a complete application very quickly, giving them less of a 'you will get there eventually' approach and more of a 'you are already there'. This is also helped greatly by the student's already existing knowledge of HTML forms. However with the limited knowledge of what is actually happening students later find key steps in this process appear out of nowhere. For example:
Shortly after students find the important of checking if a variable exists A few weeks after this students discover how they can validate the data sent through the form, to check that numbers were submitted for number based answers etc. A week or so later students discover that this $_POST and $_GET nonsense they were playing with are arrays.
I find different students re-act to this differently, and tend to fall into four groups.
Students of this group tend to be quick and generally learn by breaking something and figuring out why. These students will have figured out to a vague extent the properties and problems of the first iteration of forms, and while they may not understand that $_POST is an array, they will understand it is a variable with properties that don't seem to match those of standard variables.
Students of this group are often quick, but don't learn from experimentation. They followed the exact examples shown in the original form design and strived to understand everything that was explained to them. However they feel that the knowledge being held back from them in the initial demonstration was unfair, and may even feel like the teacher doesn't trust them to be able to absorb it all at once.
Students of this group tend to not be the fastest, but they will absorb the information as it comes. For these students the order of information is largely irrelevant and they will simply know exactly what you teach them.
Students of this group tend to be the ones that are not the quickest, but try to absorb all the information as it comes. However, unlike the last group they notice the lack of information and understanding, which leads them to start to get anxious. Did the teacher go through this information and they just missed it? Should they know how to use isset()? Why are there errors when they forget to enter data into the field?
Looking at this, I think it's vitally important to understand these four groups and how you can identify the student's type in order to present the information the best possible way. For example, if you notice that you have a class of primarily anxious students you may want to rework the order of teaching or simply ensure that the students know exactly what they are expected to.
It is also vitally important that if you are presenting new information that combines with previous work you add this new information as quickly as possible. The worst result from this process is to end up with students stuck in the rut of the previous mode of creation without being flexible enough to add the new information.
This problem is also very prevalent in the martial arts. If you are teaching something as seemingly simple but as infinitely complex as a common blow there are a huge number of factors that the fighter needs to know including:
So do you simply go through these steps one by one before allowing them to through their first blow? You could, and you may even end up with better students by the end. But what of the students who dropped out because they didn't feel that they were moving forward at all? Do you refuse to let them take part in drills or training fights until they have mastered the single pieces over the upcoming months?
Generally in our local group we attempt to get new fighters throwing blows within their first training session, and it is primarily for the reason of fun and enjoyment over pure knowledge. We may run into problems down the line where a fighter doesn't have perfect hip rotation, but if that fighter has been training at a vaguely consistent rate and have not been doing it for decades they have not fully solidified the blow into a rigid system and can change.