The Pitfalls

It is ironic how easy yet difficult it is to start learning computational methods or tools. I am looking back at the first ever code I wrote in python (available at the end of my master thesis). It’s not bad at all, considering the fact that I used to, literally, hate computers in the years prior to 2009. I have used “try, except”, created classes, defined functions.

8 years have passed since I wrote that code. Although it was easy to start, how much I have progressed since then? The answer is ‘quite a lot’. Have I truly become an expert? ‘Probably not!’

The reason is because even for simple tasks I have relied on libraries, especially in R. I am way better in python. So the codes I have written were not 1000 lines, they were efficient and simple. But it did limit my knowledge on the very basics of the programming language I have been using.

The first suggestion from me to you all who are not educated in programming but learning by yourselves would be not to rely on the libraries. How would you explain the steps of the solution to someone else in plain English? How would you sort these words, if they were printed on A4 sheets in front of you? How would you calculate the angles between three points? If you can come up with an answer, you can most likely convert that answer to a code. Thinking this way will not only teach you the basics of the programming, but it will help you acquire domain knowledge as well. So two birds with one stone! You don’t have to reinvent the field every time. But make it a habit to choose some problems to work this way in all your projects.

Talking about “projects” rather than “a project”… When you have a few tasks to finish, with deadlines… It is easy to find a solution to your problems using another tool. During my M.Sc. and Ph.D. studies, I have learned to use lots of tools. It was nice, and I got the job done. But I couldn’t say, when I graduated, I am “the expert” in any of them. It took a few more years in postdoc for me to say with confidence that “Yes, I am efficient in python”.

If you are learning a programming language, or a new tool, try and stick to that for all of your solutions until you are efficient. I am not saying spent 6 months, but the tasks you could finish in a day using R (not because you know R well but you just know the right library, or you had a script from someone), write them in python if you are learning it. 

It is going to be difficult in the beginning but you have the manuals and the forums. You can seek help when you are stuck. It is acceptable to go to stackoverflow to learn a way you couldn’t think of. Searching through all of those forums at once is also quite easy with the search engines. I think one of the reasons I am in science is I love “searching”. People have a tendency to correct me by asking “Do you mean research?”. No, I don’t. I love searching. I have always loved searching. Finding the differences between pictures, turning page after page in encyclopedias to learn more in anything, or hunting the right book in the store with a vague idea that I want to read something in science fiction… Over the years, I have become better in defining the keywords to my problem. Now I use this ability to search solutions to my computational problems.

Asking for help from people is good, but don’t forget. You should know where to seek help in addition to whom. The struggle to find a solution on your own will help you refine your keywords. Especially using search engines. You will see similar questions asked and answered by many different ways. 

You have to remember one golden rule while searching for solutions. You did not come up with that solution. This does not and will not make you an expert programmer. Can you provide solutions to other people’s problems? Well now we are getting somewhere. You might be on the right track in my opinion. I have realized this past year that I am better in python then I thought. I could think of solutions in my head as if I was typing it and help other people on how to do it. I am not “the expert” yet, but it is a work in progress since I haven’t worked on a large scale project to cover all the aspects of delivering a finished product.

It is a work in progress. I am getting there! So sit tight and get ready to be frustrated is my last advice. Because you will find joy when you see a working piece of code of yours.