Matt Ambrogi

Recurse Center Weekly Recap #5

Thoughts and Lessons

Note this may not make sense unless you read the weekly recap below. But it’s more important. So I’m putting it first.

This week was instructive in many ways. Mainly, they are tied together. But I’m still working on articulating how. I’ve been thinking a lot about breadth vs depth as a relatively new programmer and about how to progress most effectively. Some threads have started to come together on this via my work and conversations. In short I think the best approach for me is to work on projects I’m excited about in whatever language or framework I want to, to focus on understanding underlying concepts along the way, and to block time everyday to explore fundamental aspects of computer science that will translate to any work I do.

Prior to this week, I was unsure about a fundamental part of how I’m working at RC. If I was sure I wanted to get hired as a programmer, I would see two possible approaches. Approach one would be this pitch: I have learned this specific stack, I can build stuff with it, you use this stack, therefore you can hire me and I can build stuff with it for you. The alternate option would be this: I can show you that I learn quickly, am smart, and understand fundamental things about programming. Therefore if you hire me, I’ll be able to get up to speed and contribute meaningfully no matter what team I’m on. Prior to this week, I didn’t know which pitch I was working towards. This week I think I decided it’s the latter. There’s a lot of reasons for this but I’m not sure I can articulate any better than it just feels right for me. In large part I was inspired by other Recursers who seem to be taking this approach. But I also felt it in my gut prior to that. According to Gertrud Stein, Picasso once remarked “I do not care who it is that has or does influence me as long as it is not myself.” So I’ll attribute this decision to my batch-mates.

Weekly Recap

Here’s an abbreviated recap of the week.

Monday

Finished up a simple app I was working on with Django and htmx. It’s a card game for couples that gives them interesting questions to ask each other. Couples can choose between 3 different levels of deepness. I started building this with React and Django Rest Framework. I’m happy I also did it with htmx. Htmx provides a means of getting single page app functionality into a project without having to jump into a Javascript framework. So in this case, users are presented a new card without a full page refresh. The project was also ~200KB as opposed to my React/Django version which was ~200MB. This is a simple use case. But I can imagine many cases in which this could drastically speed up development.

Tuesday

Goal for the day was to pick a new project to dive into. I wanted to choose a project I was excited about and then pick the stack that made most sense, as opposed to the other way around. I played around with a bunch of ideas in my mind, mainly a few end to end ML apps. I’d like to train a model, deploy it, and allow a user to interact with it via the web. But I got to toying around with an old, non-ML idea and quickly got sucked in. See New Project below for more information on the app.

I found and forked a repo with much of the code I needed to allow users to authenticate into Strava, which I need to make the API call. By the end of the day I had a simple React app up and working. A user could authenticate in and get a very basic report with some of their key stats. Quick progress has a price. I then realized I really wanted to do the background analysis in Python because I’m pretty good with (and enjoy) data manipulation in Pandas. So I had 3 options.

  1. Learn how to do analysis and plotting in JS
  2. Send the data from my React app to a Python service (that I would build) to do the analysis. Then send it back to present in the app.
  3. Redo the app in Django and have everything happen on the server.

I talked to a few people about the tradeoffs and basically concluded there was no ‘right’ approach. I made a plan to see if I could quickly figure out the auth in Django Wednesday morning. At this point I’m totally happy to be re-doing work in React and Django because it’s useful for developing my mental model of the differences.

I ended the day with a second meeting of our ML working group and a coffee chat with one of the facilitators.

Project Explanation

I use an app called Strava to track my runs and bike rides. A while back I pulled my data from Strava’s API and did some analysis. Looking at things like how my speed has trended over time. Strava provides some basic analysis for free, but much of the good stuff is behind a pall wall.

Generally, I’m interested in building things that do some useful things with people’s data and then present the result to them. This is broad, but something I wanted to do during RC. Probably inspired by my past analyst work. The article I wrote on pulling my Strava data got a fair bit of engagement, but the process for following along was pretty tedious if you’re not comfortable in Python. So I figured, why not make put this into a web app in which a user could oauth into Strava and then get this analysis.

That’s what I got started on Tuesday.

Wednesday

In the morning I set up a basic Django project.

I spent a few hours pairing with a batch-mate after that. He has been working in Django for most the batch and was the perfect person to chat with. He introduced me to a package that helps handle oauth to many apps, including Strava. I had planned to just write the authentication myself but was excited to see this. We spent a while talking through how I might implement it. We then paired on a project of his and jumped into Django docs and source code to find a solution to a form submission issue.

I spent the rest of the day working on the Django implementation. The o-auth package took a bit to wrap my head around. But I got it working, imported Pandas, and got some basic analysis going. By the end of the day I was caught up to my React version. At this point I decided to go forward with the Django app. For me, being able to do the analysis in Pandas, in the same project that would then present the analysis made the most sense.

Thursday

Did a bunch of work on the Strava analysis app. I also paired with a batch-mate on a payment processing API they have been working on in Go. So far I’ve only built API’s using Django Rest Framework, which handles almost everything for you. It was cool to see all the additional considerations when working outside of a framework and in a slightly lower level language. Building a simple API in Go is now on my list of stuff I’d like to do.

I also got back into a daily practice of dedicating more time to theory, CS, and lower level understanding. This inspired my project work. I spent much of the day refactoring my code into a more object oriented structure. With separate classes that handle the authentication and analysis. I also began to explore plotting libraries and added a proof of concept chart into the analysis.

Friday

Spent a bit of time working on the Strava app. Settling on a plotting library and explored how I’ll use it. I read Composing Programs for a bit. This book is really good. The chapter I read Friday walked through how one might implement objects and classes in Python (imagining that they were not a built in feature) using dictionaries.

I had a coffee chat with one of the RC facilitators. I paired for a bit with a much more experienced batch mate to discuss the structure of my app. She was extremely helpful and pointed out how I might abstract certain thing even further. She also introduced the concept of dependency injection for unit tests and how I might use it in this project.

To cap off the week, I quickly spoke at presentations about htmx and how it’s a great tool for building simple SPA functionality without React. It was probably the least exciting talk of the week but I like being in the habit of talking about what I’m doing.

What's Next

I'm going to continue to work on the Strava app for a few more days. I'd like to add some more interesting points to the analysis and then clean up the report UI. I think it could be cool to style it as some type of more traditional report - like a report card, financial statement, or something.

This week I'm going to focus on getting into the habit of spending time on CS everyday. Focus this week is getting through more of Composing Programs. Then I would like to transition to focusing on algorithms. I'm even toying with the idea of focusing next week on an algorithms refresher and deep dive.

- 1 toast