Preface
Programming is a force multiplier. We can write computer programs to free ourselves from tedious manual tasks and to accelerate research. Programming in any language will likely improve your productivity, but each language has different learning curves and tools that improve or impede the process of coding.
There is an adage in business that says you have three choices:
-
Fast
-
Good
-
Cheap
Pick any two.
When it comes to programming languages, Python hits a sweet spot in that it’s fast because it’s fairly easy to learn and to write a working prototype of an idea—it’s pretty much always the first language I’ll use to write any program. I find Python to be cheap because my programs will usually run well enough on commodity hardware like my laptop or a tiny AWS instance. However, I would contend that it’s not necessarily easy to make good programs using Python because the language itself is fairly lax. For instance, it allows one to mix characters and numbers in operations that will crash the program.
This book has been written for the aspiring bioinformatics programmer who wants to learn about Python’s best practices and tools such as the following:
-
Since Python 3.6, you can add type hints to indicate, for instance, that a variable should be a type like a number or a list, and you can use the
mypytool to ensure the types are used correctly. -
Testing frameworks like
pytestcan exercise your code with both good and bad data to ensure that it reacts in some predictable ...