Monday, November 25, 2013

Simpleton Geek Teaches Computer Programming Book 2 Ch 8D


8.4 Learning vs. Practice
“That was quite a fun session.” Peter admitted. He was in the teacher's office after class, per usual.
“Sure is. The songs you guys wrote are rather stilted, but it can't be helped. Playing it by ear is difficult enough, but without proper music theory, the tempo is rather robotic.”
“But the programming demands that the tempo is robotic.”
“Of course, not! The way I showed you is that tempo is a ratio of one note over another. However, it can easily be the number of jiffies.”
Peter did a face palm. “That's true. I didn't think of it!”
“Ha, it's best if you try to think of three different solutions to a problem. Each and every time.”
“So, each new problem will demand 3 different solutions?”
“Nope. Each problem. Even if you have encountered the problem before, try to come up with 3 different solutions.” said the teacher.
“But what good is it? I'll just come up with the same 3 solutions. So the time is wasted.”
“Not quite true. As your computer programming skills grow, you will come up with better solutions. The number of answers far outnumber the number of problems. Trust me in this that you will think of many new and novel solutions to existing problem.”
“Can you give an example?”
“Take the piano program. Do you see the text on top screen?”
“Sure, you had us print those characters in the shape of the keys.”
“That's a new solution. Traditionally, you would have computed the regions, and do a lot of calculations. Alternatively, you would have stored the data in arrays. Furthermore, you wouldn't be using letters to represents the notes. You would have been using numbers.”
“But your solution uses musical letters and you print them up on top screen.” said Peter.
“Exactly. That's new. Something I came up with. The reason is because you're just learning arrays, and frankly, without proper loops programming, it's just a pain. Loops make array programming an easy task, indeed.”
“So why not learn loops now?”
“Because, believe it or not, BEEP is a whole lot easier to learn than loops.”
“Well, I've learned some loops before, and it's not too bad.”
“In fact, they're rather easy. The reason is that they are conforming to structure. Well-structured programs are rather easy to do. However, compared to BEEP command, BEEP command is hands down way more simpler than loops.”
“Hmmm. It's true that BEEP is simpler than loops.”
“Also, the reason that I'm using musical letters is to facilitate your eventual lessons in music using MML.”
“MML? There's something about that in the Help menu. It looks extremely difficult.”
“It's rather confusing. However, at the heart, it's very simple. Notes are given by letters, tempo by numbers. There's more to it. Some commands for octave shifting, for example. But in simple terms, that's about it.”
“And this is not taught in school? Only you would do it this way?”
“That's correct. That's the difference between me and academia. You see sound and music are being put last. That's academia. I simply concentrate on what's doable and FUN.”

No comments:

Post a Comment