Programming Language Retrieval with ChatGPT

Here are a few tips for learning the syntax of a new programming language, featuring LLMs.

I use Claude 3.5 Sonnet here which was much better at following instructions for these tasks. However the one task I found ChatGPT 4o to be much better at was evaluating my code for efficiency.

Self-Explanation Retrieval

It’s natural to want LLMs to explain code to us, but what if we explained code to LLMs instead? That way instead of passively taking in information we get all the benefits of retrieval, testing effects, and immediate feedback.

Me:

I'm learning about C++ constructors, give me an example, ask me to explain it, and then give me feedback. Then repeat.

Claude:

Me:

Claude:

Syntax Clozes

One of the underlying principles of these techniques is to focus on learning one thing at a time. It’s not helpful to overload with multiple things at once, like multiple lines of new languages syntax and solving a leetcode algorithm all at once. So let’s just focus on individual lines of syntax.

Syntax Conversion

Do you already know one language? If you already know Python, for example, and want to learn C++, a great way to learn is to convert between languages.

Ask for Specific Feedback

When learning a new language we can paste code in to an LLM and ask for feedback about efficiency, style, and correctness.

Previous
Previous

Do Mindmaps Need Color?

Next
Next

Self Regulated Learning (Literature Review)