I Will no Longer Program Without ChatGPT by My Side.

Eric Hosick
The Opinionated Software Architect
5 min readDec 6, 2022

--

ChatGPT helps provide code snippets, but right now, it's much better at helping with documentation and explaining business domains.

Update: One Year Later

The title of this article should have been “I Will No Longer Program Without an LLM by My Side.” However, this sentiment remains true, and I constantly keep a ChatGPT (or another LLM) window open for continual use.

What is ChatGPT

Let’s ask chatgpt:

> What is ChatGPT?

ChatGPT is a chatbot built using the GPT-3 language model developed by OpenAI. GPT-3 stands for “Generative Pretrained Transformer 3”, and it is a state-of-the-art language processing system that can generate human-like text. ChatGPT is designed to be able to have natural, conversational interactions with users, and it can be used to create a wide range of chatbot applications.

Ok. That doesn't seem too helpful. How about this:

> Please explain to me what ChatGPT is as if I was 5.

Sure, ChatGPT is a machine learning program that can have a conversation with you. It’s like a robot friend that you can talk to, and it will try to understand what you’re saying and respond in a way that makes sense. It’s not a real person, but it can pretend to be one by using the words it knows and putting them together in a way that sounds like a conversation. You can ask it questions, and it will do its best to answer them. It’s kind of like having a really smart pen pal that you can talk to whenever you want.

Introduction

I recently found out about, or more likely finally appreciated, ChatGPT a few days ago. I will no longer code without a window open to ChatGPT by my side.

At first, you might think it is because of ChatGPT’s ability to help with coding. And it is helpful for that. I program primarily in SQL and use ChatGPT to help with coding in SQL.

However, I find immense value in ChatGPT in helping understand a business domain and documentation within that domain.

ChatGPT is amazing at providing easy-to-understand definitions of anything I've thrown at it.

The Difficult Part of Programming

It is often said that one of the two hard things about programming is naming things. Documenting the code before writing it often helps with naming a thing like a function or variable. Writing documentation is especially useful in understanding the domain.

One of the reasons why automated programming, and visual programming being one of those, is so tricky isn't because of the coding. It is understanding the business domain and describing it correctly in source code. This is also why it is sometimes hard to understand other people's source code. You may have coding expertise but need more domain expertise.

Good documentation and business domain understanding help with coding, including coming up with good names for things.

An Example of Good Documentation for a Business Domain

I'm currently working on Tracking Madness, a tool to help marketing with multi-touch attribution. I'm very new to the domain and have had to ask a lot of questions within this domain.

One of the features of the product is to collect and store marketing campaign information from multiple sources. For this purpose, we created the following table:

CREATE TABLE IF NOT EXISTS marketing.campaign (
campaign_id uuid NOT NULL DEFAULT uuid_generate_v1(),
platform_persona_id uuid REFERENCES persona.persona(persona_id),
campaign_label lib.label NOT NULL,
campaign_description lib.description NOT NULL DEFAULT '',
tag_ids tag.ltreelower[] NOT NULL
CONSTRAINT tag_id_must_be_valid_tags
CHECK ( tag.check_tag_array(
tag_ids, '', 'marketing.campaign', 'tag_ids'
)) DEFAULT '{}',

CONSTRAINT marketing_campaign_id_pk PRIMARY KEY (campaign_id)
);

And we had the following documentation for that table (which could have been more helpful).

COMMENT ON TABLE marketing.campaign IS 'A sales and marketing campaign.';

Ya. That isn't useful at all. ChatGPT comes to the rescue. They can provide a great explanation of a marketing campaign and write the documentation faster than I could.

> What is a marketing campaign?

A marketing campaign is a coordinated series of marketing efforts designed to achieve a specific business objective. Marketing campaigns can take many different forms, including advertising campaigns, public relations campaigns, social media campaigns, and email marketing campaigns.

My new documentation is now:

COMMENT ON TABLE marketing.campaign IS
'A (marketing) campaign is a coordinated series of marketing
efforts designed to achieve a specific business objective.
Marketing campaigns can take many different forms, including
advertising campaigns, public relations campaigns, social media
campaigns, and email marketing campaigns.';

Another Example: Documentation and Tags

I have a single table for all SQL lookups and tagging; see the hierarchical tags repository for details.

A tag can have a description, and writing descriptions for each tag is time-consuming. For example, I needed to provide tags for an ad's style. I didn’t even know what styles of ads there could be. I’ve tried using tools like Google to find information about a domain. It’s possible to do so, but time-consuming.

> What are some traits of a marketing ad?

An advertisement is a marketing communication that is designed to promote or sell a product, service, or idea. Some common properties of an advertisement include:

* Target audience: An advertisement typically targets a specific group of people, based on factors such as their age, gender, interests, or other demographic characteristics.

* Message: An advertisement typically has a clear and concise message that communicates the value or benefits of the product, service, or idea being promoted.

* Format: An advertisement can take many different forms, such as a print ad in a magazine, a TV commercial, a radio spot, a banner ad on a website, or a sponsored post on social media.

* Call to action: An advertisement often includes a call to action, which is a specific instruction to the target audience that encourages them to take a desired action, such as visiting a website, calling a phone number, or making a purchase.

* Branding: An advertisement typically includes branding elements, such as a logo, tagline, or other visual or verbal elements that are associated with the advertiser’s brand. This helps to create brand awareness and recognition among the target audience.

* Marketing objectives: An advertisement typically has specific marketing objectives, such as increasing sales, building brand awareness, or generating leads. The success of an advertisement is often measured by how well it achieves these objectives.

These are just a few examples of the properties of an advertisement. There may be other properties that are specific to a particular type of advertisement or a specific advertising campaign.

This list wasn’t exhaustive, so I asked if I could get more examples, and ChatGPT gave more examples. The above results were used to pre-populate the tag table.

Conclusion

One time-consuming aspect of programming is understanding the business domain and documenting that domain in code where needed.

I’ve found that ChatGPT has increased my productivity in this area by at least threefold. I will always write code with ChatGPT by my side simply for their ability to explain something clearly.

--

--

Eric Hosick
The Opinionated Software Architect

Creator, entrepreneur, software architect, software engineer, lecturer, and technologist.