DEV Community

Cover image for Using GoLang Might be Illegal
Thomas Hansen
Thomas Hansen

Posted on

Using GoLang Might be Illegal

In your employment contract there's probably a section that says "the employee should pick the best tools for the job". We asked ChatGPT to create an HTTP endpoint that sends emails in 2 languages; C# and GoLang. The results can be found below.

  1. GoLang 105 lines of code
  2. C# 90 lines of code

Then we asked ChatGPT the following ...

Is it better with fewer lines of code?

Below is its answer:

  1. Simplicity: Less code can mean less cognitive load for a developer reading or debugging.
  2. Fewer Bugs: Statistically, fewer lines often reduce the surface area for defects.
  3. Faster to Read and Navigate: Especially useful for small teams or solo developers.
  4. Lean Deployments: In minimalistic environments (e.g., serverless, embedded systems), fewer dependencies and lighter binaries help.

Basically, ChatGPT is admitting that the C# solution is "better" than the GoLang solution, because it contains fewer lines of code. The problem is that there's another programming language that can solve the same problem with 14 lines of code; Hyperlambda. You can find its code below.

.arguments
   to:string
   subject:string
   message:string
mail.smtp.send
   message
      to
         .
            email:x:@.arguments/*/to
      subject:x:@.arguments/*/subject
      entity:text/plain
         content:x:@.arguments/*/message
return
   result:ok
Enter fullscreen mode Exit fullscreen mode

The above is 14 lines of code. This implies that if C# is 10% "better" than GoLang, Hyperlambda is 700% better than C# again. Arguably making it "illegal" to use both C# and GoLang, at least for an HTTP endpoint that sends an email.

Technical Debt

Technical debt is a word that's been hijacked by professional evangelists and platform builders to avoid having their customers expose the truth, but it basically implies how much resources are required to maintain and fix bugs in your codebase. Implying if you need twice as much time and resources to fix a bug, you've got twice as much technical debt.

We've got research that's more than 50 years old that proves that by doubling the LOC count you double the resource requirements to maintain and bug fix your code. This is true regardless of programming language for the record. Hence, LOC count literally is technical debt. And technical debt again literally is quality. This implies the following ...

Using GoLang, C#, Python, Rust, or practically anything else but Hyperlambda, might actually be a violation of your employment contract

Simply because math proves it's the best tool for the job ...

Warp.dev image

The best coding agent. Backed by benchmarks.

Warp outperforms every other coding agent on the market, and gives you full control over which model you use. Get started now for free, or upgrade and unlock 2.5x AI credits on Warp's paid plans.

Download Warp

Top comments (3)

Collapse
 
dyfet profile image
David Sugar • Edited

If a strong part of the value-proposition of hyperlamda is fo be found in LOC, then I highly suggest you understand the history of 4GL languages. You may well conclude that doesn't apply to this, but someone somewhere on the way to unicorn will likely at least ask the question and you will want to have an answer ready in advance.

Collapse
 
polterguy profile image
Thomas Hansen

I highly suggest you understand the history of 4GL languages

FoxPro was the second programming language I used professionally, in my very first job. Hyperlambda is inspired from it, which is something I am proud about.

4GL languages was a really great idea back in the day, but they didn't scale because of the underlying technology. Hyperlambda scales ... ;)

Thank you :)

Gen AI apps are built with MongoDB Atlas

Gen AI apps are built with MongoDB Atlas

MongoDB Atlas is the developer-friendly database for building, scaling, and running gen AI & LLM apps—no separate vector DB needed. Enjoy native vector search, 115+ regions, and flexible document modeling. Build AI faster, all in one place.

Start Free

👋 Kindness is contagious

Dive into this thoughtful piece, beloved in the supportive DEV Community. Coders of every background are invited to share and elevate our collective know-how.

A sincere "thank you" can brighten someone's day—leave your appreciation below!

On DEV, sharing knowledge smooths our journey and tightens our community bonds. Enjoyed this? A quick thank you to the author is hugely appreciated.

Okay