Teach

For October’s InDay I had the opportunity to teach high school students how to code.  This was the first time I was mentoring/teaching someone who had no prior programming experience.

The goal of the lesson was to help the student build a simple guessing game (pick a random number and have the user try to guess it; let the user know if their guess is greater than or lesser than the random number) in Javascript. On the surface this seems like an easy task; but if you think about it it involves using quite a few programming constructs — variables, loops, conditionals, functions, random number generators, etc.

One method that I found useful while teaching was to introduce the programming concepts with the help of the mathematical concepts on which they are built. Variables and functions in programming languages are (more or less) based on the same constructs in mathematics and it was easy to draw parallels between the two.

To explain how to generate a random number within a range I used the Google Chrome Console to show how function composition in programming works.

Also, analogies help. “Why do we need HTML, CSS, and Javascript?” “Well, HTML elements are the basic building blocks of a webpage. CSS allows you to add color to and position the blocks — it makes the blocks look pretty. Javascript makes the blocks interactive.” Yes, I’m well aware that this analogy is not perfect, but it was the best I could come up with at the time and I think captures the essence of why we need this trio to build websites today.

Overall this was a challenging and rewarding experience. I need to find more volunteering opportunities that are coding related.

Help

Prior to heading out to MHacks I envisioned having the time to catch up on some tech and non-tech reading over the course of the event. However, this was not to be.

(And no, I’m not disappointed in the slightest that I was occupied the entire time)

I spent a majority of my time helping and mentoring teams participating in the event. I had volunteered to answer any web development related questions. Here are some of the problems I helped solve and technical concepts I explained:

  • How to architect a website that used in-browser video conferencing as a key component. I suggested using WebRTC as it is something that I’ve used in the past. The team chose to use the excellent PeerJS library as an abstraction over WebRTC.
  • How Ajax + callbacks work in JavaScript. The team’s algorithm needed nested callbacks (3 levels of nesting if I recall correctly) because of dependency issues, and the phrase “callback hell” did come up.
  • Given a set of documents, how do you determine, for a particular document, what are the similar documents? This is the problem of semantic similarity. I also explained some basic NLP concepts to the team.
  • How to create a website so that it has a responsive design. My suggestion was to use Bootstrap (I love this framework) and have it do the almost all the heavy lifting.
  • How to use Flask to build backends that are not coupled to the frontend (web v.s. text message)

This was probably the most mentoring I’ve ever done at a hackathon. It was a great experience, and I would definitely do it again.