I created a 25000 line proof of concept.

All it took was 7000 lines of code.
Nov 23, 2022
2 min

Due to Goodhart’s law, using lines of code as a measurement of progress is NOT recommended. However, anyone with a brain would understand that there is — in fact — a difference between the capabilities of a software with 100 Lines of Code and one with 1000 (1 KLOC). Putting jokes such as Python’s “machine learning one-liners” aside, code that spans 1000+ lines of code cannot be completed “over the weekend” in a stable manner. Neither can a 25,000 line proof of concept. So what is it and why was it created?

What is Copygen?

Copygen is a command-line code generator that generates type-to-type and field-to-field struct code without adding any reflection or dependencies to your project. According to the article “What is Copygen”, Copygen v0.1.0 was released on September 29th, 2021. At the time of this article’s creation, Copygen is approaching 200 stars on GitHub: A huge contrast to its initial reception.

When Copygen was first released, critics would not hesitate to call out its flaws. While this led to improvements in its User Interface (in the v0.2.0 release), there still remained a large population of programmers who did not understand why someone would use the tool. The reasons to use Copygen have always been listed in its README, but actions speak louder than words: These programmers didn’t want to be told why Copygen is useful. They needed to be shown it. While this wasn’t the only factor in the decision to create a proof of concept, it was a damn good one.

People take Go seriously because of Kubernetes and Docker.

The Proof of Concept

Creating without direction is not creating at all. A proof of concept is no exception. It goes without saying that one should have a reason to do whatever it is that they are doing. You don’t learn math to understand that 2 + 2 = 4. You do it to apply the skill in the real world (through finance, science, or otherwise). Thus, a programmer who “programs to program” is a fallacy: Programming is an action used to achieve other means (such as solving problems).

I wanted to create a Discord Bot which is a server-side software (using a server-oriented language). Go was the perfect choice. The problem being that I kept running into issues with the existing decisions of Go’s Discord API Wrappers. Now, I’m not a huge proponent of the Not-Invented-Here (NIH) attitude that leads to one creating an entire operating system from scratch. However, it was obvious that the existing solutions for Discord API Wrappers suffered from backwards compatibility bloat over 6 years… That’s how I wasted 6 months creating Disgo.

Disgo is a Discord API Wrapper designed to be flexible, performant, secure, and thread-safe. Disgo aims to provide every feature in the Discord API along with… Yeah. Yeah. Yeah. If you haven’t heard it already, then go check it out. Otherwise, Disgo is the proof of concept that Copygen needed; especially to become a production-ready software. I just didn’t know it yet… A few months would pass by, only for me to realize that 10,000 human readable lines of code have been generated in Disgo using Copygen. For more information, read about How Disgo Uses Copygen.

Read More