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

    Teach Yourself Programming in Ten Years

    • 4 Comments

    I remember when I finished first grade and I thought I was done with school. The reason I wanted to go to school in the first place was to learn to read and at the end of first grade I thought I had that down cold. What more was there to learn? I see some of that with programming as well. People take a first programming course and they think they’re done - they’re programmers! Well not so fast. There is more to it than that just as there was more to learning and even reading when I finished the first grade. Others come to me and tell me they want to learn enough programming to create a specific application (rarely one that is that easy) or the next Halo 3 (never that easy) or something. There is this cram school mentality that seems to overtake so many people. Unfortunately, programming like so many things takes a while to really, deeply learn.

    I ran across the article Teach Yourself Programming in Ten Years by Peter Norvig recently and it does a good job of addressing this very issue. Here is a key paragraph from that article:

    Researchers (Bloom (1985), Bryan & Harter (1899), Hayes (1989), Simmon & Chase (1973)) have shown it takes about ten years to develop expertise in any of a wide variety of areas, including chess playing, music composition, telegraph operation, painting, piano playing, swimming, tennis, and research in neuropsychology and topology. The key is deliberative practice: not just doing it again and again, but challenging yourself with a task that is just beyond your current ability, trying it, analyzing your performance while and after doing it, and correcting any mistakes. Then repeat. And repeat again.

    What is key in so many of these endeavors? Practice. Careful, deliberate practice. One can get that practice several ways – projects in class, projects while working for a living, projects for fun and competition (Imagine Cup is a great one for college students USACO is good for many high school students.), and more. But programming is still a skill – some would say an art or perhaps a craft – and it takes practice to get good at it.

    Some students like to point out some of the top programmers in the world did not go to college or dropped out (Bill Gates for example) but they neglect the fact that those people all practiced A LOT! They wrote code day and night. Plus of course they are really really smart. For most people I think formal training is a huge help and speeds up the learning process greatly. But in the end practice is what makes it work. That and a willingness to learn constantly. The article includes a recipe for programming success that lists more items than just practice BTW. I think it undervalues formal training but it does include it.

    The relative merits of formal training and practice and what the ratio should be makes for an interesting discussion. I really think the best people have some of both. What do you think?

  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    Useful Web Links for Computer Science Teachers

    • 4 Comments

    I keep doing sets of links to hand out at various conferences. It seems like every time I do the list comes out a little differently. Some new things. Some things have new addresses. And the order of things changes for the audience. This list is from a pair of handouts I have put together for a high school curriculum panel at Stevens Institute of Technology and for TCEA. Since I’m been working on this I haven’t has as much time to write for the blog. So here’s hoping this serves as double duty.

    K-12 Faculty Community Site http://www.microsoft.com/education/FacultyConnection/precollegiate 

    A source for curriculum resources, teacher forums, and program announcements

    Programming Languages for Beginners

    Alicehttp://www.alice.org  – A 3-dimensional, drag and drop programming language from Carnegie Mellon University

    Kodu - http://research.microsoft.com/en-us/projects/kodu/

    A graphical programming tool for younger students. Kodu will be available via Xbox Live Marketplace this spring. A version for schools is in the works. I included that link because I am talking about it to let people know it is coming.

    Scratchhttp://scratch.mit.edu  – a light weight 2-dimensional, drag and drop programming language from MIT

    Small Basic - http://msdn.microsoft.com/en-us/devlabs/cc950524.aspx

    CSUnplugged http://www.csunplugged.com

    Computer Science Unplugged is a series of learning activities that reveals a little-known secret: computer science isn't really about computers at all!

    MSDN Academic Alliance http:// www.msdnaa.net

    A Microsoft program for schools to get Microsoft Development software for labs, teachers, and students.

    DreamSpark for High schools https://www.dreamspark.com/HighSchool/Default.aspx

    DreamSpark High School provides professional-level development and design tools to students enrolled in an accredited, secondary educational institution at no charge.

    XNA Game Studio Express http://msdn.microsoft.com/xna

    Software for developing games for Windows, the Zune and the XBOX 360. Also links to the XNA community with sample code, tutorials and support forums.

    Visual Studio Express Editions http://msdn.microsoft.com/Express

    Free development tools (IDEs) for Visual Basic, Visual C++, Visual C# and Visual Web Developer

    Beginner Developer Learning Center http://msdn.microsoft.com/en-us/beginner/bb308754.aspx

    A web site for people of all ages who want to learn programming and web development. Tutorials, videos, projects and web casts

    Microsoft Robotics Studio http://msdn.microsoft.com/robotics

    Visual Programming Language for robots, runtime libraries for higher level programming, a 3-dimensional robot simulator with sample simulations, tutorials, and videos

    Coding 4 Fun http://blogs.msdn.com/Coding4Fun 

    A web site for hobbyists and computer tinkerers - sample projects and information for doing fun and interesting thing with programming; often combined with interesting or unusual hardware

    Alfred Thompson’s Blog http://blogs.msdn.com/AlfredTh  Which is of course right here.

    Sharing of resources, links, and information of interest to K-12 Computer Science Teachers

Page 1 of 8 (23 items) 12345»