When I (formally) learned how to program at university, I was taught a number of "rules." One of these rules was to pick one language of implementation for the program I am working on and stick with it! If you start programming in C#, then you'd better stick with C# all the way through!
Recently, I've asked myself if this rule is worth breaking (and when it is appropriate to do so). This rule is just something I originally took as a tenet and didn't bother to question.
It occurred to me the other day that every language has its strengths and weaknesses. For example, I find R is probably the best language to use when it comes to matrix operations and statistical tests (or Matlab). Python is very quick to program and easy to understand. C/C++ is great to program in if speed is important (or Java if one is so inclined). Bash is great for file manipulations, parsing, and match operations. MySQL is the standard for databases.
Picking a language and sticking with it for the implementation of a program will likely make it efficient for one type of function and much less so for the others. With all of the great languages out there, it would be a shame to not leverage them and their strengths.
On the other hand, it will also be easier to share the program if it is written in one language and does not have a slew of dependencies.
Essentially, we're trading ease-of-use for high efficiency.
How I use programming languages for modern bioinformatics:
Python - application development, proof-of-concepts, complicated scripts
C/C++/Java - programming (slow) functions to port to my python code, speeding up the code in the big picture
Bash - parsing and file manipulation operations, simple scripts, one-offs
R - data visualization and statistical tests
MySQL - filtering and manipulating data in a database
It is important to have a handle on a language in each category. Many of my heavier pipelines contain at least three or more of the languages above (and sometimes more than once).
Just for the record, I don't have anything against perl. I've just found myself drifting farther and farther away from it over the years.
Monday, May 16, 2011
Subscribe to:
Post Comments (Atom)



0 comments:
Post a Comment