Unfamiliar Language? 10X Your Productivity by Combining the Old with the New

Pairing this free AI tool with an old-school technique is the key to unlocking immediate productivity in unfamiliar programming languages.

Unfamiliar Language? 10X Your Productivity by Combining the Old with the New

"I know how to swim.  I just can't."

Those were the exasperated words of my six-year-old daughter when my wife and I were trying to teach her how to swim.  My daughter didn't like us telling her for the 100th time how to move her arms and legs to propel herself through the water.  It was an exercise in frustration for everybody.

She understood the concept, but she couldn't put it into practice.

I feel that same frustration when writing code in unfamiliar languages.  Or, at least, I used to.

The Frustrations of Programming in an Unfamiliar Language

Programming concepts are the same across programming languages.

While some languages emphasize certain paradigms over others (e.g., procedural vs. OOP vs. functional), most languages support multiple paradigms.  Generally speaking, if you are proficient at writing code in one language, then you can learn other languages relatively easily.

That said, there are some common stumbling blocks when moving between languages:

  • variations in syntax
  • differences in the standard library of functions
  • idioms regarding things like error handling
  • conventions regarding formatting and letter-casing

In the past, if I had to write code in another language, I spent a great deal of time Googling these common best practices.  I found this enormously frustrating, because I was constantly breaking out of my programming flow to go look up the implementation details for some simple concept.

I knew how to write code.  I just couldn't.

PPP and Codeium: The Frustration-Killing Combo

Over the past year, I've found myself more willing to use unfamiliar languages thanks to the killer combination of the pseudocode programming practice (PPP) and Codeium, a compelling alternative to GitHub Copilot.

Here's how the PPP works in a nutshell (read the full article for details):

  • Write the algorithm using pseudocode within code comments
  • Write the actual code that implements the pseudocode
  • Leave the original comments in place to help inform future users what you were intending (especially useful for code reviews)

With Codeium, the process works like this:

  • Write the algorithm using pseudocode within code comments
  • Let Codeium auto-fill the code implementation below the comments
  • Leave the original comments in place to help inform future users what you were intending (especially useful for code reviews)

I find that I use this technique mostly when writing short scripts in languages like PowerShell, Go, Python, and even batch (.bat) files.

Codeium is Free for Individuals

Unlike Copilot, Codeium has a very generous free tier for individual developers.  

For those of you who, like me, are wary of "free" software applications, their business model is to become popular with individual developers so they can sell enterprise licenses to large corporations.

Here's an excerpt from their How is Codeium Free? web page:

TL;DR we make money via our enterprise offering. There are a lot of functionalities that only make sense at the team or organization level, such as self-hosting or personalizing on codebases. Self-hosting requires upfront hardware costs that are out of reach for the individual developer and personalization only makes sense when a repository is large enough and has enough application/product specific logic or conventions.

Getting Started

Codeium currently runs in 40+ code editors. The VBA IDE is not supported, surprise, surprise.  I personally use the tool's VSCode extension, which you can easily find by searching the VSCode extension library for Codeium.

Once the extension is installed, it will immediately begin providing autocomplete suggestions as you code.  There's not much else to say about it.  It is one of the most intuitive interfaces I've ever used.

If it doesn't seem to be working, here are a couple of quick troubleshooting tips:

  • Make sure your VSCode workspace is trusted.  Extensions don't generally run in untrusted workspaces (this is a VSCode security feature).  If the workspace is untrusted, you should see a status bar at the top of the VS Code editor informing you of this with a button to check to mark it as trusted.
  • VS Code's language Auto-Detect feature could be off.  It's generally very good, but you can always manually override it if necessary.  The detected language is shown in the bottom right corner of the VS Code application window.  Click the detected language to manually set a new one if needed.  See screenshot below for details.

References

Codeium · Free AI Code Completion & Chat
Codeium offers best in class AI code completion, search, and chat — all for free. It supports over 70+ languages and integrates with your favorite IDEs, with lightning fast speeds and state-of-the-art suggestion quality.
Pseudocode Programming: Think First, Code Second
Writing pseudocode before coding forces critical thinking, iterates on the best approaches, and enables programmers to implement complex logic flawlessly.

All original code samples by Mike Wolfe are licensed under CC BY 4.0