Impression from NYC and the RC

Two months ago I was on a train going from Montreal to New York City. It’s a long ride, but I used the time on the train to triage all the coding project ideas I could work on while at the Recurse Center (RC). So many projects; so many ideas.

Today I’m on the same train heading back to Montreal and have another 10 hours to triage the thoughts, experiences, and observations about the big city and the social experiment that is RC. Here is my best shot at it—stream-of-consciousness-style—before I forget it all.

New York City

The past two months have all been a blur. From the day of arrival when I tried to enter the wrong apartment, to the first contact with NYC street noise insanity outside of my window, to the snow storm, and all sorts of good foods. I’m very impressed with the city, but I’m not in love. Here are my observations.

New York is a big city. Compared to Montreal, it’s as if someone copy-pasted 10x the city. Or perhaps the better computer analogy is someone filling a map with the “bucket-fill” tool and completely forgetting to stop. Seriously, it seems like there is waaaay too much shopping areas with high-fashion and luxury brands. Do people really need to do so much shopping? I don’t mean to be judgmental, but as someone who is ideologically against consumerism, I felt like I was totally in the wrong place.

The energy of the city is amazing. It seems everyone is getting things done, shipping products, or otherwise being creatively on top of their game. Now I realize it is impossible for everyone to be successful, but people certainly carry themselves as if they’re crushing it. Most people I talked to made a good impression on me. They’re proud of what they do, confident, but not overly full of themselves. New Yorkers are actually interested in hearing you out, and seeing what you have to say. I felt very little closed-mindedness and little-mindedness from the locals, which is great.

I really like the demographics of the city. Everywhere I went, there are young people: from school kids who talk like adults, to the well-represented university crowd, through the numerous artists, to the middle-aged professionals contingent, and also older people who still keep in shape. Everyone is well dressed and good looking. At times I felt as if there is some sort of giant “face control” department at NYC ports and train stations that does not allow non-good-looking people to come to the city (How did I get in?).

I’m used to “measuring my words” when meeting new people in order not to alienate my interlocutors by mentioning math, quantum physics, or computer topics. When touching on such topics, I use an interactive approach to “feel out” the level of comfort of the person I’m talking with and judge how far I can go with this topic of conversation. The last thing you want is to jabber endlessly about a technical topic to someone not interested in tech, or to talk about math with a person who has a math phobia. Talking with people in NYC, I was pleasantly surprised to realize I don’t need to measure my words all that much. I would hit people with the full geekfest, computer jargon, and even quantum topics and they would handle it just fine. People are more knowledgeable than you think, and those that don’t know anything about the subject matter are willing to go into it and still had interesting things to say. That’s really nice. It’s great to be around people who can handle the tech talk and the science talk. All the New Yorkers I spoke with are smart, open minded, and generally well aware of the world.

The New York lifestyle is definitely something I could get used to. Two months of living there is not enough to get used to it or see enough of it to be a judge, but I met enough locals and saw enough to get a general feeling for what it’s like. First you need a NYC job. That’s a key thing if you are to enjoy the \$8 pints, \$15 cocktails, and \$30+ entrees. I mean anyone can afford to eat out once in a while, but if you’re not making 100K+ in this city, you’ll have a lot less opportunity to enjoy all the restaurants and bars. All these places of socialization are waiting for you after work. Unlike the dwellers of most North American cities, New Yorkers tend to go out after work. Whether it’s for a fancy dinner, or a quick dinner, or for straight-up alcoholism activities, people don’t want to go home. The city is very European in that way. You get to talk to people, see your friends, and generally hang out rather than go home. I like that very much.

The noise though. Oh. My. Fuckin’. God. The noise is terrible. It seems like every person who brings a car into Manhattan wants to exercise their right to use the klaxon as much as possible. Seriously, if the street is jam-packed for hundreds of meters ahead of you, will honking really make a difference? It’s not just the honking though, the constant presence of people at all hours with their need to scream, the large open spaces that carry sound, the delivery trucks, the construction work, the garbage collection trucks, and the highways. I am generally not affected by noise, but I never thought it can be this intense. In fact, I read that some people can get used to the noise level and need it for creative stimulation.

But it’s not just New Yorkers in cars that like to signal. Everyone in NYC is big on signalling. There are a lot of expensive bars and restaurants where the locals can feel special because of the hefty bills they will pay, but I guess it’s like that everywhere around the world. The specific signals New Yorkers use to show their higher status relate to the most difficult things to have in the city: cars and dogs. Owning a car in Manhattan must be an absolute nightmare with all the traffic and how difficult it must be to find parking. For this reason, if you’re seen rolling down the street in a fancy convertible, then you really must be something special. It’s a bit like high-heels—they’re attractive because they’re totally impractical. It seems it’s the same with owning a dog in NYC. We’re talking about a stone and concrete jungle with very little green areas. Why do you have a dog? Where are you going to take it out for a walk? Still, if you own a dog in these difficult conditions, then you must represent. Anyway, human nature is weird.

The Recurse Center

My six weeks at the Recurse Center were very much what I expected them to be, but also very surprising and inspirational at the same time. I kind of knew what to expect when going into RC from talking with people who’ve attended: RC is a shared office space with a focus on coding projects and exploration. This description is accurate, but completely fails to account for the amazing people that are present in that shared office space. Imagine co-workers that you actually want to talk to? How cool is that?

I’m in total awe with the people that I met. There were extremely knowledgeable people with very interesting background and achievements, but also inspiring “junior” people with insane ability to learn quickly. We had people who know how to use nearly every imaginable programming language: Agda, Clojure, Coq, C, C++, Erlang, Go, Java, JavaScript, PROLOG, Python, and even COBOL. How often would you have access to  such variety of people and be able to ask questions of them, or just “Hello Joe, can you give me an intro to PROLOG?”

I definitely felt some impostor syndrome after meeting all the people and hearing about the projects they were working on, but then I stopped comparing myself to everyone and it was OK after that.

The main idea for the Recurse Center is to provide the learning environment but not impose any structure. The first day has a lot of “official” events organized with the goal of getting people to know each other, but apart from that we’re left pretty much on our own to figure out what we want to do. People organize events, form reading groups, and work on projects in pairs or larger groups.

The first week was a bit strange and anti-social. I would show up in the early morning and work on some coding projects, try to socialize over lunch, then back to more coding in the afternoon, then go home. No beer or after-work pub activity. I think the people in the Spring 1 batch were realizing they are halfway done with their batch and trying to be more productive and the new Spring 2 people were not going to suddenly start talking to each other and making friends. Everyone felt distant, busy, and not wanting to be disturbed until the first Thursday game night. This evening was a marked change, at least for me, since after a few beers I felt much more comfortable talking with people. Beer is the universal ice breaker. After this first social event, I felt much more comfortable talking to people, joining conversations, and generally interacting with people. As if somehow drinking a few beers in the same room had turned us from coworkers into buddies.

Throughout my time at RC there was a constant tension between working on projects and socializing. My original plan was to push forward on one project, or another, until it is in a shape where it can be shown and shared with others. Needless to say this never happened, since “cleaning up” the projects and getting them into “not ashamed of the code” state was too much work, and would have required much more time than a half-batch. Once I realized this, I said “fuck my projects” and decided to focus more on talking to people, sometimes helping with whatever they’re working on, sometimes teaching math, doing Django demos, explaining pointers in C, and generally trying to be useful as a teacher. At the same time I played the student role in several other contexts where people more knowledgeable than me introduced me to PROLOG, Neural Networks, and Formal Type systems.

Something that I realized near the end of the batch is that RC puts a lot of emphasis on not imposing any formal structure to the learning process. There are no instructors. There are no classes. There is no set curriculum for people to follow.

Not adhering to any strict procedure, formula, method, or curriculum is a very powerful idea. It makes me think of Alfred N. Whitehead’s essay titled The Aims of Education in which he warns about the danger of inert ideas. Every now and then powerful new ideas and ways of thinking erupt on the intellectual scene and overturn old and established ideas. Slowly over time the new ideas become codified and structured until they become the new dogma. Whitehead warns us that the seemingly “efficient” approaches where students are taught to “skip ahead” and directly memorize useful facts might not be the best way forward if we want truly developed learners. Instead of memorizing thousands of facts, Whitehead advocates exposing students to a few important ideas and letting them apply these ideas in various practical scenarios.

I find RC’s structure-less approach very interesting because it is diametrically opposite to my thinking about education. The power of this unstructured approach is that it will never degenerate into dogma, rote learning, or formulaic explanations. By sticking to meta-learning techniques like study groups, reading groups, pair programming, weekly meetings, and activities, RCs learning will stay evergreen. I imagine the the 2014 web study group were about Backbone.js and the 2017 it’s all about React.js. RC never becomes outdated.

At the same time I believe that some structure could be very useful for beginners. How much time was wasted by each person to setup their basic coding environment? How much time is wasted learning from the wrong source? How can beginners know which tutorial is good and which tutorial is bad? The whole assumption of putting learners in charge of their learning process assumes that learners are adults and have well-developed meta-cognitive skills. It just so happens that all the people at RC are very smart and capable of “taking ownership” of their learning process so it works out, but I’m still left thinking that some structure could be introduced into RC without losing the flexibility.


Possible improvements

I thought of a number of ideas which would have made my experience better at RC and which could benefit people who are learning to code in general.

  • More short-term, throwaway code projects. I think I wasted a lot of time thinking of the projects that are good, worthwhile, or of general interest. I felt I need to come up with a really good idea for a coding project if I’m going to invite others to collaborate with me. From what I heard around me, many people were working on quite serious, long-term projects (think three week-long projects, or six-week long reading group). Those are cool and you’ll learn a lot in the end, but I think short, throwaway projects are much more valuable for learning. I had a lot of fun working on half-day projects in collaboration with people. If I come back to RC, I would focus 70% on such projects: get technology A to work, install B on top of C, wrap D inside and E environment, write a hello world in F then package your code and make it run in the G cloud. All of these activities would take an expert 30 minutes to do. A solo beginner would take 5-12 hours, and a team of beginners 3-5 hours. All the boring scary parts of getting things off the ground are so much better when you’re working in a team.
  • At the same time I think it’s good for everyone at RC to have one long term “show off” project to work on, dig in, and become sort of expert at. This could also be a collaborative project, it doesn’t need to be a “my portfolio” project, but I think it’s important for everyone to learn how to polish the code beyond the “school project” level. It would be great to have the full end-to-end experience from idea, design, implementation, coding enough to make the app useful to end users, deploy the code in a production environment, writing tests, etc. It doesn’t make sense to do all these extra steps for each of the throwaway projects, but it totally makes sense to go through the motions at least once for one project.
  • Code reviews. We had a great conversation over lunch with A., B., and N. where we all agreed that we somehow need to introduce the notion of code reviews and collaboration best practices (releases, feature branches, pull requests). It doesn’t make sense to do code review on the throwaway projects, but I think everyone would benefit from code review on their “show off” project. Imagine pairing a Python beginner and a Python expert on a simple web app project. Using only one hour per week of productive time, the Python expert could transfer all the best practices about conventions, code organization, idiomatic Python, testing tools, and deployment to the beginner.
  • Starter tutorials and curated learning resources. This is basically what I was working on throughout most of my batch. Imagine a collection of links to learning resources about every imaginable computer-related topic and each topic comes with a short tutorial prepared by a recurser that gives you the “hello world” introduction to the topic. I think this sort of curated list of links to resources, if continuously updated, can really improve the life of beginners. Instead of trusting “uncle google” to find the most relevant tutorial on topic X, you can go to a trusted source and get started learning topic X without the fear you’re missing out on some better tutorial somewhere else. Perhaps the page on topic X could use the Socratic method and just ask questions? For example, the page on JavaScript could ask: What is this? What is a prototype? What is the difference between == and ===? And other questions that will lead learners to seek answers on their own.

I think the above four ideas would really improve the RC experience for future attendees. I personally feel I wasted a lot of time in the first weeks thinking of a grandiose project to work on, and in retrospective I wish I had worked on smaller half-day, or one-day projects to learn as much as possible. I think mini-projects lend themselves better to collaboration. Imagine someone asks you to collaborate on a week-long project to do some big thing, versus someone asks you to collaborate on a small toy project for half a day?


Overall my stay at RC and in NYC was a good experience. I learned a lot. I got out of my Montreal routine/bubble. Above all, I met some amazing people. Fuck computers and coding resources… people are the best resource of them all! Many thanks to the RC Staff, Spring 1 and 2 batchmates, and all the alumni. Hope to see y’all again.

No bullshit guide to programming

How does one learn to code? Students in computer science and software engineering will have a few first-year programming courses, with the first one introducing basics like variables, control flow, and loops. Autodidact programmers probably started with a tutorial somewhere, but eventually got a book on the subject. Regardless of the learner’s path, we’re talking about a book that teaches “the basics.”

This is the table of contents I have in mind:

  1. Fundamentals
    1. math review (numbers, variables, functions, multi-step procedures)
    2. syntax and new type of objects (variables, functions, algorithms, int, float, list, dictionary, objects)
  2. Programming basics
    1. Expressions
    2. Functions
    3. Control flow
      1. If elif else
      2. Loops
  3. Structure of programs
    1. modules
    2. libraries
    3. frameworks
  4. Algorithms
    1. Binary search algorithm
    2. Sorting algorithms
    3. Graph algorithms
    4. Numeric algorithms
    5. Optimization algorithms
  5. Applications
    1. Fancy scientific calculations made easy (SymPy, numpy)
    2. Automate info. processing tasks (bash scripting)
    3. Generating reporting and useful analytics from data (pandas)
    4. Creating websites (Django)

It’s not the standard set of topics for the “COMP101 textbook” category,  but I bet with some thought put into it, it can be made to contain most of the material for a first-year coding class. We just godda make sure that profs will have enough to support teaching their class. Best of all it could all probably fit in 300 pages, and retail under $40. It could be even thinner, but would be better to have lots of exercises.

I’m thinking about this today because I was visiting McGill and had the chance to talk with the prof who taught my first-year programming course and we somehow got to the topic of textbooks. She remembered the computer science textbook she learned from, and described it as being very thin. So it can definitely be done.

The book described above doesn’t exist yet, but if you leave comments below telling me you want it, it will move up in the priority list…

Annual general update

It’s May. Winter is done now, so it’s time for spring cleaning! In addition to cleaning your living space, Spring is also a good time to clean out the “project plans” and focus on one or two key goals for the summer. This is what I intend to do in this post. Read on to learn about the recent developments, and the strategic plan for Minireference Co. for the coming year.

Since the LA book is finished, I will have more time now to focus on software projects and push forward all aspects of the business. Being in content-sprint-mode on LA applications for the past year really didn’t leave much time for updating the website, communicating with readers, twitter outreach, and developing sales and marketing channels in general. It’s like the business side of the company is asleep for one year.

Business is going strong, but to grow to 10x current size we’ll need a good strategy. It’s time to extend the product line to Web, Mobile, ePub, and Kindle. It’s also time to develop new products like email courses, exercises, jupyter notebooks, youtube tutorials, and maybe even audio lessons. A younger version of me would try to do all of these at the same time, but now I know that technology for the sake of technology is an empty pursuit. (That being said, sometimes quick wins can be had using the right tech, so any project that can ship in less than a week is OK.)

I need to think strategically, and also not think too much and focus on shipping.

The big picture

Let’s first figure out the overall mission. What do you want your readers to become? I want all my adult readers to become awesome at math. Also, I want all the analytically minded youth to be aware of the System. I want everyone to have affordable access to university-level science knowledge. Okay, so how do we do this?


Writing books is a lot of work, but there is no way to avoid this. If I want to ensure a consistent high quality of explanations and the logical coherence of the lessons, I have to be involved with all the books. I don’t need to be the main author though—I can be the developmental editor. I think this is my true calling in life.

Each book takes about two year to produce, so as long as it’s just me writing, Minireference Co. will always be on the flat part of the hockey stick growth graph. The best thing for growth right now is to find qualified authors that can help me scale to 10x current number of books in two years. Somewhere out there there is a chemist with years of tutoring experience who can write the No bullshit guide to chemistry in no time at all. Somewhere out there there is an economics grad student who can explain all the ideas from macro and micro economics in a single 200pp book. Same for differential equations (can be written either by a math student or an engineer, or a collaboration?). I definitely need a stats book too, written by a real statistician.

Content TODOs:

  1. Write pitch for authors along the lines of “Think you have a book in you? Join the Minireference Co. content team, and get paid to write about your favourite subject.”
  2. Update website, adding a new /authors endpoint.
  3. Think about revenue sharing models. Contractors? Royalties? Advance? Write contracts.
  4. Write a white paper on self-publishing tools. Package and release LaTeX templates and ePub production scripts for use by other authors.
  5. Develop scripts for publishing workflows based around text sources (md/tex), github repos, diffs, typo fixes, and multi-author collaboration. [BACKLOG]

Distribution platforms

Given the effort involved in producing educational content, it makes sense to distribute it as widely as possible. We need a multimedia approach. The print books are good.

Distribution TODOs:

  1. Create the split-versions of the first book for Kindle: No bullshit guide to math, No bullshit guide to mechanics, No bullshit guide to calculus. [June 2016]
  2. Finalize LA book, and push it to Lulu, Amazon, and Ingram channels. [August 2016]
  3. Release a iOS and Android apps with book content. Keep it simple: use a basic  ListView for browsing the topics and  WebViews (HTML+MathJax) for each topic.  [Summer 2016]

The above goals are easy to achieve and totally worth doing. The last thing you want to do in business is to waste time. Every week that I’m not on the kindle store means hundreds of dollars of unrealized sales. The LA book needs to ship ASAP too. People have been waiting, for so long.

New products

Books are good and all, but we need to think about the future. Will print book still be around 50 years from now? Maybe. But surely technology can play some role. Below are some product ideas that I plan to test in the coming years.

  1. Email course. Adult learners who are learning math and physics on their own need a little structure—a series of emails to keep them on track with their studies. Imagine a sequence of 10 emails that walk you through the sections of a chapter. Each email can contain links to lessons, video tutorials, exercise sheets.
  2. I’ve been experimenting with video tutorials and notebooks. I’m very impressed with the efficiency of teaching using jupyter notebooks and SymPy. I also like the “walkthrough” model of teaching, based on the book. But do the video lessons work? Are they effective at delivering the knowledge? Should they be at 1x, 1.5x, or 2x playback by default?
  3. Mobile applications. Everything has to be mobile these days. There is an opportunity to reach a wider audience through the Google Play Store and the Apple App Store. The plan for this project is in two steps: MVP as a Free app (lessons, concept map, exercises) [DEMO] Introduce paid apps based on feedback and experience of the free app
  4. EXERCIS. No learning is complete without putting the new knowledge into practice. That’s why I need to develop an exercises framework. It’s time I invested some dev efforts into this. I won’t be starting from scratch, but use khan-exercises or edX stack. I can offer it to readers either as a free bonus (incentive to buy book), or as part of the “deluxe” edition of the book. With the exercise framework packaged as a standalone JavaScript application, it can be distributed to students to use offline, or used from inside a WebView in the mobile applications.
  5. STRUCTURE. For as far back as I can remember, I’ve been obsessed with building a graph-like structure to describe the connections between all subjects, topics, and concepts in science and math. Now’s the time to finally build it! Strictly speaking, the graph by itself is not a product but the base for other products. For example “a concept browser” could be used to help people orient themselves in any field. Also a “what to learn next” recommender system can be build based on the knowledge of prerequisite structure between concepts.

These are all nice projects, but each of them requires a lot of development effort. I will need help. I could potentially try to pull it all off on my own, but it would be much faster to get interns to help me, or hire contractors. It’s not something I’m experienced with, but I think if I write solid specs for all these products, I could get external help.


Marketing push

With the two books in print (through lulu, amazons, Ingram) and digitally (gumroad, kindle), it’s now time to invest some cash and effort in a marketing campaign. A friend of mine who works in advertising recommended using a 30sec youtube video ad. Given a budget of \$20k for this, producing the video would take around \$10k and another \$10k would be used for the ads. If the video is good, such a campaign could lead to \$20k in sales. And if ROI>0, then I should do it, right?

I should really have a presskit for the company, and reach out to the tech news outlets and the startup community. Surely there is some free publicity to be had. The general themes of expensive textbooks will surely receive attention. Not sure how to spin it, but it’s definitely worth investing into this now that v5.1 of the math book is solid, and once v1.0 of the linear algebra book comes out.
Exercise framework

I’m a little disappointed by the referral page I setup for Shoutly. It’s probably my fault for not putting more thought and effort into it. Despite this failure, I still think there is a lot of potential for a referral program when setup right. If I can reach one student in a class of 300 undergraduates and incentivize her to recommend the book to her classmates, then I’m golden. Giving her a cut of sales profits could be good, but maybe there are other ways too? What if she can setup a “discussion group” for her class, with a unique URL. She won’t be “pushing” the book directly, but setting up a community for her class. Then again, I’m sure there are facebook groups for this already.



I’ve got many other ideas brewing too, but I don’t want to spread myself too thin. Instead of hiring authors, I could focus on the publishing technology, content curation, and recommendations. I recently bought EZOER.COM which would be a nice home for such a project. The best part about OER is you can still sell the print book. You can’t charge a huge margin, but it’s not like I’m very extractive right now either.


So, lots of things for Summer 2016. I better move my desk closer to the coffee machine

Binary search in three languages

Hola! Regardons ensemble un peu de code. The binary_search algorithm. It will get a little technical, pero no es mucho complicado. A ver. En ingles. En anglais, parce que le code—ça va foule mieux en anglais.

Assume you’re given a array of integers sorted in increasing order [3,6,19,21,87]. You job is to write a “search” function that returns the 0-based index of query value, or -1 if val is not in array.

Binary search algorithm

The “usual” algorithm use the start and finish pointers in a weird way, which I found difficult to understand, so I wrote another one. The invariant “we’ve already checked the limits” feels more logical to me.

In JavaScript

In JavaScript the code for the binary search strategy is as follows:

SearchableArray.prototype.binary_search = function (val) {
    var data =;

    if (data.length === 0) return -1;
    if (data[0] === val) return 0;
    if (data[data.length-1] === val) return data.length -1 ;

    var bin_search_limits = function(start,finish) {
        // invariant: data[start] and data[finish] have been checked already
        var mid;
        //console.log(start, finish);
        if (start === finish || start+1 === finish) 
            return -1;

        mid = start + Math.floor((finish-start)/2);

        if (data[mid]===val) {
            return mid;
        } else if (data[mid] < val) {
            return bin_search_limits(mid,finish);
        } else if (data[mid] > val) {
            return bin_search_limits(start,mid);
    return bin_search_limits(0, data.length-1);


The full javascript code (with tests;) is here.

In C

It was surprisingly easy to transform the JavaScript code into C. See the code and some basic tests here. The main functions essentially the same:

int bin_search_limits(int *data, int start, int finish, int val) {
      // invariant: data[start] and data[finish] have been checked already
      int mid;

      if (start == finish || start+1 == finish) 
          return -1;

      mid = start + (finish-start)/2;  

      if (data[mid]==val) {
          return mid;
      } else if (data[mid] < val) {
          return bin_search_limits(data,mid,finish, val);
      } else if (data[mid] > val) {
          return bin_search_limits(data,start,mid, val);

int binary_search(int *data, int length, int val) {
  if (length == 0) return -1;
  if (data[0] == val) return 0;
  if (data[length-1] == val) return length-1;

  return bin_search_limits(data,0,length-1, val);

In python

The pleasure of implementing binary search in python is left to the reader.

I’ve got to go code learn how to make a hash function to make the C test suite go faster 😉