Large Language Models or LLMs for short is a type of generative AI that produces content given a set of constraints or parameters. It is quite useful in doing specific and nuanced tasks like replying to emails, creating essays, summarization, code generation, etc. In this post, I will not be focusing on the impacts of such models or its effects to society in general. I will be writing about my own exploration of the landscape. This is still an incomplete journey since the ecosystem is still maturing.
I will show how I use LLMs to optimize my workflow as a software engineer. I will mention various
Since I am a programmer or software developer, I will showcase how I use some tools that are LLM driven like Codeium and OpenAIs ChatGPT. The uses of LLMs in software development are very wide, from code completion, debugging, and generation of complete applications. I subscribe to the idea the CRUD apps (retrieving data from DBs) will be automated since a lot of CRUD apps are templated anyways. Hence as a programmer, you are always taught to be a problem solver vs a pure coder.
I think of coding assistants like the Advanced Driver-Assistance Systems (Adaptive Cruise Control, Lane Centering) in most modern cars.
When I first encountered Codeium, I am ∏ooking for an alternative to Github Copilot this is due to the barrier of entry of Copilot. In the Philippines, $10/month or $100/year or roughly (5-6K Php) is already a substantial investment for a developer who is starting out. Hence, I have decided to look for alternatives that provides a “free-tier”. LLMs in programming help you to think about the problem or task more as against to writing the syntax. As they say even if it doesn’t do the 100% but it created 50% or even 70% of the task then it is already an improvement.
Codeium has a an extension to VSCode where it provides a panel and inline functions. Some of these functions are the following:
Codeium also provides a chat panel, where you can use it like ChatGPT where you can ask some questions regarding the code especially in the debugging process.
As you can see in the screenshot above, Codeium presents a variety of boilerplates for different languages like Python, Go and Typescript. It also allows you to implement debugging instead of going to Stack Overflow.
I find it very useful in its ability to generate parsing scripts (RegEx, JSON, and data manipulation), creating templates and boilerplates (folder structures and bootstrapping applications), framework introductions (I started learning ReactJS only using 1 tutorial and Codeium).
As a start of my experiment, I have created a boilerplate for ReactJS. What I usually do, is prompt it to create a Python script that generates a folder and file structure (left). The generated script will generate the following folder and file structure (right). Note: The recommended approach when generating a ReactJS application is to use a framework like NextJS
Boilerplates don’t only stop at file or folder generation, the typical scripts of parsing values can also be created like parsing strings using regex. We can see an example below, the solution provided by Codeium(top) as against to the “actual” solution (bottom).
In a pure compute perspective, re.split
is more expensive vs re.search
this is due to re.search
stops the searching once it finds the occurence. Do note though, this will depend on the use case of the application and where it will be used. That is why, as software engineer, when using these tools, you need to feed the “Coding Assistants” the context for it to properly suggest the best solution.
Given the usecases above regarding boilerplates, context is critical in the quality of the outputs of the Codeium. This is also true in the practical sense as well, imagine a product owner or business analyst don’t provide you the proper context, how will you develop the proper solution.
Debugging is a common occurrence is software development. Codeium like any other coding assistants help you in debugging code like explaining the stacktrace or errors from console.
Similar to boilerplates, code suggestions and completions is also part of Codeium, where it helps in saving time typing a lot of boilerplate code especially when you are working with frameworks where there is a specific way of coding e.g. REST Endpoints or model declaration. Based on my experience, depending on the maturity of the library or framework this can be a hit or miss since it may hallucinate due to its assumptions of the best practices.
You will see which frameworks or libraries break the “recommended” way of doing things.
Testing is another activity in the life of a software developer. Creating unit tests is a chore since it involves a lot of boilerplate especially in the class and function calls of an API or library. I typically use Codeium as a way to generate these boilerplate test structures and I modify on the logic or the actual test scenario that I want to do.
Refactoring is essential when you need to implement re-writes either to make it efficient or maintainable.
When doing refactors, you must ensure that the proposed code does not change the context or the main functionality itself. That is why before refactoring, you must establish your tests.
When going through codebases whether trying to understand a library or plowing through legacy ones, you need to understand the logic or the function. You’ll be lucky if the codebase has comments or documentation. This is where the explain functionality is very useful. It provides a general idea of the highlighted code.
Your mileage will vary depending on the quality of the code.
As part of being a software engineer is doing documentation. Documentation is one of the most nuanced part of being a developer besides meetings. Codeium provides a way to create docstrings to functions and classes.
Overall, I like the functionality and the goals of Codeium or coding assistants in general. It aims to automate the nuances of being a software engineer. Something worth highlighting is that being a software engineer does not only revolve around writing code, but also the ability to define the problem and solution. Coding assistants like ADAS systems are only tools for you to become more efficient in software development. These coding assistants may not work 100% of the time but they are good enough for you to start somewhere. The general outlook of these coding assistants is that these will become more mature and robust as new models and better data will be generated and fed into these models.