Development speed comparison for C/C++ vs Golang


(Lindskog Work) #1

Hello,

I was wondering if there are any studies that compare golang with C/C++ regarding initial development speed. Has anyone studies this subject? Has anyone implemented a component with both languages and compared the development speeds?

Thanks,
Umut


(Lutz Horn) #2

By “development speed” to you mean how fast a competent programmer can use a language and write real programs?


(Lindskog Work) #3

Yes but in comparison with C or C++. Same developer, same functionality different languages.


(Lutz Horn) #4

I know no such studies.

In general, Go is considered to by an easy language to learn. The tooling is comprehensive, the community is vibrant, the library and framework ecosystem is huge.

All this can make an average programmer more productive than using other languages. But, as always, it depends on the circumstances.


(Holloway) #5

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).