Daniel Lemire's blog

Evil abbreviations in programming languages

, 1 min read

Programming language designers often abbreviate common function names. The benefits are sometimes dubious in an era where most programmers commonly use meaningful variable names like MyConnection or current_set as opposed to single letters like m or t. Here are a few evil examples: The C language…

Accelerating intersections with SIMD instructions

, 4 min read

Most people have a mental model of computation based on the Turing machine. The computer does one operation at a time. For example, maybe it adds two numbers and outputs the result. In truth, most modern processor cores are superscalar. They execute several instructions per CPU cycle (e.g., 4…

Good ideas are overrated

, 4 min read

As a college student, I was convinced that the most important part of science and engineering was to have good and original ideas. If you contemplate Einstein, it is not hard to come to this conclusion… The man had a never ending stream of great ideas. Notice however that we never read Einstein…

Other useless school trivia: the quadratic formula

, 5 min read

I have two young boys and I have decided to pay attention to what they are learning in school. Beside basic writing and reading skills, mathematics feels like the next most important academic topic. I realize that relatively little has changed in 30 years regarding how mathematics is taught. As a…

On rote memorization and antiquated skills

, 5 min read

When I write that we should focus on teaching useful skills, and avoid deliberate rote memorization… I get far more opposition than I expect. To my surprise, there is an abundant supply of teachers and parents openly supporting rote memorization and antiquated skills. When I object to having…

The mathematics we teach our kids…

, 3 min read

Math education has made progress compared to my school days in specific areas. For example, I am really happy that statistics and probabilities are fully integrated with how we teach mathematics today. I cannot remember learning any notion of probabilities in class until I reached college. I do…

The hopeless ones become college professors

, 1 min read

Many people justify their choice of pursuing graduate school by a desire to explore new ideas and satisfy their intellectual curiosity, an euphemism for goofing off. These students use graduate school as a cultural hack… they turn what might be perceived as an asocial behaviour (e.g., spending 4…

Large well-funded laboratories…

, 1 min read

Your intuition is probably that large well-funded research laboratories produce more research… One part of this intuition is flat out wrong. Small teams are consistently more productive: (…) small sized laboratories are more productive. This result is consistent with the results previously…

Lectures are the lazy person´s approach to education

, 1 min read

Roger Schank is a famous computer science professor. His take on lectures is just brilliant: We still have lectures for one main reason. They are the lazy person’s approach to education. Both lectures and listeners agree that neither of them wants to do much work. Real work, and real doing, and…

Your brain and its software patches

, 5 min read

Scott Alexander wrote a series of great posts on genetic determinism. He recounts how he believes he learned English without any effort but could not learn Calculus. He explains that a 7-feet-tall healthy individual is almost guaranteed to earn millions of dollars as a basketball player. He…

How do you become an expert?

, 2 min read

I was asked by one of my students how to become an expert programmer. Peter Norvig has already given an excellent answer: work hard for ten years. Let me revisit the main points that should be common knowledge by now: Do a lot of it. I have published over a thousand blog posts. I have published…

Knauff and Nejasmic recommend banning LaTeX

, 3 min read

Two German psychology professors, Knauff and Nejasmic, recently published a paper on the benefits of Microsoft Word over LaTeX. The paper was reported in Nature. They show that you can copy a simple document (containing little mathematics) faster and with fewer errors when using Word. Of course,…

Fast unary decoding

, 2 min read

Computers store numbers in binary form using a fixed number of bits. For example, Java will store integers using 32 bits (when using the int type). This can be wasteful when you expect most integers to be small. For example, maybe most of your integers are smaller than 8. In such a case, a unary…

Theory lags practice

, 2 min read

Schools teach us theory so that we can be more productive workers. You learn grammar so that you can be a better writer. You learn about computer science, so that you may be a better programmer. You learn about electromagnetism so you can do electronics. You learn about thermodynamics so you can…

How to learn efficiently

, 3 min read

I am convinced that much of the gap between the best college students and the worst is explained by study habits. Frankly, most students study poorly. To make matters worse, most teachers are incapable of teaching good study habits. Learning is proportional with effort Sitting in a classroom…

MOOCs are closed platforms… and probably doomed

, 3 min read

Colleges and universities, left and right, are launching Massive open online courses (MOOC). Colleges failing to follow are “behind the times”. Do not be fooled by how savvy MOOC advocates sound. They do not understand what they are doing. Let us start with how they do not even understand what…

Optimizing polymorphic code in Java

, 3 min read

Oracle’s Java is a fast language… sometimes just as fast as C++. In Java, we commonly use polymorphism through interfaces, inheritance or wrapper classes to make our software more flexible. Unfortunately, when polymorphism is involved with lots of function calls, Java’s performance can go…

The Smartest Kids in the World: stories from Finland, Poland and South Korea

, 3 min read

I have always been interested in what makes us smart. So I read Amanda Ripley’s The Smartest Kids in the World in almost a single sitting. She is a good writer. The core message of the book is simple and powerful. Entire countries can change how their kids rank in international academic…

Academia as an `anxiety machine´

, 3 min read

We learned recently of the suicide of Stefan Grimm, a successful professor at the prestigious Imperial College in London. Professors Grimm regularly published highly cited articles in the best journals. He was highly productive. Unfortunately, some of his colleagues felt that he did not secure…

When bad ideas will not die: from classical AI to Linked Data

, 2 min read

Back in the 1970s, researchers astutely convinced governments that we could build intelligent systems out of reasoning engines. Pure logic would run the day. These researchers received billions for their neat ideas. Nothing much came out of it. Of course, what we now call artificial intelligence…