OK before I get started on this I will give a little of my personal background. I have been programming in one setting or another for nearly 10 years. Technically I did a little programming before that but not enough that I really consider it worth discussing. When I started I was working a night shift in a network operations center. Our job at night was to make sure that nothing exploded on our watch which was fairly simple and required very little time. To occupy myself, I started to look at how to program. A coworker was working through PHP and I decided to do the same.
Over time I moved on to Perl, Java, C#, VB, Python, and other programming languages. Often my choice of programming language was a requirement of the project I was working on. However, over the years I have had the chance to work with many programming languages for a variety of different projects. Although I have spent many hours in university computer labs and the computer science department, I do not hold any degrees in Computer Science. I tried it and I just wasn’t all that interested. Looking back on it now I probably should have just stuck it out but that is a discussion for a whole other post.
But the one thing I took away from my experience in the CS department is that many people treat their programming languages like other people treat their religion. You don’t dare point out that another programming language can do the same thing and maybe in a more efficient way and that some languages aren’t truly languages.
This post is meant to discuss this from my point of view and experience coming from outside the computer science realm. It is full of my opinion and I encourage others to post their opinion as well. The end goal is that we compile a list of questions to ask when a person is deciding on a programming language.
First let’s discuss a few myths that exist about programming languages. As I stated earlier, these are from my personal experience but I am certain that others have run into the same myths:
- There is one language and it is the best. It will fill every programming need I have ever had or ever will have. — This is simply not true. Every programming language has its advantages and disadvantages. Some languages are faster while others are more robust. Some are built for web applications and other are meant for building desktop applications. Deciding on a programming language requires some knowledge and expertise about each language in question. If you do not have the expertise necessary for a specific language you can find plenty of expert opinions on the Internet.
- Scripting languages are not actually programming languages. — Again this is simply not true. This is something I ran into a lot. I started with PHP and Perl and whenever I would speak with someone in the CS department my choice of languages were second class citizens in the programming world if they were allowed to be citizens at all.
So now we have to ask ourselves a few questions to help in the decision process:
- What are the requirements of the project?
- Every project has certain requirements. For example, it has to be a web application or desktop application. Maybe it will need to be both on the web and installed on the desktop. It has to interface with a database or use XML as a storage medium. It has to run on Windows, Mac, Linux or maybe all three. These are all specifications that you need to be aware of when you are deciding on your choice of language.
- Does it need to run on the web or on the desktop or both? — Some programming languages are designed to work on a web server while others are meant to be used to build desktop applications. This is an important question even though more and more languages are being built to run on both mediums. The Flex/AIR family is a great example of this. Technically using Flex/AIR does not allow you to build a web application and desktop application without a little bit of effort but the effort is minimal. (This may have to be a future blog post.)
- Does it need to work on Windows, Mac, Linux, or maybe a mobile operating system? — Depending on the audience of your application you may be able to build an application that runs on one operating system. However, if you are building a general purpose application you will probably have to plan for supporting multiple operating systems. Programming languages like Java and AIR were designed to resolve this problem. They utilize a runtime that is developed by the company and is installed on the computer that allows the developer to program for multiple operating systems. If you choose to work with a programming language that does not have a runtime then you will need to compile the application for each operating system.
- What data sources does it need to connect to? — This is really a question of ease of programming. I know of very few programming languages that can’t connect to a database or parse XML. But some programming languages are easier than others for this type of data source consumption.
- Does it need to interface with or be utilized within another piece of software? — The one and only time I have used Lua was to write a component that interfaced with Adobe Lightroom. At the time this was the only way to create components that interfaced with Lightroom. So sometimes there just won’t be much choice in the matter.
- What languages are you already familiar with and how much time do you have to learn a new language?
- I have always found that learning a new language is fun and exciting. However, it is not always appropriate for a given project. For example, when I was working on my Masters project I had to process a considerable amount of data that was in CSV format. The important part of what I had to do was to perform various statistic analyses to reach a conclusion. A colleague of mine suggested I use R because it has many of the analysis algorithms built-in or available as modules. However, I also had to do some pre-processing of the data. The same colleague suggested that I look into using Python because one of its strengths is processing large amounts of data; in addition, it has a module that allows a script to directly interface with R.In this case, learning a new language caused a reduction in overall time to perform the analysis. However, I spent a lot of time learning the programming languages. If you are in the corporate world and have to give updates on the status of a project not all managers are happy to hear that you are on day 3 of learning a new programming language. You may be better off working with something you are already familiar with.
- What is the deadline for the project?
- If time is a problem then you may need to choose a programming language that you are already familiar with or are proficient with. If you are proficient in multiple languages that meet all other requirements then you may have to get down to which requires the least amount of development time while providing the best programming and user experience.
These are not the only questions that you can ask when it comes to choosing a programming language but it is a start. This is purely based in my experience in the development world. What are your experiences? What is your favorite programming language?