Programming languages vienna

596 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
596
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • My name is Greg Slodkowicz and I’ll be talking about how well suited different programming languages are for solving common problems in bioinformatics, in particular in bioinformatics education.
  • To put it into context, here’s a plot of programming language popularity in the last 10 years. This is general, . So it’s not something specific for bioinformatics. Java, C, C++ -- heavy duty compiled languages Visual Basic has been promoted by Microsoft used mainly by small businesses and we can see from the plot that it’s on it’s way out in favour of C# and other things PHP, still the most popular language for the web
  • You need a bit of context information to interpret this
  • It’s always dangerous to compare programming
  • ‘ clinical trial’ ’ Religious’ aspect (holy language wars) Few hard facts, folk wisdom/software engineering practice instead Difficult to compare across universities (different student intake etc.) Personal preference
  • My background So of course we can’t do it ‘scientifically’ to get a definite answer but we can reason about the properties of each language and we can use software engineering practice to help us. If you’re a professional software developer 1-1.5 bugs per 100 lines of code. This is not because
  • It’s always dangerous to compare programming langs Has to do with overall popularity trends, also to do with the courses which are taught Ruby is also quite tempting to try out but it’s really slow and there’s not much scientific communit
  • Decided to implement solutions to several simple problems that could occur in an introductory bioinformatics course. IUB – degenerate base codes - optimized so not the optimal case for introductory stuff - but chosen out of many submissions - I pick shortest, not fastest
  • Scoping, bolt-on error handling, profusion of control structures which do the same thing Have to work against the language to teach effectively Makes it difficult to understand somebody else’s code; also difficult for self-study
  • Worst offenders $_, @_ Implicit behaviours, values are implicitly put into variables with arbitrary names
  • You can make up your own mind if it’s a good thing – it’s loosely reasoned And in fact increases the cognitive load Means you have to work against the language to produce good code. In theory, people say that it gives more power but not for beginners
  • OBF There are some affiliated
  • Programming languages vienna

    1. 1. What makes a good programming language for bioinformatics education? Greg Slodkowicz Chris Workman group Center for Biological Sequence Analysis
    2. 2. Overview <ul><li>Language usage trends </li></ul><ul><li>Practical language comparison </li></ul><ul><li>Perl design </li></ul><ul><li>Bioinformatics library comparison </li></ul>
    3. 3. Programming language trends
    4. 4. Programming language trends <ul><li>2001 </li></ul><ul><li>Java </li></ul><ul><li>C </li></ul><ul><li>C++ </li></ul><ul><li>(Visual) Basic </li></ul><ul><li>Perl </li></ul><ul><li>PHP </li></ul><ul><li>Python </li></ul><ul><li>C# </li></ul><ul><li>(Objective C) </li></ul><ul><li>(Lua) </li></ul><ul><li>2011 </li></ul><ul><li>Java </li></ul><ul><li>C </li></ul><ul><li>C++ </li></ul><ul><li>C# </li></ul><ul><li>PHP </li></ul><ul><li>(Visual) Basic </li></ul><ul><li>Objective C </li></ul><ul><li>Python </li></ul><ul><li>Perl </li></ul><ul><li>Lua </li></ul>
    5. 5. Overview <ul><li>Language usage trends </li></ul><ul><li>Practical language comparison </li></ul><ul><li>Perl design </li></ul><ul><li>Bioinformatics library comparison </li></ul>
    6. 6. Comparing programming languages <ul><li>’ Religious’ aspect (holy language wars) </li></ul><ul><li>Few hard facts, folk wisdom/software engineering practice instead </li></ul><ul><li>Difficult to compare across universities (different student intake etc.) </li></ul><ul><li>Personal preference </li></ul>
    7. 7. How to compare languages? Make an army of clones, teach them programming, do statistics
    8. 8. Software engineering perspective <ul><li>Effort (/time) to solve a problem is proportional to the number of lines needed for the solution [1] </li></ul><ul><li>The number of bugs per line of code is constant regardless of the language used [2] </li></ul>[1] F Brooks 1995 [2] L Hatton 1995
    9. 9. Languages in the comparison Language Paradigm Execution model Perl Mixed Interpreted Python Mixed Interpreted Java OO VM C Procedural Compiled C++ OO Compiled
    10. 10. Practical comparison <ul><li>We compare several small problems implemented in each language: </li></ul><ul><li>dna2prot Translate DNA to amino acid sequence </li></ul><ul><li>fasta* Generate and write random DNA sequences </li></ul><ul><li>reverse-complement* Read DNA sequences and write their reverse-complement </li></ul><ul><li>k-nucleotide* Repeatedly update hashtables and k-nucleotide strings </li></ul><ul><li>regex-dna* Match DNA 8-mers and substitute nucleotides for IUB code </li></ul><ul><li>*From the Programming Language Benchmark Game </li></ul>
    11. 11. Code lengths compared
    12. 12. Overview <ul><li>Language usage trends </li></ul><ul><li>Practical language comparison </li></ul><ul><li>Perl design </li></ul><ul><li>Bioinformatics library comparison </li></ul>
    13. 13. Unix legacy <ul><li>Many more syntactic structures in Perl </li></ul><ul><li>Things happen by ‘magic’ </li></ul>Perl Python Java $str =~ /xxx$/ str.endswith(“xxx”) str.endsWith(“xxx”) $str !~ /xxx$/ not str.endswith(“xxx”) !str.endsWith(“xxx”) `cmd` os.system(cmd) Runtime.exec(cmd) s/xxx/yyy/ str.replace(“xxx”, “yyy”) str.replace(“xxx”, “yyy”) tr/abc/xyz/ str.translate(trantab) str.translate(“xxx”, “yyy”) <FILE> file f File f
    14. 14. Perl special variables
    15. 15. Perl philosophy ” (…) Perl is chock-full of exceptions to its rules. This is a good thing, as real life is chock-full of exceptions to rules.” Schwartz et al., Learning Perl, O’Reilly
    16. 16. Overview <ul><li>Language usage trends </li></ul><ul><li>Practical language comparison </li></ul><ul><li>Perl design </li></ul><ul><li>Bioinformatics library comparison </li></ul>
    17. 17. Bio* main projects <ul><li>BioPerl </li></ul><ul><li>BioPython </li></ul><ul><li>BioJava </li></ul><ul><li>BioRuby </li></ul>
    18. 18. Bio* commit activity Activity by year Total # of commits
    19. 19. Summary <ul><li>Changing landscape of programming practice </li></ul><ul><li>Scripting languages are more suited for teaching bioinformatics </li></ul><ul><li>New languages emerge and can make teaching bioinformatics easier </li></ul><ul><li>There are more and more viable bioinformatics libraries </li></ul>
    20. 20. Questions? <ul><li>Acknowledgements Chris Workman Peter Wad Sackett Nils Weinhold </li></ul>

    ×