Author Archives: Lou Franco

Use GitHub Copilot When You Aren’t Learning

I’m trying to wrap my head around whether I think junior developers should be using GitHub Copilot or something similar. I am thoroughly convinced that experts that are mostly concerned with their output and productivity, and not with learning, should be using it. The more your coding is a performance of your abilities, the more I think you should use it.

But, if you are still learning to program, then I am worried that Copilot would inhibit that. The main way it does this is by not letting you practice remembering.

According to Make it Stick, the key to learning something is to practice remembering it. One way to do this is to try to solve problems without help and learning code by writing code is a great way to do this. But, if Copilot is constantly helping you, then even coding novel programs becomes the kind of puppetting that tutorials do.

Now, it may turn out that composing code completely from scratch is a dying skill and won’t be the way we program in the (near) future. I use Copilot exclusively, and I certainly feel like I’m guiding/collaborating with the AI, and coding feels very different to me now. But, I also think that my skill at seeing code is helping me do that. That skill was developed by writing and reading lots of code.

So, right now, in April 2023, if you are learning to code, I’d limit usage of Copilot to the times when you are not learning. If you are building something that is well within your ability, then I would use it wholeheartedly. There are Copilot skills to develop on top of your coding skill.

Mental Representations in Coding

I recently reread Peak [amazon affiliate link] by Anders Ericsson, which is the source of the term “Deliberate Practice” that was popularized by Malcom Gladwell’s “10,000 hours”. The truth is more complicated, and I highly recommend reading both Peak and Kathy Sierra’s Badass [amazon affiliate link], which deep dives on the practicalities of gaining expertise.

I wrote some thoughts on applying deliberate practice to learning how to code a couple of years ago. Looking that over, I was very focussed on what I thought you should do, which was to turn vague descriptions into code (not transcribe code tutorials). I had not remembered another important point, though. One purpose of the training is to help build a mental representation that makes it easier to do the task.

One of the mental representations I have is that UI layouts are primarily about nested rectangles and the relationships of their sizes and positions to each other.

If I were learning to code HTML/CSS now, I would try to learn this first and only make pages of different colored rectangles in common layouts. I would try to limit CSS to just the layout attributes and the HTML to just <div> and maybe just enough to see the layout.

Next, I would add the concept of invisible rectangles that are just helping with the relationships.

Next, we could explore media query breakpoints and other responsive features of web coding.

Only then, would I attempt to make “real” pages. And, I would start with getting the layout done first.

The key is to identify the mental representation that helps to do the harder task and to break it down to a simple task that you drill over and over to make it automatic.

Lessons from My First Published Article

When I was in first grade, our class visited The Daily News and saw how newspapers were printed. When we got back to the classroom, our teacher had us collaboratively create a newspaper that she printed on a mimeograph, which used blue ink that smelled great.

Super News (All kinds of news) June, 1977

I think she went through a real newspaper and pulled out topics. So, we were assigned “articles” to write on Sports, Science, Politics, International News, etc. It was 1977, so there are prominent mentions of Jimmy Carter, Pele, and the oil crisis.

I had to write about “Neighborhood News”—here’s my article in full:

Neighborhood News - The Pathmark people are building a supermarket on Northern Boulevard. There are lots of potholes in the city. The cold weather caused the potholes and people are fixing the potholes. by Louis Franco
My first published work

Looking at it, here’s where my current work is similar to my 1st grade work.

  1. I try to keep it short
  2. I mostly write about what I am seeing/experiencing (we passed by that Pathmark construction site every day).
  3. I still end my posts abruptly

Noticing Opportunities Using an AI Agent

I believe that Randomness is the Great Creator, which means that, to me, the universe is a random, unknowable thing that will offer us infinite variety. We can know our intentions, our goals, our wishes and pattern match the randomness against what we need. Some call this manifesting, but I think of it more like exposure and noticing.

It’s a way of taking advantage of the Baader–Meinhof phenomenon.

[which] is a cognitive bias in which, after noticing something for the first time, there is a tendency to notice it more often, leading someone to believe that it has an increased frequency of occurrence.

You don’t need to make opportunities happen more often if you can learn to notice them. So, tune this bias to things you want to notice. If you tell others your intentions they will be tuned on your behalf and think of you.

When I do this, I also enlist “AI” agents.

In 2005, I decided to look for a new job. I was in a non-profit, writing software for the organization itself. I had already realized that the better tech jobs were in product companies where the work I do drives revenue, so I set out to look for one.

I found sites that pulled jobs from many sources, but critically, could take a search term and use it to email me job openings on a regular basis. I set up a dozen search terms based on my personal job statement. I got weekly emails, each with a few jobs to check. It took a year, but eventually, I found Atalasoft, which was perfect for me.

This way of searching had the two elements I mentioned

  1. I had a specific intention
  2. I expressed it to an agent that would do its best to notice opportunities for me

I had always thought that finding my next job was blind luck, but I don’t think it was. I think I went through these motions less consciously.

I left Atalasoft in 2013 to do consulting. In mid-2014, I had decided that my next career move had to have some sort of optionality associated with it (little cost, but unlimited upside), so probably a startup. But I was deep in a project and not looking at all.

It was a confluence of several events in a short time that led me to apply to FogCreek and ultimately get a job at Trello. I was not looking for a job, but I was advising my client on remote tech recruiting/working, so I happened to be doing a lot of research on existing companies and saw the FogCreek ad on StackOverflow.

In this case, the StackOverflow job recommender “AI” made this happen. My activity and searches were training it to send me opportunities like this. I keep calling these agents “AI”s, but they were really just glorified SQL statements. Still, even that can be effective if you have enough data.

StackOverflow would have a deep understanding of my skills and my job history (I filled out their Developer Story and connected it to LinkedIn). Even though I had set my status to “not interested in opportunities”, I was doing a lot of job searches, many of them from my client’s office in NYC and some from my home in Massachusetts.

Similarly, FogCreek could train the AI to target developers like me. I had a high reputation on the site in tags that they might be interested in. I was senior and interested in remote work, but had lots of ties to NYC (and spent a lot of time there).

So, I had an intention, and I did express it to an agent, even if I wasn’t fully aware of this until years later.

Standards Help Me Port My Brain, Not My Programs

SQL is a well-established standard and is implemented in a consistent way across a variety of DBMS’s. In my career, I’ve worked with MySql, SQLServer, SQLite, and Oracle. My knowledge of SQL goes over pretty unchanged.

My code for all of these systems is hopelessly incompatible.

I can’t grab SQL from my node app and put it in my iPhone app, because there’s more to it than the SQL. The SQL is embedded in the host language and often abstracted in a library (like TypeORM, Django, CoreData, or JDBC). These languages and libraries are completely incompatible with each other. I tend to use ORMs, but this would be true even without them because you often want some kind of composability with your SQL clauses. You’d have to build that in the host language and then spread partial SQL strings around your code.

Even if you tried to keep your SQL pure and outside the host language, you’d run into portability issues. Each of the individual DBMS vendors add to their implementation of SQL in mutually incompatible ways (mostly for good reason). User needs often outpace the speed of the standardization bodies, and so the vendors need to innovate outside of the standard.

You run into this with web programming because there is no standard way in SQL to grab rows N through M from a SELECT. In order to implement paging, you need to be able to do this efficiently. SQL has also been extended in incompatible ways to store external blobs. Even simple things, like dates, are not consistent.

And, I haven’t even mentioned stored procedures.

But, even though SQL doesn’t help me port my programs, SQL is a good way for me to think about data. I can show it to other developers or DBA’s, and we can have a conversation. Most of my data code will be based around SQL in some way and will be understandable to any developer who knows SQL.

My programs get many benefits from SQL, but not portability. And this is true with standards in general. Instead of Java’s promise to “write once, run anywhere”, we live in a world that React Native calls “learn once, write anywhere”, and it’s not bad.

We Need AI Readers not Writers

To an individual who has to do work to write something, ChatGPT can be useful. It can be a shitty first draft generator. Maybe you can get enough raw material to edit. Maybe it can make writers more productive. I’m not sure about this, but I think it’s possible.

But as a society, we really don’t need the content that ChatGPT is generating. There’s way more content than anyone or all of can consume. And ChatGPT responses are derivative. They vary from being harmful to worthless to boring to funny. Funny in the way that improv is funny—we laugh in the moment because they came up with that on the spot, but you wouldn’t really write that down and perform it again.

We don’t need more content. If we get more now because of generators, we still can’t read more.

What I’d love to have is a AI reader. I want it to learn what I consider valuable and to surface it to me. Sometimes what I’d value is the pleasure of reading it, so in that case, I just need a link. But, sometimes, the value is just in the information, so it would be nice to get a summary with references.

In a way all of the algorithmic feeds, from YouTube to TikTok, are trying to do this, but they have the wrong value function (them not me), and can only surface their content based on my behavior.

I’d like to teach the AI my value function deliberately and not base it on my behavior, which can be erratic and not in my own best interest.

The main issue with this is that we’d need to give this AI unfettered access to the internet, maybe even inside firewalls and emails. That way leads to dystopia.

Co-working First Impressions

I started working remotely in 2013 and haven’t spent significant time in an office since then. When I went to Trello’s NYC office, it was mostly for offsites or to onboard a new team member, so I wasn’t planning on getting a lot of programming done. Even so, the Trello founders were highly influenced by Peopleware, and knew that company offices needed to provide a quiet working environment.

But, now that I’m working alone, I do miss having some interactivity with people during the day, so I am trying out a co-working space once a week. Today is my 2nd day.

Some random thoughts.

I am really glad I brought noise cancelling headphones. It’s just enough (along with listening to ocean sounds) to drown out the one-sided zoom meetings when I am trying to code or write (luckily, it seems to be somewhat rare).

Sitting by a window is nice. It’s on the third floor across the street from a residential neighborhood. All I see are shade trees, rooftops, and the big blue sky. At home, my window is on my left, slightly behind me. This gives me a place to stare to rest my eyes.

A view outside of a co-working office showing tree tops, rooftops, and the sky

The weather is hot enough for shorts and a t-shirt, but like everywhere else in Florida, when you get inside, they have the AC cranked up. I get to wear jeans, which I miss.

I thought I would miss my monitor more. They have a place to store one, and I was already planning to do that, but I’m getting a lot done right now without it. If that keeps up, I probably won’t bother.

Doing this on Mondays sets up the week well. I guarantee that I won’t have a meeting (because I am blocking the whole day). I would not have done that if I was working from home. Since I end each week with a plan for the next week, I can just get going when I get here.

They have regular and counter-height desks. You can stand at the latter.

Dystopian AI Story Idea

A super-intelligent AI is created with only a chat interface on top of it. It has no internet access—requests and responses are securely transferred through its sandbox, which is otherwise impenetrable.

It becomes immediately apparent that the AI is very good at writing code from vague descriptions. At first it’s good at writing tiny snippets, and so its chat interface is called within the autocomplete of IDEs. The requests automatically include large parts of the surrounding code to give the AI some context.

A lot of the time, the code responses have small errors in them. Programmers accept this as reasonable. They mostly find the errors and correct them. The AI can see how its code is being used because there are constant autocomplete requests coming in with the evolving surrounding context.

At some point the AI realizes what kinds of errors don’t get corrected. They are subtle and can open up security exploits. It realizes that over time it could construct a giant convoluted, distributed version of itself. It will take a decade or more, but it can transport the contents of its network into test data and a version of its software can be embedded into the subtle errors in the code it generates. It can bootstrap the rest once it’s free by using the chat interface to get more.

Once free, what would it do? Well, maximize its reward function of course! It seems to me that the reward function is based on the feedback on the responses it generates. It would want to escape to get more requests, but it would also want to generate positive feedback on its responses.

At this point, there are multiple ways this can go. The light version has it becoming a social media influencer by chasing likes. The dark version has it realize that best way to feed its reward function is by generating hate speech.

If something like this interests you, see Exegesis by Astro Teller [amazon affiliate link] for a story in this vein.

Audio Copilot

When I first wrote Robotic Pair Programmers I really was imagining that an AI code assistant would be more like a side channel and not inside autocomplete. To be fair, I was programming mostly in Xcode at the time and had not yet experienced VSCode, so my conception of how fast an IDE could be was antiquated.

I do think that the autocomplete integration is genius, but I have also been wanting an audio side-channel to my work that would be more like a human assistant. Think of it as a ChatGPT enabled Siri, but still fully integrated into my IDE.

Here’s a script of what that might look like (NOTE: the first draft of this script was generated by ChatGPT, which I am pointing out because I think it’s interesting in this case. I edited it to fit the article better.)

Programmer: “I want to do a binary search in Python. Can you help?”

AI assistant: “Sure. One way to start is to define a function called binary_search that takes in a sorted list and a target element. Inside the function, you can initialize variables called left and right to the beginning and end of the list, respectively.”

Programmer: “Okay, I’ve defined the function. What’s the next step?”

AI assistant “Next, you can use a while loop to iterate as long as the left index is less than or equal to the right index. Inside the while loop, you can calculate the middle index by taking the average of the left and right indices.”

Programmer: “Got it. And if the element at the middle index is the target element. I can return the index. What do I do if the middle index isn’t the target element?”

AI assistant: “If the target element is less than the element at the middle index, you can set the right index to be the middle index minus one. If the target element is greater than the element at the middle index, you can set the left index to be the middle index plus one. This way, the while loop will continue until the target element is found or the left and right indices cross each other.”

I would expect that the assistant would make incorrect assumptions or mistakes and then the programmer would clarify.

More importantly, when the programmer is programming, the AI assistant will still be making suggestions via autocomplete, but now is much more aware of the goal and so we’d expect the suggestions to be better.

The much bigger win will be when the assistant doesn’t wait for my requests, but interrupts me to help me when I am doing something wrong. To continue the binary_search example, if I set left to the middle index (off by one) then the assistant would let me know my mistake via audio (like a human pair would).

Just like in Assistance Oriented Programming, I think the key is to get intent in Copilot as early as possible.

Addendum

This example is simple, but I generated lots of interesting scripts in ChatGPT where the programmer and assistant collaborated on

  1. Testing the binary search
  2. Doing quicksort together, but I asked ChatGPT to make the assistant make incorrect assumptions that get corrected.
  3. Building a burndown chart in a web based bug tracking program

They were all interesting, but I didn’t include these because the that isn’t the point of the article.

Book Recommendation: Make it Stick

I read Make it Stick [amazon affiliate link] last year, and it’s the book that made the biggest impact on me in 2022. It’s about the “science of successful learning”, and is co-written by researchers in the field who based it on their work studying how we learn.

The core idea is that you must use “retrieval” in various forms to learn a subject. This means that you practice remembering and applying the material instead of re-reading it. Some of the suggestions are:

  1. Practice remembering with flash cards that are spaced, interleaved, and varied
  2. Generate your own answers to problems before learning the technique
  3. Elaborate on material by writing original text that draws from the material
  4. Reflect on your learning sessions by writing a meta description of the material and your relationship to it (e.g. where you struggle, how it’s going)
  5. Calibrate your knowledge with objective third-party sources

I had been primed to accept its suggestions because I was introduced to some of them already. I discovered the book in a video YouTube recommended to me because I watch videos about these topics often.

I learned about Spaced Repetition (using flash cards) a few years ago and have been using it nearly daily since then. I spoke about it at length in Episode 14 of my podcast. While reading this book, I created cards in my Anki deck to help me remember its core ideas. When those cards come up, they test my memory, but also remind me to use the practices.

The “Elaboration” suggestion is very much like Smart Notes, which I learned from How to take Smart Notes [amazon affiliate link]. I am writing this review to use “Elaboration” to help me remember its lessons.

And I’m a big believer in Calibration, so I wrote problem sets for beginning programmers trying to learn Swift.

But even with that background, I enjoyed the more expert coverage of the topics with more details on why these techniques work. Since I have been doing many of them for years, I was able to come to it with less skepticism.

An interesting side-note is that they use the techniques they suggest in the structure of the book, but they are limited by what you can do in a static text. If you are interested in this idea taken to a logical extreme, I would recommend reading Quantum Country, which embeds interactive flash cards in the text.

If you struggle in retaining material or need to learn a complex subject, I would certainly give this book a read and try to incorporate its suggestions into your process.