Tag Archives: coding

Resources for learning how to code

Last month, I put together a small script that made the calendar from the Sackler website accessible to calendar software such as Google Calendar, Apple Calendar, Outlook, and others, that a majority of people now use. This little simple bit of code solved a problem of the Sackler website that has existed for years and requires no further intervention on my part. I’ve put the source code online on GitHub for anyone who is interested in seeing how it works (https://github.com/danielsenhwong/sackler). For anyone who is interested in learning how to code or, like me, would like to develop their skills beyond the introductory undergraduate level, I’ve compiled a list of resources that may be useful.

Getting started

This is in many ways the most difficult part about learning how to code. Many resources exist, but it’s difficult to know which is the most approrpiate for your current skill level. You may already be somewhat familiar with some specific coding techniques or languagees, but significant gaps may still remain in your knowledgebase. Such gaps could include understanding how to set up a coding environment on your computer, which language is most suitable for your work, or how to interface with a database instead of just reading data from a file generated by your plate reader. As biomedical scientists, our familiarity with computers and code is limited compared to more computationally-intensive fields, but not compeltely absent, and our field is rapidly becoming more computational.

practicalcomputingFortunately, there is a book specifically intended for biologists who are interested in developing their computing skill set: Practical Computing for Biologists, by Steven Haddock and Casey Dunn. The book introduces basic concepts of coding while also providing a thorough walkthrough of how to set up a suitable environment on your computer before moving on to practical applications of coding and tools for data analysis, including working with databases and best practices for working with graphics and generating figures for publication. The companion website for the book makes much of the example code freely available, along with some other extras, including the reference tables, which are extremely useful while you’re still learning the commands: http://practicalcomputing.org/

lynda_logo1k-d_72x72Tufts Technology Services (Tufts IT) also has some resources available for free to the Tufts community, including access to Lynda.com, which hosts self-paced online tutorials for a number of different topics, including coding as well as software-specific training (Adobe Photoshop, Illustrator, InDesign, etc.). Additional details can be found on the Tufts IT website: https://it.tufts.edu/lynda

Integrating coding into your work

It can be difficult to learn how to code if it’s siloed away as a separate skill you’re trying to learn, so one effective technique is to integrate it into your normal workflow. One example would be to use R (r-project.org) in place of Excel or Prism to perform your statistical analysis. A good book for learning how to get started is Introductory Statistics with R, by Peter Dalgaard. A PDF version of this book is available for free through the Tufts library or heavily discounted for purchase: http://link.springer.com/book/10.1007%2F978-0-387-79054-1

Advent of Code: holiday-themed puzzles

Coding isn’t scary — Have fun learning or practicing your skills.

Being able to write computer code is an increasingly valuable skill that isn’t commonly taught in primary education, or a part of the curriculum for many undergraduate majors. Similarly, coding/computer programming is nearly absent from the curriculum here at Sackler. There seem to be three dominant reasons for this: coding isn’t always seen as being applicable, code itself can be intimidating, and there isn’t someone qualified to teach the subject. However, being ignorant of coding puts us, individually and as an institution, at a competitive disadvantage, and unnecessarily so. Learning how to code isn’t scary or even particularly difficult. Sure, code can be complex, but no one starts learning how to code by diving into the most difficult examples. The principles of coding are no more complex than basic lab protocols that we here at Sackler are at least comfortable with, if not masters at executing.

This is the introduction to a series of short articles about the basics of coding that Sackler students should understand, which will begin with the next issue of the InSight. For now, I want to highlight a series of holiday-themed coding puzzles to keep everyone occupied over the holidays.

Christmas tree rendered with text
Advent of Code, day 6.

A software engineer named Eric Wastl has put together a series of coding challenges called Advent of Code at adventofcode.com. One two-part puzzle is revealed each day just after midnight. The puzzle takes the form of a word problem, and provides you with input to feed into the code you write to solve the problem. The answer to the puzzle, the output of your code, can be submitted to the site, which tells you if you’re right, too high, or too low. If you’re right, you earn as star for that part of that part of the puzzle, which lights up one level of a Christmas tree rendered in text. Earning the first star of each day changes the corresponding level of the tree from gray to green, while earning the second lights up the “ornaments”. You can use any programming language you like, including Python, R, and PHP, which some students may already be familiar with.

Interested? The first day’s puzzle is below; visit adventofcode.com to create your account and get your own input:

Santa is trying to deliver presents in a large apartment building, but he can’t find the right floor - the directions he got are a little confusing. He starts on the ground floor (floor 0) and then follows the instructions one character at a time.

An opening parenthesis, (, means he should go up one floor, and a closing parenthesis, ), means he should go down one floor.

The apartment building is very tall, and the basement is very deep; he will never find the top or bottom floors.

For example:

(()) and ()() both result in floor 0.

((( and (()(()( both result in floor 3.

))((((( also results in floor 3.

()) and ))( both result in floor -1 (the first basement level).

))) and )())()) both result in floor -3.

To what floor do the instructions take Santa?