A Realisation

Jan. 16, 2025



One of the best pieces of advice I have ever been given about how to tackle programming problems is to treat your code as comments that describe your program to the computer, whilst the comments that are there for humans to read should tell them how the program is supposed to work.

In recent days I have come to a realisation that you also need to try and see things as the computer sees them, rather than expecting it to see what you can see. I was working with some data that were formatted in a pretty way for humans and I was completely flummoxed because I couldn’t get any of it into R. The more I stared at the files, the more I began to see all these weird anomalies like completely blank columns that had been shrunk to near zero widths and inconsistencies between files with how the main components of the data were stored. It’s been a strange experience!

My breakthrough came when I tried turning off all the formatting of the data in Excel, asking myself “what’s really here?” After that, things got a bit easier, and the recognition that this might be a better way to start in the future!

Back to home page