Choose Best Programming Language for Your Project

March 22nd, 2012 Leave a comment 3 comments
Like the article?
How to Choose the Best Language for Your Project

When beginning a new project it is sometimes difficult to decide which programming language would be best for your job. While each programming language has its strengths and weaknesses there are often reasons why one language is better over others. In this article I will discuss the prevalence of different programming languages to hopefully help you decide which to use for your next development project.

Just as a builder will tell you that it is much better to use a hammer to drive a nail than a screwdriver, an experienced programmer will tell you that certain languages are better than others when it comes to different tasks. So how do you decide which language is best for your project?

First, let’s look at which languages are being used the most. Based on a report developed in August of 2011, there are eight main web development languages. There were 13 criteria used in determining the popularity of a language:

  • The position of the website in Google search
  • The number of related results across the web
  • The number of blogs mentioning the website
  • The number of published books
  • The number of pages linking in
  • The traffic rank from Alexa
  • The number of bookmarks set for website from Delicious
  • Social networking presence from Twitter
  • Social networking presence in comments from Facebook
  • The number of shared on Facebook

Using all of this data to determine the overall score, here are the languages in order of popularity with score:

  1. 1. Python (74)
  2. 2. PHP (73)
  3. 3. Perl (47)
  4. 4. Java (44)
  5. 5. Ruby on Rails (37)
  6. 6. ASP.NET (35)
  7. 7. Visual Basic (29)
  8. 8. Lisp (12)

To better understand which language is going to suit your project best, here are the strengths and weaknesses of the top five languages:

Python

Python Pros:

Python has been on the web since 1995 and is a powerful scripting language used commonly to “glue” applications together. Python’s simple syntax makes it easy to learn and easy to write in, with developers often choosing to write in Python because they feel more productive. Since the main development implementation for Python will run in any environment, it is easy for programmers to get started using it despite their operating system. Many developers turn to Python out of familiarity and rarely do they find that it was a poor decision down the line.

Python Cons:

While Python can be fast due to its underlying C implementation, it can be slower because it is an embedded language. The runtime overhead can be a problem in larger applications. Deploying Python web applications isn’t as straightforward as it is in other languages like PHP and Python’s web frameworks have yet to catch up to an enterprise-level such as Java or .NET when it comes to features such as clustering, failover and management.

PHP

PHP Pros:

PHP has been online since 1997 and is a server-side scripting language that provides a solution to the challenges found in dynamic web applications. Unlike other programming languages, PHP was designed to function in a stateless, typeless environment where transactions requests only last a fraction of a second. Since PHP was designed to function the way the web works, it is often the language of choice when developing web applications.

PHP Cons:

One of the points of criticism for PHP is that it is a loosely typed language that does not work with modern methods of object-oriented programming. PHP is just a collection of files and scripts that run independently while communicating with each other. Since it is a language with a simplistic architecture, many developers do not consider that it is sophisticated enough for large-scale applications.

Perl

Perl Pros:

Perl has been on the web since 1995 and is considered the “granddaddy” of open-source scripting languages, since its first release is 1987. Perl’s greatest strength lies in pattern matching. It has tight integration with regular expressions and as a result has been the go-to language for projects that need to work with pattern-matching input. Perl also allows for in-place editing which allows you to edit files from the command line. Perl is an excellent choice if you need to write shell scripts, manipulate databases or if you are needing to work with a cross-platform language.

Perl Cons:

However, there are times when Perl is not a good fit. Since Perl is an interpreted language it can be quite slow. If your program will be doing a lot of intense calculation or if you are needing a real-time response in your interaction, Perl is definitely not the right choice. Getting good maintainable code can be difficult with Perl since Perl allows many ways to accomplish the same task. Many programmers find that it is difficult to maintain once the application gets too large.

Java

Java Pros:

Java has been a programming language for quite some time and is often used in desktop applications as well as on the web. One of Java’s big strengths is in portability since Java applications can run on any platform where you can install the runtime. It is a fully object-oriented language and allows for many development best-practices to be used during your development. Java can certainly deliver in robust performance, ease of maintenance and good scalability.

Java Cons:

If a developer is not well-versed in Java development best practices they may be creating more problems than fixing. Many developers have been improperly trained and do not end up using the language’s features to their best advantage. Arguably, this is a developer or training weakness than a problem with the language. Nonetheless, Java’s weaknesses are more subtle. Java has a certain amount of inherent inflexibility, is very verbose, less agile and over time Java project tend to become over-engineered.

Ruby (using Ruby on Rails framework)

Ruby on Rails Pros:

Compared to the other on this list, Ruby on Rails is still in its infancy, having been online since 2004. Ruby on Rails is a server-side scripting technology that has a great amount of ease of use which can lend itself to faster development speed. Rails provides a powerful API that allows the developer to focus on the task at hand rather than how they can accomplish it. Ruby on Rails also has a large amount of plug-ins and ready-made code that provide a strong framework-like backbone. While there are many large-scale projects currently using Ruby on Rails such as BaseCamp and 43Things, it is still too early yet to see if it will stand up to the bigger players.

Ruby on Rails Cons:

Since Ruby and Rails are still “young” there are many complaints from developers about existing documentation and there is little evidence to show a skittish manager when it comes to using it in a large-scale project. If your application requires establish security and/or needs to conform to certain regulations then Ruby on Rails is out. Ruby, compared to some of the other languages we have talked about thus far, is slow. While Rails can compensate for some of this slowness, it does require the use of more system resources to do so.

Conclusion

In the end, it depends on your development environment needs, the scale of your application, the needs of your customer and many other factors to determine which language you will be using not to mention what language you (and your team) feel the most competent in. When you bring all of these factors to the table it is usually a clear decision on which language you will be using, but if it comes down to choosing, it helps to be more informed about the strengths and weaknesses that come with each language. Being more informed will allow you to chose right the first time and not end up regretting that choice down the road.

External Links:

Help us spread the word!
  • Twitter
  • Facebook
  • LinkedIn
  • Pinterest
  • Delicious
  • DZone
  • Reddit
  • Sphinn
  • StumbleUpon
  • Google Plus
  • RSS
  • Email
  • Print
Don't miss another post! Receive updates via email!

3 comments

  1. EllisGL says:

    “Perl since Perl allows many ways to accomplish the same task.”

    I learned Perl before PHP and after I learned PHP I’ve almost forgotten everything about Perl just because how crazy Perl scripts can get. PHP can get crazy too, but Perl’s modifiers(?) can be a bit a of “Brain F***”

    PHP and Perl do inhereit C like syntax, which makes it a bit easier to deal with.

    Java, well, I find it to be too complex in coding, but seems to exhibit slowness, but this could be the mass amount of code written by people that don’t know how to optimize it.

    I’ve seen a lot of Python based web apps, but haven’t really got serious about learning it do to it’s “strange” syntax. By “strange”, I mean the strict coding standards, the indention style and lack of end of statement punctuation. Of course, I can respect the strict requirements, but it feel icky to me.

    Ruby, I played with it back in 05 – but once again, just felt funny. Ruby on Rails, I’ve never touched it, only heard stuff from other developers and seen things ported over from to other languages. I can’t say if what the other developers say, but if ORM/Query Building stuff is strictly enforced, then count me out. The things I’ve seen ported over want to me cry. If I have a “MVC” framework that’s supposed to me make things simple, why should I have to define every single thing in my route? Why you no autoroute? Of course, this is baised, becuase there could be great frameworks built with ROR.

    I did notice a couple missing, like GO (Google’s Go, not the original Go language), Node.js (Javascript), Erlang, C/C++. I’m sure there are others, but can’t think of them off the top of my head or heard of them… (Damned hipsters!)

  2. Josh Adell says:

    Your view of PHP not being able to keep up with object-oriented principles is about 8 years out of date, and had nothing to do with being loosely-typed. Rather, in the beginning, PHP was not built with OOP in mind. Since then, it has gained OOP capabilities that have been heavily influenced by Java and also functional programming abilities influenced by Javascript and Python. Look at any modern PHP frameworks (like Symfony) or the microframeworks (like Silex and Lithium). True, most novice PHP developers make applications that are just collections of files and scripts, but any professional PHP developer has for years been following the same MVC and other application architectures as any of the other languages you listed. PHP is just as suited to large scale web applications.

Comment