Development speed comparison for C/C++ vs Golang

Welcome to Golang community! :rocket::fireworks:


I can only provide my experience as data point, not a research. I was a Java β†’ C & Python β†’ Ruby β†’ Go developer. However, it can be subjective and bias depending where you come from.

My data has 2 assumptions, developer already mastered and used:

  1. pointers
  2. hardware IO, memory management, and concurrency.

NOTE: These points are not in sequenced, and the quantity does not means anything.

From C to Go

Took me ~15 mins to build a CLI interfacing binary and run on local machine from scratch.

  1. Has in-box code auditing tools like go fmt to scrutinize your codes.
  2. Has powerful linter like golangci-lint that drills through your codes for smelly codes detection.
  3. No longer need to do variable counting in functions.
  4. No longer need to manually manage memory (as in malloc/kalloc and free/kfree)
  5. Concurrency can be done easily without external library.
  6. Quite easy and simple to setup Go development environment.
  7. No longer depends on logging due to easy unit-testing.
  8. in-box unit test tool has a heat-map code coverage tool to pinpoint your test codes.
  9. Struggle to operate in non-operating system environment due to reliance of garbage collection (e.g kernel / bootloader / microcontroller).
  10. Has cGo that interpolates between C-Go but breaks the Go’s β€œhouse rules”.

From Go to C (Speculation based on experience)

Will take more than 2 hours to build the same CLI interfacing binary and run on local machine from scratch.

  1. Need specialized tools like Valgrind to detect memory leak issues.
  2. Need blackduck software to scan through legal risk codes.
  3. Need strict memory counting practices to manage memory.
  4. Need strict code reviews from a C/C++ expert.
  5. Need specialized tool for running unit-test OR just GDB/KGDB through your program.
  6. Need a security session to purge C & C++ vulnerabiltiy from codes like possible stack overflow, buffer overflow, memory leak, etc.
  7. You have a SOP for setting up your C development environment.
  8. Multi-level logging is vital.
  9. No heat map code coverage for test tools.

Between C++ and Go

I picked Go mainly because of its learning curve is low coming from a C developer who practiced Linux Kernel coding style. It is almost directly compatible. I took me like 2 hours to get up to speed.

I always get an impression that C++ is similar to Java, where it is a heavy battery language to build sophisticated products. Therefore it takes time (I expect min 4 weeks to be as a junior developer).

2 Likes