Advertisement
Education

A Primer on Python for Life Science Researchers

  • Sebastian Bassi mail

    Sebastian Bassi is with the Universidad Nacional de Quilmes, Buenos Aires, Argentina. E-mail: sbassi@genes.unq.edu.ar

    X
  • Published: November 30, 2007
  • DOI: 10.1371/journal.pcbi.0030199
  • Featured in PLOS Collections

Reader Comments (3)

Post a new comment on this article

C++?

Posted by Winawer on 16 Mar 2008 at 06:55 GMT

C programmers will find lists similar to vectors
http://ploscompbiol.org/article/info:doi/10.1371/journal.pcbi.0030199#article1.body1.sec3.sec1.sec2.boxed-text1.sec1.sec2.p1

C doesn't have a mutable vector data type; perhaps you meant C++'s Vector, which is part of the STL. C's arrays are much less flexible (yet probably at least a little faster) than Python's list type.


RE: C++? (Response from the author)

PLoS_CompBiol replied to Winawer on 26 Mar 2008 at 18:29 GMT

You are right on the difference between C++ vectors and C arrays. But I didn't mean that C has a mutable vector data type. I wanted to point out that C programmers will anyway find it similar (arrays or vector to list) since that is what they know. Both data types share the property that can store several values at once (unlike a scalar type) and they can be walked over and indexed. Python list has its own unique properties, but that statement was made in order to show C programmers something they know to learn something new.
Maybe the problem lies in the fact that in Spanish "array" is translated as a "vector". So I agree that the article could be changed from "C programmers will find lists similar to vectors." to "C++ programmers will find lists similar to vectors." or to "C programmers will find lists similar to arrays." Both proposed statements are true, choosing one from them is a matter of taste.