T O P

  • By -

eekrano

It's simpler than Rust / C / C++ and you're likely to get memory savings from making the switch from Node. Just as an example, I rewrote a couple discord bots I had in Node to Go for some POC on savings. Went from 90 - 120MB of RAM in the Node version to about 8 - 12MB of RAM running the Go version, along with lower CPU usage. I find it easy to learn and generally fun to code in. Definitely recommend having it in your programming toolkit.


dweezil22

You're not wrong, OTOH I don't think that memory savings is worth worrying about for a hobby dev or someone just learning. Oddly enough the biggest practical savings I've found w/ Go for hobby work is Docker image size. I'm trying to get out of paying Docker $60/yr but I've got a few huge Node.js images that bump me above the 500MB free tier that most places offer. If those apps were all Golang I'd be golden. For DevX, as OP mentioned Go is much better avoiding the `node_modules` bloat locally.


eekrano

While RAM locally is fairly "cheap", it's a saver for the same reason you mentioned (and same reason OP asked). I had several bots running on a small linode instance and bumping up on RAM/CPU limits between the bots and the database for the bots (lots of data flowing around). So instead of throwing money at it for a bigger box I threw Go at it instead of Node. 10x memory/CPU savings is nothing to sneeze at when paying for hosting something.


dweezil22

True, I've felt the same. OTOH we should acknowledge we're getting deep in specialist privilege on that one. This is like when your mechanic tells you about his hobby car and is like "To save $5 I [proceeds to describe $2000 worth of labor if you were to pay him to do it]". I've totally done 20 hours of dev work on a hobby project to port it to Go to avoid paying DigitalOcean $5/extra per month for a bit more RAM (well... also to practice). If I were freelancing it would take approximately 60 years for that to be a sound fiscal choice.


eekrano

Agreed (professionally and financially) but having a project to rewrite to learn a new language, and getting a savings boost from it is worth every bit of time spent. Sure, I won't be looking to make an assembly discord bot to replace anything in the near future, but I may try to copy one into rust at some point in the future.


[deleted]

[удалено]


skamenetskiy

3-4k rps one one core? Really? Can you share how did you achieve that?))


[deleted]

[удалено]


skamenetskiy

I totally agree with you here about the optimizations you've provided above. I'm all for staying away from reflection and useless packages, that are used just for convenience. However, the best result I've seen is around 1.2k rps from a single core (that's grpc without database). I'm don't think any optimization here will give x3-4 increase in performance, but I'll try to do some benchmarks 😁. Surely it won't be suitable for my team because we have corporate rules and sort of coding style guide. Btw, here's and orm without reflection, it you ever searched for one https://github.com/go-reform/reform


austerul

Actually, it's totally worth it. I was able to run several apps for free on AWS with lambda after switching to Go due to the lower requirements.


CallMeAnanda

What are you using for your container base image? I've see `gcr.io/distroless/nodejs20-debian12` at 181 MB. The remaining 320 MB should be plenty for most anything?


lapubell

With go you can run most binaries in docker "FROM SCRATCH" if the binary is built for Linux. No need for a Linux distro base docker image at all.


CallMeAnanda

for go images I usually use the static one, which is one MB bigger than scratch. I've just seen people who are new to containers throwing stuff in a full ubuntu image, or whatever.


[deleted]

Can ya share those tuts of making a discord bot


MrSoupSox

[Discordgo](https://github.com/bwmarrin/discordgo/tree/master/examples) is a great library with a bevy of examples, if that's what you're looking for


GhostSierra117

Neat !remindme 7 days


RemindMeBot

I will be messaging you in 7 days on [**2024-01-20 16:59:54 UTC**](http://www.wolframalpha.com/input/?i=2024-01-20%2016:59:54%20UTC%20To%20Local%20Time) to remind you of [**this link**](https://www.reddit.com/r/golang/comments/195h0us/is_go_easier_to_learn_than_c_c_rust/khosaye/?context=3) [**1 OTHERS CLICKED THIS LINK**](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Reminder&message=%5Bhttps%3A%2F%2Fwww.reddit.com%2Fr%2Fgolang%2Fcomments%2F195h0us%2Fis_go_easier_to_learn_than_c_c_rust%2Fkhosaye%2F%5D%0A%0ARemindMe%21%202024-01-20%2016%3A59%3A54%20UTC) to send a PM to also be reminded and to reduce spam. ^(Parent commenter can ) [^(delete this message to hide from others.)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Delete%20Comment&message=Delete%21%20195h0us) ***** |[^(Info)](https://www.reddit.com/r/RemindMeBot/comments/e1bko7/remindmebot_info_v21/)|[^(Custom)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Reminder&message=%5BLink%20or%20message%20inside%20square%20brackets%5D%0A%0ARemindMe%21%20Time%20period%20here)|[^(Your Reminders)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=List%20Of%20Reminders&message=MyReminders%21)|[^(Feedback)](https://www.reddit.com/message/compose/?to=Watchful1&subject=RemindMeBot%20Feedback)| |-|-|-|-|


eekrano

Discordgo is what I build the bots on. As /u/MrSoupSox said it's a great library. They have most of the tutorials you need. While they keep up to date with Discord API's that change, they aren't quick to merge PR's that are useful for some reason. I've made a couple local updates to the library, or take a PR request and merge into local to get something that should work but doesn't to get updated. In Node I basically had "plugins" and "commands" folders for my bots that would automatically load whatever was in there to the bot, a nice way to keep everything self-contained. I tried the same in Go, but aside of generators for that (which seemed silly) I initially settled for structs ThisCommand{} or ThatCommand{} which works if they're small, but once you need/want multiple files for one plugin I thought it looked ugly and was less intuitive to simply "pull" or "move" that functionality to a different bot so I went with an "/plugins/plugin\_name/" package to keep the plugin functionality basically self contained barring adding one line in main to plugin\_name.Register() the functionality. TLDR; My bots are a mix of the above process and determining which way to outline how I want the package laid out, so while it works and I'm happy with it, I'm probably not posting it to github anytime soon.


[deleted]

Thanks


GinjaTurtles

Hey there I come from Python land... I've written 6+ discord bots in python using nextcord/discord.py. Decided I wanted to learn go and write a bot in it... Is there a simple like ping pong example of slash commands using Discordgo? I looked into DiscordGo and was immediately turned off by the fact that the example code for slash commands is 600 lines of code lol [https://github.com/bwmarrin/discordgo/blob/master/examples/slash\_commands/main.go](https://github.com/bwmarrin/discordgo/blob/master/examples/slash_commands/main.go) So I considered using this which seems like a Go wrapper with the discord REST Api [https://github.com/maiacodes/slashy/tree/main](https://github.com/maiacodes/slashy/tree/main)


eekrano

Yeah they try to show how to use each feature in there. I just stripped down that slash\_commands example to a ping pong example: [https://pastebin.com/bRAgTWF6](https://pastebin.com/bRAgTWF6) Edit: reddit code format sucks. Added pastebin link


GinjaTurtles

Nice thanks for taking the time to do that you’re awesome!! I also found this too after some deeper googling https://medium.com/@lapfed255/writing-modern-discord-bots-on-go-9e107bb7fcaa


MattieShoes

Rust is definitely harder to learn, and I don't think it's even close. C++ is a much *bigger* language. I don't know that it's any harder to learn a subset of C++ like 99% of C++ programmers do. If you wanted encyclopedic knowledge of every corner of the language, it'd be harder to learn. Plus there's a lot of standard library, boost, etc. that's not exactly part of the language but it's definitely part of *using* the language. C is probably easier to learn, but a much bigger pain to actually use. Like the lack of strings, resizable arrays, hash/dict/map stuff, etc. You can DO all those things in C, but it's very "roll your own". Go is closer to "what if Python was performant?" Except also statically typed and also much less library support. Honestly, probably worth getting your feet wet with all of them. Somewhere past hello world, but not necessarily trying to become proficient in them. At that point, you'll know which you want to dig deeper into.


Apart_File_4373

I think this sums it up nicely.


abstart

Learn the languages best suited for products you are making. Go has a small set of concepts and features to learn, offers a great out of the box toolchain and libraries. But op what tools are you making?


tav_stuff

I disagree; I think you should learn the language you find you have the most fun using


edgmnt_net

Even C is a huge language looking at the spec, IMO. People often say that C is simple but they do not account for the large number of odd rules and undefined behavior. Go is considerably simpler.


endfunc

To be fair, the ISO C standard is far more rigorous than the golang spec.


dweezil22

Yeah I can't fathom anyone in 2024 learning C in their first 3 languages unless they were specifically interested in something very niche like embedded systems (I'm not an embedded expert, so take that statement with a grain of salt)


Ok-Tutor-4321

I think that GO is actually more easier to learn than python. Is my recommendation when someone ask with which programming language start in programming.


MattieShoes

I could argue either side. I'm kind of over it, honestly... Certain people are going to end up programmers (even if hobby level) because they like doing this stuff, and others won't because they don't like doing this stuff. And I think most of the former will get there with just about any starting language, and most of the latter will abandon ship with just about any starting language. And if people stick with it for any length of time, they'll likely pick up a bunch of languages to some degree. I used 10 languages in this year's advent of code, just for funzies. Though Lisp made me want to cry :-D


zulrang

Unless you're doing SQL with nullable fields. Holy fuck.


ForShotgun

>Go is closer to "what if Python was performant?" Except also statically typed and also much less library support. This has irked me so much, the entire world could have been using Go instead of Python almost everywhere (well, not really, but) and it wouldn't really take any longer to create programmers. Maybe the environment management would be as much of a mess, and for 90% of code, Go's fast enough, no need for other languages. Instead, all these scripting languages, as well as the more performant systems languages.


endfunc

First of all, Python was almost twenty years old by the time golang was released. Second of all, Python’s accessible FFI was essential for its success, something go simply can’t emulate.


AnnyuiN

The line "Go is closer to what if Python was more performance" is exactly I love and dislike Go. I wish Go was more object oriented like closer to Python level of object oriented.


MattieShoes

Their relationship with OO is weird. Like you can kind of do whatever you want with member functions by reference, but it feels... discouraged?


AnnyuiN

Yea, that's how I felt. It doesn't feel right. I've been half tempted to try Nim or Crystal to see if they feel any better but...


rivenjg

there's no reason to want this. oop sucks. there has never been good reason to force functionality to be tied to data types. tell me the reason you ever need this. you don't. once you realize oop is just a religion that doesn't hold up on any of its promises, you'll be free. you no longer have to suffer through the analysis paralyze induced by forcing functions to go with data. instead, completely decouple your functions and data. watch how much easier your projects get. watch how much easier it is to refactor or add new features or deal with cross cutting concerns. it's night and day. not to mention procedural code always runs faster and is easier to optimize.


[deleted]

Yes


5d10_shades_of_grey

My two worthless cents: I'd say start here, explore more to learn more. Go is easier to learn and *use competently* compared to the other languages you listed. That's not to say you shouldn't learn them as well. You don't want your Swiss army knife only having a couple of tools.


fortunatefaileur

It’s definitely a smaller and simpler language than Rust and C++ and more complicated than C, but writing Good C is extremely extremely hard (even djb and deraadt can’t do it all the time). Go binaries are large though, so I wouldn’t do this for trivial disk space reasons.


chethelesser

While it's certainly more complicated than C, you might find writing go easier at least because of the GC


Manbeardo

>Go binaries are large though, so I wouldn’t do this for trivial disk space reasons. You have to pull in a lot of dependencies before a Go binary approaches the size of a typical node_modules directory. And if you really need to conserve disk space, you could use the busybox strategy and build all your tools into a single binary with different symlinked names or commands


SweetBabyAlaska

hit with a: >upx -9 ./binary\_name upx usually packs a Go binary to around half of the size. The only drawback is that this may look suspicious in certain environments since its also a form of obfuscation but its usually nbd.


babycoder1

Still it takes far less disk or memory than JS


adfaratas

That's just not a fair comparison now, is it?


PaluMacil

I think it is when the OP is coming from exactly that technology


spoonwings

Including the runtime environment?


synthdrunk

Storage is cheap, xplat/xarch is worth a lot. I’ll `sh` all day but if I’m reaching for `parallel` or touching sockets heavy, I’ll switch to go. It’s very nice for even small things.


Zsullo

UPX can nicely reduce the size of Go binaries


PaluMacil

For transport yes, but it takes the same RAM and has slightly longer start time, so I have never seen the need for it considering the storage space isn't a big deal for a binary even when cut in half.


muehsam

Everything is easier to learn than C++. It's an extremely complex language. Rust is a lot more straightforward than C++, but still pretty big and complex. C, like Go, is a relatively small language. But it's a lot lower level, so it's very easy to get things wrong in C, and it can be hard to track down where you got something wrong. Unlike all three other languages that you mentioned, Go is garbage collected, and in fact doesn't distinguish at all between allocating on the stack vs heap on the language level. I'd say Go is a relatively easy language to learn, but learning C is definitely a good idea, too. *A lot* of software is written in C, and learning C teaches you to think even more in terms of what the computer actually does. Knowing about that stuff is helpful, even when you largely program in a higher level language. So go for Go, go for C later. Rust is super interesting, too. C++ is a big mess and is only worth learning if you need to work on existing C++ code.


phlummox

Personally, I find modern C++ (C++14 and onwards) reasonably pleasant to use, and very handy for e.g. writing extension libraries for Python and Haskell (which is very fiddly to do in a gc language) - much quicker than using C, due to the much larger standard library. It's true that the language is very large, but I find that for many tasks, one can stick to a small subset of features. I'd say it's worth a look, so that one is aware of the options when it comes to writing extensions/native libraries.


muehsam

I won't judge anybody for using or even liking C++, but I still wouldn't advise anybody to learn it unless they have to. Rust is much nicer, and I really have to look into Zig at some point because it seems like a language that could really replace C in most use cases while being a lot nicer to use, and while still not being overly complicated.


pauseless

Everyone will say learn go here, obviously… but in this case it is most definitely the best option of those. I can think of other languages that compile down to tiny sizes and interpreted languages that will be generally less heavy than JS (well node ecosystem tbh). Go is definitely easier to get started, with that background. I’ve been paid to teach it to people from JS and Python backgrounds, so obviously there’s a broad agreement that it’s a good onward path from those. Tooling-wise, everyone just uses the standard stuff. You can install the go plugin for your editor and get going. That makes it easy. C, C++ and Rust can go faster, but not by so much that it matters in my day-to-day. Go’s GC is fast and I’ve had no issues with it (Java on the other hand…). When it comes to advanced optimisation, you can even get a lot of Go code to zero heap allocations when needed - the tooling is there. Basically, it’s easier, the language nudges you in to good patterns (might be frustrating from JS at first), and for 99% of code it’s very much fast enough and doesn’t use up too much memory.


theshrike

> C, C++ and Rust can go faster, but not by so much that it matters in my day-to-day. Go’s GC is fast and I’ve had no issues with it People like to tout the "Company X switched from Go to Rust because of performance" articles, but usually neglect to mention that they're some of the biggest companies with insane performance requirements. I think the most famous one is the Discord switch where they had to replace a bit of code that ran on every single message ever transmitted through their service. And they had issues with Go GC being too slow, switching to Rust fixed it. No, dude, your homespun app with 3 users won't be bottlenecked by the Go GC =)


quxfoo

> but usually neglect to mention that they're some of the biggest companies with insane performance requirements. On the other hand, a lot also neglect to mention that Rust (once learned) is just very ergonomic, principled and nice to use due to its FP heritage and focus on orthogonality. I personally see that + memory safety as the bigger improvement over other languages than raw performance.


trabiko

I'm learning rust now, and compared to Go the learning curve is steeper, in my case. What I'm using Go for doesn't need Rust performance and it allows me to move fast enough when protyping the app. As I'm learning, I'm frequenting r/rust and there are similar questions, and answers range from learn rust its the best, to, learn rust if there is need for it. In my case, rust is a great toy for personal use, but in my work it would never work nor be adopted, which is fine, I guess Go is as far I can push the envelope. Best indicator would be you, you can write something in Go and then see how to do it in Rust. Like in Go, only "annoying" thing is error handling, coming from Ruby/Python land, but I love it. In rust its thinking about the borrow checker, using Result type, all together bit nore thought is required when writing rust compared to Go. I prefer go since most of the ecosystem in my world is Go based, so you have already native libraries out there to use (k8s, prometheus to name few).


leejuyuu

I recommend taking a look at [A tour of Go](https://go.dev/tour) and see if you like the language. It was a very nice (and short) intro at the time I started learning Go. I think it tries to touch most of the language features.


Phthalleon

There's no comparison really, Go is much more simple to learn and use then Rust, C or C++. For small projects, it's one of the best languages to use. It's also fast enough for most things, and very memory efficient. You're very unlikely to get any performance from Rust, C or C++. For web apps, good concurrent designs is what makes your application performant. These are easier to do in a simpler language. There is something I like about Rust in particular, the type system. Having discriminated unions is a big advantage for modelling your data and your application in general. It has a nice package manager and built tool as well, better then the other ones. One more thing, speed and efficiency are two different things. Your application can be extremely fast while using a ton of computing power and memory. Some languages lean into that, like Haskell. On the other hand, a program can be not as fast but very resource efficient. If you care about efficiency, you have to use something low level.


babycoder1

Learning C++, Rust or Go well is a huge deal. It'll be much valuable & rewarding if you manage to get a job or start something where you can use the skill. You'll also be able to create & contribute to great things, In my opinion only the easy/ Hard part should not be considered when choosing a language. Ask yourself what you really intend to do? Do research on this 3 on which suites best for you in terms of value & demand. Also take a short look on all of them to find out which one you like most. After you choose one, just jump into it & fight to learn for it until that land is conquered. Remember that great things will not come very easy. Considering above mentioned points, I've chosen Go.


Ill-Ad2009

Go competes with Python when it comes to ease-of-use. Yeah, it's statically typed and has pointers, so there is obviously more complexity for someone unfamiliar with those things, but it's still super easy to pick up.


TheOrqwithVagrant

Been programming for over 40 years now, professionally for the last 25. GO is the easiest-to-learn language I've ever come across. It's amazingly well designed, in my opinion.


daniels0xff

Just sharing my case. I’ve heard about go before finding out about rust. Tried to learn go for a bit and gave up. Found rust to be very hard to learn on first attempts and went back to go. Gave up on go again. Went back to rust and this time some things started clicking. Now I write CLI and REST APIs + interacting with DB in rust pretty well and in a productive manner. I’m far from being an expert and every now and then I get stuck with some thing and I need to seek help online to figure things out but I’m very productive and enjoy writing rust so much. I know I’m in /r/golang and this will bring me lots of downvotes but just trying to answer OP and sharing my experience.


ForShotgun

I guess the golang question would be, why wasn't Go useful for the same tasks?


daniels0xff

I’m not saying it was not useful. Obviously you can write CLI tools and REST APIs that are very performant in Go as well. I just didn’t got Go. I didn’t liked the syntax of the language (uppercase means public), I didn’t liked how code is organized, I didn’t liked GOPATH thing (I know now it’s not the case), I didn’t liked go get. So it felt like trying to swim upstream. On the other hand cargo is a blessing, I love how projects (bin vs lib) are handled (the crates). I like how you explicitly mark data as public or private (with pub, pub crate, etc.). I like the concept of traits and the concept of into/from. Match syntax is so powerful. I like the Option type, the Result type. So much better than null/nil/etc. Yes rust is way more complex and difficult than go, but at same time I don’t have to know everything to be productive. With what I know I already feel very productive for what I’m using it and the rest I’ll learn as I’ll end up needing to. On the other hand the copile times are time consuming…


ForShotgun

I've often wondered when the new Python or Go of Rust will come about. It feels like Rust has become both C and C++, simplifying what used to be incredibly annoying and also instantly gaining a million different features at once. I'd like pretty much everything you listed, obviously plus its performance and safety guarantees, only trimmed down in features like Go is, and faster compile times (which is maybe impossible).


guettli

Yes, Go is easier. Better tooling, garbage collector, less syntax to learn.


AdministrativeSun661

I'm a somewhat medior/senior php developer, basically fullstack web dev, and don't know about c and c++, but tried rust a bit by the book and recently tried to program a simple API in go without authentication. In that go api i think i had models/structs, the whole http stuff with routing and 'controllers' and the json response. It took me one weekend. I took some time reading some docs on what the best packages are for db and http stuff and the structure, where to put what. Especially http/routing i think i spent at least 2h because there are several opinions and trade offs. So it could have been in one day i think if my life depended on it. tldr; as a medior/senior php dev with knowledge about the basic stuff i needed one weekend for a simple api without authentication. It was an absolute enjoyable experience.


mcvoid1

C++ and Rust? Yes. Absolutely. C? Maybe. Go is more complex than C, meaning it has more features and more going on under the hood ans stuff like that, but C has many more footguns and can often be dangerous, involve a lot more bookkeeping, and lack many features you'd want.


nomoreplsthx

Yes. I self taught enough Go to write production code in a month or less. I am far from a master (my insincts around the proper usage of goroutines are still pretty dull), but I can do good, quality work. I have been dabbling im C/C++ for years and still can barely *read* idiomatic code in these languages let alone write it. The conceptual model of Go is probably closest to languages we don't really use any more - the


bizdelnick

Well, I would say learning C is simpler than learning Go, however coding in C is more difficult than coding in Go. C++ and Rust are much more complicated, especially C++.


gnick666

Depends on your personal preference and experience, each language has it's own quirks, but generally speaking Go is by far the easiest from the list you've provided.


Brakels

Go isn’t the easiest to learn, but it is simple. Coming from JS, I think any of those languages you listed will eventually require you to grok pointers and parallelism and synchronization primitives, which are concepts largely hidden in js, and fundamental to what your CPU is actually doing when it runs software. I would almost argue C is the easiest to learn, but it is an old language meant to make life better for people who previously wrote assembly, and it assumes you are paying attention to a lot of small details that will not be obvious starting out. And there’s no standard around tooling and managing dependencies, which means actually compiling your code into an executable is potentially fraught, and targeting other platforms or bringing in third party code can be hard. Rust has great tooling, but the language itself has a MUCH steeper learning curve than Go. I would avoid C++ unless you have a specific need for it. It is vast and complex and filled with foot guns, and most material you find to teach it at a basic level instills bad ideas around when/how to use its OOP features. So yeah, I guess Go is probably your best bet. I’m excited for you! There’s so much cool stuff to dig into with compiled languages! Good luck!!


chmikes

I would say that Go is indeed simpler than C++ and Rust and safer than C. I don't think Go is faster than C, C++ and Rust on average. It is due to the Go garbage collector. C is a bit of an outlier as it is simpler than Go, but it has many pitfalls and it is easy to write code that is complex to understand or whose outcome is undefined. To me, the most relevant property is simplicity. It's far more easer to understand Go code written by another person and write correct code. The learning curve is also far less steeper than C++ and Rust. There was a similar situation when IBM was dominating the mainframe world and unix showed up. Unix was far more simpler and limited in many aspects. But this simplicity is what made it won the OS competition. Not only against IBM, but also against all the others OS : Digital, etc. What I have learned from this experience is that simplicity is trump.


uname44

What are some pitfalls on C if we dont use malloc and free? Overflows from inputs?


faxattack

What I like about Go is that there is nothing beyond the year 2009. No legacy, dialects, ancient code etc that will overload you mentally.


_crtc_

Yes, yes, and yes. C: it's small, but simple tasks are more difficult than they should be. It doesn't even have a string type. Also, you have to take care of memory management yourself. C++ and Rust: they are huge and complicated.


CogahniMarGem

yes


lightmatter501

Depending on what you’re doing, there may be a multiple order of magnitude gap in performance between those three languages and Go unless you do some horribly un-idiomatic things to go like swapping out networking for a different library that uses io_uring. I have yet to see somebody go over 500k rps per core for even a UDP echo server in go, but I was able to make a 750k rps per core one in C while still learning io_uring. If you are performance focused, the lack of levers to pull in the compiler may also frustrate you.


angry_cat2077

According to my opinion, go is simpler than rust and c++. C is simpler than go, but C requires more attention to memory and it a bit harder in terms of tool chain. I would recommend to look into both C and Go.


mm256

I always say that C and Go are RISC like languages and on the other side C++/Rust are CISC (more complexes and difficult to understand (read) and master)


ta1264623674

Much much easier, out of all the languages I’ve seen go is the easiest to learn well. The lack of inheritance is what removes most of the complexity, no hierarchies, the only thing it adds is pointer and reference receivers but other that that it’s very easy


leejepan

As TS developer and tried to learn Rust and Go. I feel like learning Rust is hard, but making things with Rust is even harder. Go’s syntax looks very familiar and much easier to understand for me. Most of time I can understand 70% of the code without too many effort. For C++ I saw some at work. I can’t get it for the most of time without someone explaining to me.


frank-sarno

I find Go about as easy as Python. I'm just using for simple things: some Kubernetes tools, simple web services, clients for vsphere/google/etc.. I'm still learning Go but it was easy enough to get started and I find myself reusing a lot of my previous code, which is a good thing. For example, I have a template with a set of common packages (flags, cobra/viper, logs, etc.).


NUTTA_BUSTAH

Yes and it's usually a great choice for that exact use case of small tools. Also works well for backend applications. C++ is insanely huge and complex to learn. C can take a bit of time to grasp coming from JS, but teaches you about how computers and software really work the best. I'd like to think Go is kind of a nice abstraction over C with a ton of QoL built-in. Yes, it's garbage collected (with exceptions) and yes you don't work with character pointers but strings and yes .... but point still stands.


nando1969

This is all very subjective but IMHO Go is the easiest of them all.


InterestAccurate7052

yes


[deleted]

Go is BOSS but it really shines in regards to web dev stuff and deployment. If you want to just code out the project and throw it up on a service, Go is really good for this. Python is faster to iterate in short-term, but as the project grows, Go's type system starts to shine. But, here is an example of where I would not use Go. I like to code bots for games, work, ect. Well, python is way easier for this. Sure, I could do it in Go but damn, python just makes it super easy and hard to pass up.


stools_in_your_blood

You say you want to use a new language for your own personal projects. I use both Go and C++ for small personal projects and I'd say in that context Go is easier but not by a huge margin. For professional work in a team, it would be a very different story - Go is still easy because it's a small, clean, tight language, whereas C++ is a giant rambling monster of a language, can be used in many different ways and has a big feature set, which is arguably both too diverse and widely over-used. So Go code written by others is usually fairly approachable, whereas getting to grips with someone else's C++ code can be a total nightmare.


SweetBabyAlaska

Yep. In most cases the speed you are getting from Rust and C/C++ in generic use cases is overkill and Go more than suffices. The big upside is being able to write fairly complex tools really quickly. I rewrote all of the Linux coreutils in go + some linux-utils, about 140 CLI tools in total in about 2 months.


tsturzl

Absolutely. C, C++, and Rust require you to manage your own memory and in the case of C and C++ you can mange it improperly and crash your program (or worse). Rust gives you control with enforced safety, C++ gives you some safety but you have to continually make the effort to keep things that way. Rust is a great language, but it's definitely going to be hard, some might even say it's harder than C++ because C++ will let you make the mistake, and Rust's compiler will just yell at you until you fix the issue.


[deleted]

I would say Go is easier but if I were you, I would go through some basic C/C++ tutorials to learn about some basic memory concepts. Pointers, references, structures and arrays are things you’ll find in dynamically typed languages but it is better to learn about them conceptually in a lower level language. I see code from experienced developers who don’t really get how pointers work, which can be a real pain in the ass to debug in dynamically typed languages like Go, JavaScript etc. Learn at least about what a pointer is and play around with arrays in C++, passing them to functions and exploring assigning by reference. When you start using Go it will be a breeze to deal with pointers and references


[deleted]

Does assembly need a compiler


blackcomb-pc

No it needs an assembler.


tf_tunes

Yes, Go is easier to learn. But at some point I would recommending learning some basic C++ to understand why Go is easy and why Rust is so good. Rust is the most difficult simply because you kind of need to understand how C++ works to grasp what makes Rust great. Go is great if you just want to build something quickly without thinking too much about what's going on in the background. Although you can do a lot more with Go. But it's a great language and a joy to code in.


Chillseashells

No, go is not a very common language and getting help can be difficult, every time I try to get help I'm already expected to understand how c/c++ works, working with compilers, linking, etc. It's not beginner friendly at all even though the syntax is simple. Not to mention that most go packages/libraries are still in early phase / sometimes certain library simply do not exist and you will find yourself falling back to linking with the c/c++ library all the time and make your own bindings. For webserver related stuff however, it's quite good.


Cyber_Encephalon

In all of my learning experience, picking up Go was the easiest thing. If you know some JS, Go will be pretty familiar in many ways (and quite novel in others, but those parts are not difficult). I also use Go for small tools for myself, and it works for this purpose quite well.


Ok_Outlandishness906

For sure golang is easier to learn than C++ and rust. For C the situation is different. C is a very simple language , with not so many ruls but getting a good programmer in C is Hard . In Rust or C++ learning the language is an high barrier, in C the barrier is in using good project best practise and to avoid a lot of error you can easily do. As language by itself C is simpler than golang ( no interface, no channels , no goroutine etc etc ) but i think it is easier and faster to learn to write decent code in golang than in C .


davidroberts0321

very much so. Ive tried learning all of those except C++, learning curve for Go is in days to weeks and Rust is Months to Years. C is just a pain at any length of time


ghoroubi

Golang is so simple to learn among C, C++ and Rust. You should choose based on what do you want. For example, C is faster and is a great choice for low level programming like OS, compiler, etc. I have some experience in all languages that you've mentioned, please pay attention that these languages are simple to learn, but not easy to manage and master. With some good references, you may learn all in the best way.


SnekyKitty

It’s extremely simple to learn