Should I learn C before I start with golang?

Hi,
I am a storage guy trying to learn a new language. I am also trying to learn AWS. Found that AWS has go SDK so thought I will try my hand at Go. This way I can learn AWS and an automation language simultaneously.

My background:- I have done some Perl scripting in the past. I also know a bit of Python and very little C.

My dilemma: It appears that Go is for those who are extremely proficient in at least 1 language (C/C++/Java). To me, Go appears a lot like C but like I stated earlier, I know very very little C.

Should I learn C and then learn Go?
Please advice.

Hi

I think learning C is much harder than learning go. C is a small language but pointer arithmetics and manual memory management can be a bit hard in the beginning. So my recommendation would be to start with go and if you need to learn C later. But this is just my opinion. I think go hits a sweet point between easy to learn and write and great performance. Python is easy write but programs are usually slower, C can be really fast but harder to get right.

4 Likes

For a Go programmer, it can be very helpful to already know C because then you can use the cgo package to fall back to C when you need more direct connection with the operating system. But then you may be writing non-portable code, so it’s best to avoid cgo if possible.

If you learn C first and then learn Go, you will find Go much easier, as Johan said. But you will still have to learn things that are in Go and not in C, and you will need to adjust your thinking to almost always prefer to use slices rather than arrays, for example.

I learned C in the early 1980s, and as a result, learning Go was easy for me. But if your objective is to learn Go, then I have to say that making yourself learn C first really isn’t worth it.

BTW, I don’t agree that Go is only for people who are “extremely proficient” with C/C++/Java or the like. There are people on the forum who are learning it as a first programming language, or with backgrounds in just Python or some other interpreted language.

I think the thing that’s missing is a good comprehensive book to teach Go starting at a beginning to intermediate level. There are few books (and online resources) for beginners, and they usually don’t cover the full language. And there are books that start at an intermediate to advanced level that go into detail. So it’s easy to get the impression that Go is for advanced programmers only.

Really, I’ve found Go a lot simpler and easier for beginners than C was for me. Maybe that is all I needed to say!

8 Likes

Hi All,
Thank you for the reply. I did do a quick review of C. I had forgotten the switch statement. So I think I am now ready to start learning Go.
Thank you all once again for your reply.

2 Likes

Look forward to all you’re going to learn. It is an interesting journey in front of you.

2 Likes

Really nice article

You don’t need to learn C to learn Go. Go is very simple but it’s very subtle. It’s easy to learn but not easy to master.

For example, here, I’m teaching to every level of people: Go: The Complete Bootcamp Course.

1 Like

Hi,
Thanks for the link. Just that I have already enrolled for another Go Course on Udemy by Kam Hojati about a week after posting question here. If I had seen your comment earlier, I would have sure gone for your course.

It’s not a problem at all :slight_smile: Check out the free preview videos, you can easily see the difference.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.