Friday, October 30, 2009

Programming is more than pointers and recursion

I apologize for last week's dry and boring post. This isn't a news blog, and it won't become one. I chose that topic because I was desperate to write about something relevant to programmers and the tech community, not because I wanted to write about it. Now I will only write about topics that interest me, topics that I can offer a unique perspective on. I won't become a me-too blogger.

...and now, for the reason you're reading this.

Today, I read a 2005 post from the venerable software-development blog Joel on Software about the problems with colleges teaching Computer Science through Java. I recommend you read the article before this post, but, to summarize, Spolsky says that because Java doesn't emphasize pointers and recursion, it isn't a suitable language through which to teach Computer Science. Here's why he's wrong.

Programming is more than just solving puzzles

First and foremost, I disagree with his view on the purpose of a CS program. He thinks that the goal of a college's CS program should be to weed out the students who aren't smart enough to succeed as programmers. Furthermore, he recommends that pointers and recursion should be taught as soon as possible to scare off the posers. That's poppycock.

The goal of a CS program should be to teach students how to develop high-quality software. Far too many programmers have no idea how to write readable code, much less create a large, functional system with lots of moving parts. Programming is intrinsically difficult, but teaching students only the most arcane and complex parts of the programming discipline scares away many potentially great programmers.

According to Steve McConnell, author of Code Complete, the best programmers are not necessarily the most intelligent, but the most humble. Someone who understands his mental limitations will use every technique available to simplify his code, reducing its complexity and thereby increasing its quality. Complexity is probably the number-one enemy of software quality.

Pointers and recursion aren't intrinsic to programming

All the CS theory and most of the content on pointers and recursion will never be used by the average CS graduate. Spolsky even says so:

Now, I freely admit that programming with pointers is not needed in 90% of the code written today, and in fact, it's downright dangerous in production code. OK. That's fine. And functional programming is just not used much in practice. Agreed.

He then says that these concepts teach students the mental flexibility to view a problem at several levels of abstraction simultaneously. I think this type of "mental flexibility" might account for some of the bad code recent CS graduates write. A graduate's "mental flexibility" could tempt him to demonstrate his new CS skills by writing overly complex code that functions on multiple levels of abstraction. As I said above, intelligence doesn't correlate strongly with a programming success, but ego certainly correlates with failure.

Please don't misunderstand my point. I believe that some of the most difficult areas of programming are the most important (and interesting.) I look forward to learning about recursion and its power. I plan on taking plenty of CS theory classes, learning about even the most esoteric aspects of computer programming. However, I don't think every student would benefit from this type of information. Because these topics aren't necessary to write great applications, I don't think they should be necessary to graduate from a CS program.

This post may, in fact, be completely off-base and unsupported by the facts. However, I've decided to make this blog more personal by sharing more of my opinions and writing about things I care about. I have been worried about writing content that's relevant to my intended audience, but right now, I simply don't spend enough time writing code and playing with my computer to generate a suitable flow of relevant posts. I'm reclaiming this blog as a tool against my personal battle with obscurity.


Edit: I was sorely mistaken. This post is the misguided rant of a readability zealot. See my current position here.

Sunday, October 18, 2009

Net neutrality: Innovation protection or unnecessary regulation

I consider myself a Libertarian on most issues. I'm generally in favor of the government getting out of the way of private innovation. For that reason, I became opposed to net neutrality as soon as I learned that it involved government intervention into the affairs of (arguably) private businesses: the internet service providers.

However, after learning more about the net neutrality issue and reading about the FCC's new net neutrality rules, I have decided to write a brief summary of the issue in favor of net neutrality.

What is net neutrality?

The issue of net neutrality is about the internet service providers' handling of information flowing through the internet. Information is transmitted over the internet in packets of information. ISPs can examine these packets to determine what type of information they are carrying. For example, an ISP can tell whether a user is watching a YouTube video, downloading email, or browsing Amazon.

For the most part, ISPs don't care about what type of information is being transmitted, but that is beginning to change. ISPs have realized that they can reduce the load on their networks by slowing down certain types of packets. This practice makes sense as a way to combat piracy by slowing down illegal traffic, but several ISPs have begun to use it to arbitrarily discriminate against certain types of traffic.

For example, Cox recently decided to make all FTP and P2P traffic slower, ostensibly to increase the speed of its other services. Although this may improve the service to most of its customers, it could be used for more nefarious purposes. For example, data being delivered from its partner's websites could be prioritized, slowing down all other traffic. Cox could even slow down a particular type of data in order to offer the full speed for a higher price.

Net neutrality legislation and policy attempts to stop this practice by forbidding ISPs from discriminating for or against any type of traffic.

Why should the government get involved?

Until recently, I didn't have an adequate answer to this question, so I couldn't justify the expense to the government and ISPs that net neutrality policy would create. I thought that competition between ISPs would prevent any overbearing packet filtering. However, according to Congress' most recent net neutrality bill, "the overwhelming majority of residential consumers subscribe to Internet access service from 1 of only 2 wireline providers: the cable operator or the telephone company." If both of these all-important ISPs decide to moderate your traffic, you won't have any other options.

Who opposes net neutrality?

Two major groups of companies oppose net neutrality for two separate but similar reasons. Most major ISPs providing high-speed internet are opposed to net neutrality because it limits their ability to profit from their high-speed internet services. Not only would net neutrality prevent them from reducing network load by slowing down some types of traffic, but also it would keep them from differentiating themselves from other ISPs by offering extra speed on certain applications. For example, net neutrality would prevent an ISP from making videos stream faster by prioritizing them over other traffic.

In addition, the high-speed wireless ISPs Verizon and AT&T have teamed up to oppose net neutrality on different grounds. Because both operate massive wireless data networks, they want to reserve the right to manage their traffic. They argue that because there is a fundamental limit to how much data can be transmitted through the wireless spectrum, they should be able to reduce the strain on their networks by slowing down high-volume traffic.

The problem with their argument is that packet filtering isn't the only way to limit network traffic. Net neutrality would allow them to limit data usage by setting customer data limits or reducing the speed of all traffic. The only thing the plan prevents is slowing down packets based on the information they contain.

What can I do?

Contact your congressman in support of H.R.3458, the Internet Freedom Preservation Act of 2009 and the FCC's recent action on net neutrality. The second point is important because some congressmen believe the FCC has overstepped its boundaries by declaring net neutrality rules while the House of Representatives was debating the issue. The FCC's rules will accelerate the enforcement of net neutrality, and that can't happen soon enough.