This is such a good question.
In my urban simulation courses, I ask the students for a flow diagram before they write the first line of code. That way they know where they are if they get lost, or use it as a revision tool if the model is not behaving as expected. For me, it helps me understand what they want to achieve. But as far as I know, there is now NetLogo tool that translates code to diagram, or the other way around. Would be great to hear from other members of this group about this topic.