Computer Science Teacher
Computer Science Teacher - Thoughts and Information from Alfred Thompson

January, 2009

  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    Are You Smart Enough To Debug Your Own Code

    • 6 Comments

    I collected a whole bunch of links recently and have just started going through them in depth. One of them was a blog post called A Double Handful of Programming Quotes. The first quote in the list was this one:

    “Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.”

    - Brian Kernighan

    This is one of what I like to call a thinker. What does it really mean? At first it sort of makes one think that he is saying that people are not smart enough to debug their own code. Clearly that’s not right though. Is it? I think not. What I think he is really saying is that it doesn’t pay to be too “clever” or tricky in your code. It the code you right is some sort of tour de force that takes every ounce of your skill and knowledge then you’ll be in trouble if (when) something goes wrong. This may work when you are a new programmer working hard to stretch yourself and have a mentor or instructor with far greater skill than you posses but if you know it all like some of us do … Well maybe you shouldn’t be showing off too much.

    I’ve seen a lot of beginners write code that was too complex for them to debug themselves over the years. Often this happens because they try to write too much code at once before testing any of it. Or they get clever by using something they barely know and are bitten by unexpected side effects. As a teacher (or mentor) more experienced programmers see that a lot. most often it becomes a good learning experience. But for those learning on their own it can be a nightmare. That’s one of the reasons I believe most people are better off learning with others – a teacher, a senior developer or some other mentor who has gone before.

    This is also an argument for keeping things as simple as possible. Sure you have to do some tuning at times. And sometimes you have to use some advanced “tricks” or tools that push you to your limit. But if/when you do you should be pretty careful how you use them. (And maybe read the documentation as well.)

  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    Project Euler – Math Programming Projects

    • 3 Comments

    Oh you math teachers are going to love this one. No, really you will. And honestly it may encourage some of your programming students who don’t think they like math to get interested. I’m talking about a web site called Project Euler. There are well over 200 mathematical puzzles listed here that are best solved with the aid of a computer program. You probably could do them with pencil and paper but you could also probably build a large building without power tools. But do you want to?

    From the about page on the Project Euler website:

    What is Project Euler?

    Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems.
    The motivation for starting Project Euler, and its continuation, is to provide a platform for the inquiring mind to delve into unfamiliar areas and learn new concepts in a fun and recreational context.

    Have some students you want to challenge? Or perhaps want to challenge yourself? These may be just the projects you are looking for. Also as I understand it there is a ranking system for registered members so yet anotter chance for students to compete and measure themselves against each other if they are so inclined.

    Hat tip to Megan Golding on whose blog I found this link. She’s using these projects with middle school students so there is a large range of complexity here.

  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    Another Web Site with Computer Science Teaching Information and Resources

    • 3 Comments

    Over at the teaching computers to kids website I found a link to kidslike.info. This site is dedicated to providing free tools for teaching computer science, math and science. They are promising more subjects in the future. I found a number of interesting articles and information about computer programming books for young people. I found the site a bit confusing to navigate but that may be just me and the way I deal with the format they use. The format and colors are probably designed more to appeal to kids than to old bald guys like me. There also seem to be a whole lot of advertisements – though none that I saw were unsafe or inappropriate. Still sites that use Google ad placement have only limited control over what is displayed. So probably safe for kids but no guarantees.

    The tools they seem to focus on are Alice | Greenfoot | Python | Roblox | Scratch. I don’t know much about Roblox. Greenfoot is for use with and to help teach Java. Alice and Scratch I really like. Python has some good potential in my opinion. But if you are looking at any of those tools kidslike.info may be a place to do some of your research. I’d love to hear other opinions in agreement or disagreement on my assessments.

Page 6 of 8 (23 items) «45678