Monthly Archives: July 2016

Learning is hard but unlearning is harder

During the week of  27 June – 29 June 2016 i attended the Summer School on Machine Learning and Data Science at the school at Makereree University dubbed “Data Science Africa 2016”. I happen to sit with a colleague who is an experienced and certified Java Programmer. As we paced through the examples on data cleaning using anaconda package, we relied both on new new knowledge and also tried to apply what we have learnt over past years in our professional programming experience.

We aimed at cleaning our dataset to get rid of rows without a value for one of the rows on multiple columns. Our data had a column for Gender and another for TesCondition. Now some of the rows had empty values for Gender, while others had empty values for TestCondition. We learnt that once you have a data frame, then you can apply a condition of the form,

 q1= Dataset[‘gender’!=’’]

And then use it query the data as dataset[q1] and this faithfully returned only rows with a value in the gender column. Our next task was to remove the rows with empty values in the ‘TestCondition’ column. Of course we easily figured out that we can construction another query

 q2=Dataset[‘TestCondition’!=’’]

And apply it to the result after q1.

But then our instincts dictated that we could achieve the same result by using Dataset[q1 or q2] – that is return columns where gender is not empty or testCondition is not empty. However the compiler severely rejected this. For sure we have learn’t and know that logical operation on two Boolean expression should yield another another Boolean. Then our unlearning process hard to begin! We checked the syntax, double-checked the indenting, double checked the expression one by one. Meanwhile we found ourselves a couple of tasks behind the rest of the class. Reason – we could not easily unlearn what we have learnt and believed to be correct overtime.

For a while we kept on trying related syntactical expressions from Java, C, C# and standard Python that were not successful. It quickly became obvious that because we were so convinced about the common usage of logical expression, it took us a lot of time to adjust and enjoy the syntax of the new data science platform. Learning the new syntax was much faster as opposed to the time we spent trying to ‘unlearn’ from the past language.

The time taken to unlearn can vary from individual to individual. And a famously put by E.W.Dijkstra (1995) that ‘The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offense” .Dijkstra further “the teaching of BASIC should be rated as a criminal offense: it mutilates the mind beyond recovery

Indeed I have had comments from programmers as they attempt to cross from one language to another.

From C, C++, Java, PHP to Ruby
Any body who has done programming in this languages understands the importance of terminating statements with semi-colon (;) and strict naming of variables. One programmer could not come to terms with the fact that variable names of the form is_avaialable? Are perfectly acceptable in Ruby.

From C , C++, PHP to JavaScript

The notion of functional prototyping in javascript coupled with variable scoping in javascript has proved to be profoundly different from the typical static scoping most developers with expertise in C, C++ and Java are familiar with. In C, C++, Java the following code will terminate and producing twenty outputs

for(int i =0; i<10;i++){
  for(int i=0; i < 2 ; i++){
    System.out.println( i);
  }
}

while in javascript,

for(var i =0; i<10;i++){
  for(var i=0; i < 2 ; i++){
   console.log( i);
  }
}

will create a an infinite loop.

Have you had a challenge unlearning something?

690 total views, 1 views today