Advertisement

How to organize the code and explanation in a tutorial?

Started by September 05, 2014 05:23 PM
2 comments, last by Icebone1000 10 years, 2 months ago
I recently started a blog, and I am currently writing programming tutorials for it. My first post is available at http://www.diusrex.com/2014/08/qt-model-view-programming-tutorial/.
How do you prefer the code and concepts to be introduced? There are three major ways of organizing them:
1) Completely explain the concepts first, then show the code. The advantage of doing it like this is that the reader would know what the code does before they read it.
2) Show the complete code and then explain what it does. The advantage of this organization is that the concepts will be tied into the code that was previously looked at.
3) State the general purpose of the function, show the code, then explains the concept in the code. The advantage for this method is that they will know the general purpose of the code as they read it and the concepts will be tied into the code they just looked at.
Which organization do you prefer when reading a tutorial or is there a different way to organize the concepts and code that I haven't thought of?

#1# Explain what you need to do.

#2# Explain how you will do.

#3# Show code doing.

#4# Explain the code doing (comparing 2 and 3)

Advertisement

#1# Explain what you need to do.

#2# Explain how you will do.

#3# Show code doing.

#4# Explain the code doing (comparing 2 and 3)

Ok, so mostly like my 3rd option, but explain everything more before showing the actual code?

#1# Explain what you need to do.

#2# Explain how you will do.

#3# Show code doing.

#4# Explain the code doing (comparing 2 and 3)

Ok, so mostly like my 3rd option, but explain everything more before showing the actual code?

I guess..

Its just how Id like a tutorial to be.

In #2# the explanation would be algorithm wise, in 3 and 4 you explain the algorithm implementation wise.

If the code is obvious enough or commented enough maybe #4# becomes unnecessary.

This topic is closed to new replies.

Advertisement