Patrick Godwin's Blog-O-Rama!

Developers, developers, developers!

Does Managed Programming Make Us Lazy?

With the popularity of managed languages in recent years, we have no doubt seen changes in the way we program. In recent years, we’ve seen many additions to the .Net family of managed languages, such as WPF, LINQ, WCF, and XNA, to name a few. But have we given up our good programming practices for the convenience of managed languages?

I don’t know about the majority of programmers out there, but I find myself writing sloppy code while working in a managed language. I’m not saying that I break all rules of style or flow, but I’m not as careful as I usually am. Let’s say we’re writing a function in C++ that calls a simple integer type function. The rule of thumb would be to check what it returns, and based on predetermined conditions, handle any errors that may arise. A pattern I’ve noticed, mainly with C# programming, is a total disregard for exception handling. And even if the exception is handled, it isn’t handled well. Last time I checked, “Throw Exceptio” was not a smart way to handle errors.

I’m sure there are many other examples of Managed Programming leading to lazy programming. This is only the most obvious one I’ve delt wtih. What issues have you had with managed languages? Please write about them in the comments, get the conversation going.
Thanks for reading,
Patrick Godwin

Note: I’m very sorry for the short length of this post. The quality of this post is also extremely bad, and does a poor job of articulating my thoughts on the subject. Mea culpa.

What Language Should I Choose?

I get asked this question at least once a month. Someone I know will come up and ask me this question. I can never answer this in a clear, concise way. So I’ve decided to write a blog post on all the Pros and Cons of the languages I know, and refer my friends to this post.

VB.NET: I love this language and I would recommend it to anyone starting programming. I learned how to program in Visual Basic 2005 and I can safely say it is one of the easiest languages I have ever used. The syntax reads in an easy, clear way. You don’t have to worry about silly semi-colons or curly braces. Building a User Interface is simple with the Visual Studio WinForm designer. The inclusion of the .NET Framework in Visual Basic has given some great resources to this already great language. The only downside to VB.NET is the dependence on the .Net Framework/Mono Runtime. While this is possibly one of the greatest features in the language, it takes away a lot of the power you see in an unmanaged language. Not to much of an issue, but still a con.

C#: C# is another great language that I would recommend C# to someone who has some prior experience. While the syntax and program design can be annoying at times, it is a very powerful language. While sharing the same advantages as VB.NET, it also has integration with the XNA Framework. This is by far the best managed Graphics API available. With it’s support for Windows, XBox 360, and the Zune it destroys every feature available in Managed DirectX. The biggest issue with C# is, again, it’s dependence on the .Net Framework/Mono Runtime and it’s slightly annoying program design.

C++/C: This is the language I always suggest when I am asked that question. While it is one of the hardest languages to learn, it is the best. I feel that learning a good, unmanaged language gives you a proper idea of independent programming. You aren’t relient on a managed environment, like in the .Net and Java languages, which means you have to manage your own memory. This teaches developers safe coding practices and helps them develop clean code. Once you have a good hold on the language, the object oriented concepts should be studied. This is when C++ becomes a true powerhouse. This allows you to develop complex applications or even great game engines. Once you have C++ under your belt, most other languages should come quite easily.

Python: A very powerful scripting language. You can accomplish many tasks in Python with relative ease, given it’s large, supportive user base. The only issue with Python is it’s annoying syntax. I swear I have so much trouble reading Python code for education. In a language like Python it can be hard to enforce good style, which is a big minus for the language.

Java: What can I say about Java? It has to be one of the worst languages I have ever TRIED to learn. I want to know who the genius was that, while writing the AP Computer Science Curriculum, thought “Well, we assume that these students have very little, if any, prior programming experience. What language should we choose? I know! Java!”. Whoever this man, or group of men, was, he screwed up big time. Why choose a language that has an annoying syntax and no advantages over the .Net Framework and force students to learn it for what should already be a tough class. While it is managed like the .Net languages, the Java Runtime Environment is receiving updates ALL the time. What are they constantly changing? Honestly, if you program in Java you have the patience of a saint. It takes real skill to tame this monstrosity of a language.

Now there are many more languages thant those I have covered here. MANY more. But these are the languages that have seen the most attention in recent years, and these are the languages I have used. I’ll always suggest C++ and then VB.NET for a beginner, but you should take everyone’s suggestion as just that, a suggestion. Read some tutorials, try each language, form your own opinions. Whatever you find the easiest and cleanest should be the language you chose.

Thanks for reading,
Patrick Godwin

Edit: Forgot to mention Mono when talking about the .Net Languages. Edited for clarity.

High School Computer Science: A Student’s Perspective

Computer Science curriculum has always been a hot topic for discussion, but in the last few years I have seen more in more debate over how Computer Science should be taught. All the time I hear different School District Higher Ups and Teachers trying to come to some sort of agreement on a good plan. From what I have seen, most Computer Science classes are teaching the wrong ideas at the wrong time.

I’ve seen this first hand in Port Huron Area Schools. Don’t get me wrong, I love my programming classes. But there is no set curriculum for our District’s Computer Programming Class. How can a Computer Programming class exist without a curriculum. This forces the teacher to teach what the majority will understand the best while the more advanced students have to focus on their own skills. That isn’t a huge problem, but there should still be some sort of guidelines for teaching the class.

Another issue I’ve noticed with our Computer Science curriculum is the definition of a Computer Science class. When did a Computer Applications class become a Computer Science class. One of the Counselors at Port Huron Northern has gone around telling students that “It looks good to have a Computer Science class on your Transcript. I suggest you take Computer Applications”. Last time I checked “This is how you use Microsoft Powerpoint” was not acceptable as a Computer Science class.

Now I’m sure this is not the same around the country, but this is the main issue I’ve noticed. I also think, from glancing at the AP Computer Science course outline, we’re teaching the wrong things in introductory Computer Programming classes. Style is something that should be emphasized from day one. Button1 or Div1 are never acceptable if you ask me. They then spend the first few weeks of a class going over the introduction to a language, then move on to working on projects. In reality, they should begin by teaching theory. Students should learn how a program flows rather then jumping head first into a programming language. I learned this the hard way when I decided to pick up VB.NET as my first language. I made multiple design mistakes, spent many hours browsing MSDN for guidance, and used silly variable names like Button1 or TextBox2. If only I had understood good style or even the basic concepts of If/Then, For/While Loops, and Switch Statements.

According to the AP Computer Science curriculum, the first part of the course should be spent teaching Object Oriented Programming. This I support. But on closer examination, they recommend introducing Object Oriented Programming. This is ridiculous. If the student has taken a pre-AP Computer Science class, they should be introduced to the basic concepts of Object Oriented Design. If half the class is spent teaching a concept, then the second half is spent teaching the concepts in a language like Java, there is something wrong with that class.

Now these are just my thoughts, but I’m sure many people agree with me. Anyone else have an opinion on this? Your thoughts and comments are always welcome.

Thanks for reading,
Patrick Godwin