IMHO, Python is more work to develop in than Go. Haven't worked in PHP or Ruby in over a decade, but I suspect they're just as bad. Go requires a bit more typing, but the result is more likely to be correct and when it's not correct it's easier to figure out why than in Python. In my experience, typing isn't the thing that slows me down, it's when something goes wrong and the language doesn't have the ability to help me quickly resolve the problem. Go is just way better at this than the "higher" level languages. Answer from william_moran on reddit.com
🌐
Reddit
reddit.com › r/golang › how is your productivity with go compared with other more higher level languages?
r/golang on Reddit: How is your productivity with Go compared with other more higher level languages?
April 11, 2024 -

I came to Go from Ruby but I've been writing mainly Go for quite some time now and I forgot how it was to work on a Ruby project. For those doing this daily, with PHP, Python, Ruby, JS, ..., do you feel that there is a huge productivity gap between those languages and Go when dealing with web applications? (server side rendering)

🌐
Reddit
reddit.com › r/golang › cognitive load of go vs other languages
r/golang on Reddit: Cognitive load of GO vs other languages
August 7, 2023 -

So I wrote an app a few weeks ago that had a frontend written in Alpine JS and PHP on the BE. I used PHP because I wanted something easy to deploy (typically use Ruby for web dev). I decided to port it to GO for fun because I did a bit of go before.

It took 3x as many lines as PHP! 3x as many. Crazy. That's partly because you can't have 1 line if statements with my linter and because of all the error handling.

BUT, what I noticed is that even though it's much more verbose the cognitive load with GO is SO MUCH LOWER.

I love to code and have been doing it for 25+years but I realize that sometimes when I have hard features to code I sort treat it like a mission I have to go on. I know it's going to be stressful and unpleasant.

With GO however it all seems pretty easy. For one the fact that it's staticly typed is a lifesaver. I'm used to that with C++ and Java though, but the way Fiber handles taking your POST JSON and sticking it into a struct is great. You don't have to wonder "wait, is this actually a string when I thought it was a number?" That really mitigates a lot of the stress of building webapps. That communication layer between FE and BE can be a pain.

I feel like my mental CPU clock just stays at 15% instead of averaging 50% and spiking up to 100 frequently (sort of like GO vs Node on a server). I just can't get past that. Even though the language itself is nothing special. It doesn't even have ternaries, but I can always look at the code and it's basically as simple as it gets.

Idk, writing go I just feel a big weight has been lifted off of my shoulders, I don't mind the stress of programming, I enjoy the fight but now I'm like "huh, I'm really productive and I'm not stressed at all..."

As I mentioned earlier I used PHP because it's easy to deploy. Well... GO is not QUITE as easy to deploy as PHP, you can't just stuff your files on a shared host BUT I've been deploying to a DO node by just FTPing in and dropping my self contained executable. That's really, really easy. Also, I use NGINX so I just make a nginx entry for it and there you go. Plus it takes so little ram that you can deploy like 10 go apps to one $5 vps.

Plus when you need to look at the code of a package you use it's pretty easy to understand what's going on in most cases.

I'm honestly surprised GO isn't more popular. Like it's not the cool kid. People are loving typescript (which is a nightmare to me personally) and want to use it everywhere but like to me it's not worth it.

And the best part, is that it gets amazing performance out of the box. I tried Rust which is an enigma wrapped in a mystery inside a riddle (thanks WC). It's so painful to get working with it, and GO isn't as good as Rust in terms of performance but it's close enough and it's about 20x easier as a language.

Anyway, just wanted to share that. I really like it.

Edit: Also recompiling is a pain but the fact that so many errors are caught before or during compile makes up for it. With dynamic languages it's like "Okay now it's reloaded... What did I break, lets see"

Top answer
1 of 5
97
Contra the assumptions of many Go detractors, I have in fact programmed in the supposed Promised Land. I have used many dynamic scripting languages, and I learned them very deeply. I have used Haskell to do non-trivial work. (Not huge work, but non-trivial, not just "I played with it a bit".) I too know how to use one-liners to take some dictionary and transform it into some other completely different dictionary while filtering out the empty items and some other fiddly detail. And what I noticed, years before Go was even at 1.0, is that my professional code kept getting simpler and simpler. My biggest shared code base was Perl, and while it may have a bad rep as line noise, it is another language that had a lot of the nice features I'm supposedly missing from Go. I noticed using the clever stuff (not always mine) was where bugs arose. My fellow programmers wouldn't understand it until I blew it back out into simple code, with intermediate variable names, and places to comment on things, and then it would stop being a problematic part of the code. Perl had all sorts of support for all sorts of things and on the net I was removing them. I would do one thing on one line even if it was easy to do more. Where I ultimately ended up is that my other code converged at roughly Go's level of verbosity anyhow. So using Go turns out not to be that much of an impediment. Now, the error handling is a bit more verbose, yes, but I also find I'm often doing things in those handlers by the time code gets to production. Just blindly returning errors is not something you should do; you should definitely think about the situation first. And a lot of times Go has a quite nice solution to some problem. It isn't that I don't understand how to use all the line-saving techniques. I understand them very well. It is that I also understand that those have costs. In particular, the main problem with clever code is that your code is being read by not particularly smart developers. I don't just mean that in an inegalitarian way (though I do not subscribe to the idea that everyone is equally talented in every way), but there is also the much bigger problem that even if a developer is reading your code that can figure out what it is doing if they puzzle over every line, the most common case that your code will be read, it is being read by a developer who doesn't want to apply that much brain power. They are not here to read your code and get a thrill about how amazingly concise it is. They are here to solve a problem. They are not studying your code, they are skimming it to try to find their problem. Your code should be skimmable, and that means that you don't write in a style where every character has Phenomenal Cosmic Meaning. You write code in a highly idiomatic manner, that does nothing surprising, and does not have little clever bombs in it all the time. All that said, there are things that are missing from Go that I would like from that world. It is again not that I don't understand the virtue of sum types and the other techniques. It's just that considered wholistically, even in those cases where I would see them as net positive, I see them as less net positive than many do, because I've seen what happens when I throw a huge chunk of very complicated code at the average developer, versus much simpler code. I can do some nice things with sum types; I've seen developers seriously screw them and those other nice features up, though, and when they do, my oh my is that the worst mess you've seen. In a nutshell, I'd rather apply my cleverness to finding simple solutions that can be understood by other developers, even ones not applying their full brain power, than wielding complicated tools to create complicated solutions full of surprising corner cases. (Go has corner cases, of course, but they generally aren't surprising, which still makes them better than surprising corner cases.) All in all, as a professional programming language I find it makes very good tradeoffs. It isn't perfect for everything and there are tasks I wouldn't blink at dropping Go and reaching for Rust or something, where the additional load on developers is actually a net savings in the long term. But it is much better than the people who just want to show off how clever they are realize.
2 of 5
14
Yup. You can totally tell that readability and maintainability were two of the major design objectives.
🌐
Reddit
reddit.com › r/golang › go performs 10x faster than python
r/golang on Reddit: Go Performs 10x Faster Than Python
February 13, 2024 -

Doing some digging around the Debian Computer Language Benchmark Game I came across some interesting findings. After grabbing the data off the page and cleaning it up with awk and sed, I averaged out the CPU seconds ('secs') across all tests including physics and astronomy simulations (N-body), various matrix algorithms, binary trees, regex, and more. These may be fallible and you can see my process here

Here are the results of a few of my scripts which are the average CPU seconds of all tests. Go performs 10x faster than Python and is head to head with Java.

Python Average: 106.756
Go Average: 8.98625

Java Average: 9.0565
Go Average: 8.98625

Rust Average: 3.06823
Go Average: 8.98625

C# Average: 3.74485
Java Average: 9.0565

C# Average: 3.74485
Go Average: 8.98625
🌐
Reddit
reddit.com › r/golang › any idea why go is not massively overperforming java in this benchmark ?
r/golang on Reddit: Any idea why go is not Massively overperforming java in this benchmark ?
April 28, 2025 -

In this benchmarking test, Anton the youtuber is testing REST API built using Java (Quarkus) and Go (Fiber). I always thought that Go Massively outperforms other compiled and GC languages like java and C#. But according to this test, go barely outperforms java api. This test uses Fiber which uses fast http which is faster than the standard lib net/http. The benchmark uses two tests: 1). A simple get api which returns a UUID as json 2). An api which fetches a file from local computer, saves it to amazon S3 and then saves metadata to Postgres. The 2nd test is closer to real world use case. I am studying go and could use your comments to know what could Anton do to further optimize his go app. I know a performance gain of a few seconds doesn't matter. I am just curious.

🌐
Reddit
reddit.com › r/golang › is golang really a competitor to c++ ?
r/golang on Reddit: Is Golang really a competitor to C++ ?
March 21, 2024 -

So I have recently watched an interview where Ken Thompson was saying he got convinced to build Go after he read some C++ codebase. I also read some blogs saying the same.

But how can Go compete with C++ which has manual memory management ?

The reason people are using C++ is because of its Speed and ability to manually manage the memory right ?

How can Go which has GC be used to write Game development, HFT softwares, automobile softwares, embedded and expect the same result as that of a manually memory managed language?

Or is there any plan to add manual memory management to Go ? Which would make it really awesome ig ?

Here is the Google I/O conference

Ps: Beginner.

Edit: By competitor I meant the same things C++ does that go does it easier and better.

I think many people thought I was trying to make a language war here lol.

As i specifically mention above I'm a beginner and I was just trying to get the thoughts of experienced devs who used both.

🌐
Reddit
reddit.com › r/golang › go is faster than other fast programming language on text search in file?
r/golang on Reddit: GO is faster than other fast programming language on text search in file?
August 29, 2024 -

For a personal project I wanted to know what is the best language for searching a keyword in a text file.

I did some research and I found out that the best languages ATM for efficiency and speed are:

  1. rust

  2. c++

  3. go

I tried to create a scenario with a file (filled with lorem ipsum) of 54MB and performing the search with the languages listed above. I was flabbergasted when the results came out.

The most difficult scenario (i leave the boxplot below) happens when the haystack that I need to find is in the end of the file (cause the programm will need to cycle to the end to find a result).

The scenario's result (based on 100 tries for each language on the most difficult file) is that go is very fast, at least 4 times faster! Im still learning so I'm not aware of the possible shenanigans that go uses to handle files.

If someone can explain if the behaviour is correct or have any feedback I will leave the code in the end of the post

https://github.com/learning-bos/file-search-comparison.git

Top answer
1 of 5
45
There are some issues with your benchmark: You are not measuring the elapsed time correctly in Rust: start.elapsed().subsec_nanos(); This always returns the fractional part of a second. If the measurement takes more than 1s, you will get a wrong result. 2. You are converting both the line & the search word to lowercase on each iteration. You are not doing that in Go. This has 2 implications: Strings in rust are strictly UTF8, so to_lowercase() has to do some unicode gymnastics (that's why Rust has 2 versions of that method: to_lowercase and to_ascii_lowercase if we are sure that we are not dealing with unicode symbols) In rust to_lowercase() is always allocating a new string, thus you have 2x times unnecessary allocations. There is make_ascii_lowercase that modifies the string in place, but is still not needed here, becasue the Go app does not do that After I've fixed those issues, rust version become 4 times faster than the Go one on my machine: Rust: 53.0590,27.2250,0.7080 53.3550,26.5340,0.7020 53.1930,27.1070,0.7140 54.3300,26.5720,0.7060 53.9280,26.9780,0.7030 Go: 208.0063,95.8225,2.8097 214.5191,112.5149,2.4609 188.1981,83.5011,2.0675 177.8512,83.5049,2.0324 185.1850,88.1454,2.4182 You can see that the Rust version is not only 4x faster, but the times are much more consistent. This is due to the lack of GC we control when to allocate (and thus we can avoid it) go strings are immutable, so the go app cannot reuse the buffer and is always forced to reallocate. Ouch Here is the fixed code: use std::fs::File; use std::io::{self, BufRead, BufReader, BufWriter, Write}; use std::path::Path; use std::time::Instant; fn main() -> io::Result<()> { let search_word = "pianissimo"; let file_locations = [ "text/big-end.txt", "text/big-middle.txt", "text/big-start.txt", ]; let file = File::create("rust-results.csv")?; let mut file = BufWriter::new(file); writeln!(file, "end,middle,start")?; for _ in 0..100 { for (idx, &location) in file_locations.iter().enumerate() { let duration = search_word_in_file(location, search_word); if idx > 0 { write!(file, ",")?; } write!(file, "{:.4}", duration)?; } writeln!(file)?; } Ok(()) } fn search_word_in_file(file_path: &str, search_word: &str) -> f64 { let path = Path::new(file_path); let start = Instant::now(); let file = File::open(&path).unwrap(); let reader = BufReader::new(file); for line in reader.lines() { if let Ok(line) = line { if line.contains(&search_word) { break; } } } start.elapsed().as_micros() as f64 / 1000.0 } PS: We can make the rust code even faster. The .lines() iterator allocates a new string per line internally. We can do better - we can avoid that allocation very easily: fn search_word_in_file(file_path: &str, search_word: &str) -> f64 { let path = Path::new(file_path); let start = Instant::now(); let file = File::open(&path).unwrap(); let mut reader = BufReader::new(file); let mut buffer = String::new(); loop { let n = reader.read_line(&mut buffer).unwrap(); if n == 0 || buffer.contains(&search_word) { break; } buffer.clear(); } start.elapsed().as_micros() as f64 / 1000.0 } Now the Rust times are 42.2030,21.0930,0.5610 43.1250,21.0560,0.5590 42.2610,21.1830,0.5640 42.2660,21.1010,0.5610 42.1410,21.2030,0.5580
2 of 5
16
Go is using a different algorithm. You might think that the way to search for a substring is simply to find an instance of the first letter, see if it's followed by the second, etc. And indeed that's a reasonable approach for small inputs, and how most language implementations do it. In the Go standard library, they bothered to implement the Rabin-Karp algorithm to speed up searching larger inputs using a rolling hash.
Find elsewhere
🌐
TFTUS Official Blog
tftus.com › blog › golang-vs-other-languages-a-comparative-analysis
Golang vs. Other Languages: A Comparative Analysis
December 16, 2025 - Golang, on the other hand, is designed to be fast and efficient. Golang’s compiled nature and concurrency features make it a faster choice than Python for many applications. Java is another popular language for building enterprise applications.
🌐
Orient Software
orientsoftware.com › blog › golang-performance
Golang Performance: Go Programming Language vs. Other Languages
July 4, 2023 - The biggest advantage of Go when compared to other languages is its built-in support for concurrency through channels and goroutines. Golang is considered an optimal choice for building cloud-native applications and high-performance microservices.
🌐
Reddit
reddit.com › r/golang › why is golang not as performant as c or c++?
r/golang on Reddit: Why is Golang not as performant as C or C++?
January 12, 2019 -

Hi all,

First of all, forgive me to ask this. I am a noob to Golang and find it very promising to learn. I read that Golang is not as performant as C or C++ code. What's the reason behind this? AFAIK Golang is very close to C or inherits many features. If this is the case, why is Golang gaining popularity? How about the future of Golang developers? What's the primary domain of use - cloud?

Top answer
1 of 14
248

Some people like to blame all of the slowness of languages like Go, C#, and Java on garbage collection, but that isn't a very complete story. People will correctly tell you that normally garbage collection takes up a very very small % of total runtime, and that is true, so what else is going on? There are some indirect and related things as well.

  • Languages that have garbage collection are attempting to be memory safe languages, so:

    • They will also tend to have array bounds checks when the compiler can't prove they can be elided

    • They will tend not to allow as many clever casts

    • They will tend not to allow pointer arithmetic

    • Providing ways to leverage SIMD instructions by hand is hard (Go gives access only through Go assembler at the moment)

    • They will tend not to have a way for the compiler to do floating point optimizations that can change results like --ffast-math in C compilers

  • Garbage Collection has some indirect effects aside from how much time is spent doing GC

    • Every time the GC runs it pollutes the CPU caches, slowing down code that runs later

    • GC will normally imply a degree of overhead when doing FFI (interop with other languages). Go has even more overhead due to how it manages it's stack, which facilitates goroutine features. Lots of things require FFI still (3d rendering, for example) so those things will always be slower.

    • The control you get over memory layout of your data is usually limited to some degree. For instance in Go you can't explicitly control whether data goes on the stack, or heap, or *where* to goes on the heap. On the bright side in Go you can at least work with any type you create as a value or a reference, so you can at least control things like making sure your array is an array of values in contiguous memory vs an array of references, which you can't in Java. Accessing RAM is very slow, controlling memory layout on modern computers can be a big deal, assuring that you hit the L1 and L2 cache as much as possible.

There are also just some cultural things, people working on the C and C++ ecosystems are doing so because performance is priority one. People working on ecosystems of memory safe languages obviously have a bit of priority for safety, correctness, or productivity or they wouldn't want the GC!

None of these things in isolation is normally a very big deal but they can add up.

2 of 14
44

There are tons of differences in the implementations of C and Go that slightly slow down Go in favour of safety. A few things:

  • goroutine scheduling

  • growing stacks

  • Runtime checks for memory access (you panic on nil not segfault)

  • runtime reflection

  • Bounds checking on arrays/slices

  • No naive casting (safe type assertion)

  • Different calling conventions

    • this allows panics at any pint

    • Go relies more on the stack (no fastcall)

  • Defer

  • Much fewer optimizations in favour of fast compile times

  • latency optimized GC, this limits throughput

All of this and much more lead to the fact that cgo has quite some overhead.

C is still the most dominant language and this will be remain true longer than we all live. Go improves C in lots of aspects that address issues faced today.

  1. Go is memory safe making it way less dangerous to program critical systems

  2. Great multicore capabilities in times after Moore's law

  3. Go scales great

🌐
Quora
quora.com › How-fast-is-Golang-compared-to-other-programming-languages
How fast is Golang compared to other programming languages? - Quora
... Go is a compiled, statically ... runtime, delivering performance often between C/C++/Rust and high-level managed languages (Java, C#), but closer to lower-level languages for many real-world server workloads....
🌐
Reddit
reddit.com › r/golang › when is .net more performant than go?
When is .NET more performant than Go? : r/golang
October 20, 2024 - The generated code is super good, but it does not matter, when everything is an Object, which requires a lot of memory allocations and makes optimisation suepr hard · On the contrary .Net has a lot of performance-wise goodies like spans and structs. Golang is pretty mediocre.
🌐
Quora
quora.com › What-makes-the-performance-of-Go-better-than-other-languages-like-Java-and-C-despite-its-GC-overhead
What makes the performance of Go better than other languages like Java and C++ despite its GC overhead? - Quora
Answer: Constrains. Go is more similar to C than it is to C++ or Java, although it picks on some of their best ideas (strong typing, memory management). The only intended paradigm to write code in go is Procedural, which is much closer to how ...
🌐
Reddit
reddit.com › r/golang › go vs rust: i was wrong about performance
r/golang on Reddit: Go vs Rust: I Was WRONG About Performance
February 4, 2026 -

I benchmarked identical Go and Rust servers under heavy load:

- 15,000 concurrent users

- 15 minutes sustained load

- Real Hetzner K3s cluster (not localhost)

- Separate nodes for apps, monitoring, and load testing

- k6 for load generation, Prometheus + Grafana for metrics

Both servers do the same thing: 100 iterations of SHA256 hashing, return JSON.

Go: standard library only

Rust: Hyper + Tokio + sha2

I tracked p50, p90, p95, p99 latencies in real-time.

The results were not what I expected.

Code is on GitHub if you want to run it yourself: https://github.com/huseyinbabal/benchmarks/tree/main/rust-server-vs-goserver

Curious what you all think.

🌐
Reddit
reddit.com › r/golang › why i think go is worth it
r/golang on Reddit: Why I think Go is worth it
July 31, 2024 -

Hello, I've recently made the switch to Go. And all I can tell is that it's really amazing.

Some context

I come from python/Django and now I use a simple net/http and gorilla/mux. My API is now a 1000% faster lol, I dropped from 871ms for an authenticated query using Postgresql to only 32ms with MariaDB (using GORM) Update 1: after researching more, PostgresQL seems better to use :)

Why I think it's worth it

Python is inevitably nice to use for quick ideas, but go is there when you want the performance. Go, not like Python, is a compiled language. Which means it builds an optimized binary and then runs it. Python interpretes it and that's why it's so slow. Another thing is the syntax. I've been using Jetbrains GoLand and the power it gives is impressive. The syntax is easy to read (thanks to go fmt which lints the code in a very specific way) which means that Go code cannot be messy and difficult to read (in my opinion) I also like the fact that it uses "packages", which allows you to split functions in as much files as you like in the same directory, which helped me a lot, I don't have to search for specific functions in a big 2K lines+ file.

Should you learn go?

I'd obviously tell you to do so, but it depends what you want to do :) For APIs, I'd use it for sure, never doing it in Python ever again. I suggest you use the same light stack as me: net/http, gorilla/mux, GORM and MariaDB. If you're wanting to make a simple website, I guess you can by using a web framework? But if you know JS I'd use Next.JS :)

I hope this post might have helped you in your choice :)

Update: I've switched to PostgresQL and there is no extra delays, around 20ms extra?

🌐
Reddit
reddit.com › r/golang › about go performance
About Go performance : r/golang
July 6, 2023 - In C with the restrict keyword, you can instruct the compiler that it can treat a memory range as non-overlapping with any other range, giving it much more freedom to optimize code based on the assumption that memory through that pointer is not being changed by writes through any other pointer. In Rust every slice of non-cell types gets this for free, because of the "either mutable or shared but not both" rule for slices which is also proven at compile time. This gets you the most optimized code possible without any of the risks of the C approach. (However, unlike C, it still inserts bounds checks for slices by default) In Go, like with nil pointers, the language cannot require slices of the same type to be non-overlapping and cannot prove at compile-time whether they do overlap, so it has to generate much more conservative code that misses important opportunities for optimizations.
🌐
Reddit
reddit.com › r/golang › why golang is better than other languages?
r/golang on Reddit: Why Golang Is Better Than Other Languages?
November 6, 2019 -

What you can do with Golang?

While some different languages like C, Java, and so on have strong command over the field of programming, a few new models have been introduced that can spell better outcomes for the modern computing, particularly in the cloud. The expanding ubiquity of Go for the most part owes to its lightweight and the fact that it’s reasonable for pretty much every microservices architecture. Container darling docker, as well as  Google’s Kubernetes, are also built with the use of Go. Go is also holding the ground in data science owing to its advantageous features, which the data scientists are hoping to use to acquire increasingly successful outcomes.

Being a profoundly advanced programming language, GoLang can facilitate the developers in various manners, which additionally incorporate native concurrency, garbage collection etc. While utilizing Go, a developer need not depend on a few other native capabilities to limit the need of composing codes to fix memory leakage, and so on. Some of different features offered by GoLang can fit flawlessly with data science and microservices architectures.

As a result of these previously mentioned advantages, Go is progressively being used by legions of companies everywhere throughout the globe. An Application Programming Interface for the Tensorflow has been incorporated, and products,such as Pachyderm are being created with using Go. There are a series of parts of Cloud Foundry that have been written in GoLang too. Also, the interesting thing is that this list is normally including various names composed with the help of Go. To know the comparison between Python and Go, just go through- Python vs Go : Which one to choose?

What Makes GoLang Absolutely Irreplaceable?

It was not exceptionally long that GoLang had set its journey to bring an improvement and also reduce some of the long-standing issues of the development industry. In the journey of giving the millennial developers a unified and consistent experience of development, Go appeared, and as time passes, it’s carving a niche for itself without a doubt. Be that as it may, is it worth the whole buzz? Is Go genuinely irreplaceable? Is it capable of staying ahead in technology race? Let’s find it out.

Simplicity is the Major USP of GoLang-

Simplicity is unsurpassable and GoLang has absolutely taken it to the next level. Numerous successful programming languages, for example, Rust, Scala, and so on are full of different complex features. Likewise, they have spelled amazing outcomes in development by having provided advanced memory management and type systems. These programming languages have absolutely taken the mainstream languages of their time, for example, Java, C#, C++, and so forth., and boosted their overall capabilities. Having taken a different and simpler way, GoLang has effectively eliminated many of such features, yet, for quite a few reasons. The following are some features and capacities that Go has eliminated:

1. No Generics-

Generics or templates allude to the pillar of various programming languages. By including the complex and error messages related to  generics, they can frequently be obscure to understand. By having chosen to hold back on this part, the Go developers have made it simple to work with it. Without a doubt, it has been an extremely disputable yet a savvy decision taken by the designers.

2. Single Executable-

There is very discrete runtime library in GoLang. It is capable of generating a single executable that one can deploy by copying. Thanks to this for eliminating the risk of version mismatches or dependencies. Additionally, it could be an incredible help for container based development projects.

3. No Dynamic Libraries-

There has been a slight change in 1.8 version of GoLang, as now the developers can load dynamic libraries in it by plug-in packages. But, as this feature was not in GoLang from the get go, it’s as yet considered as an extension for the extraordinary features.

Go Owes its Popularity to Goroutines-

From an efficient perspective, Goroutines is regarded as one of the most interesting parts of GoLang. It can allow the experts to harness the capabilities of multicore machines in a helpful manner.

1. CSP-

The establishment of GoLang’s concurrency model is C. A. R. The prime thought is to misdirect any kind of synchronization over the shared memory between a few threads of execution that is work-intensive and mistake inclined.

2. Synchronize Go-routines-

Another powerful method to wait for goroutines is to utilize sync groups. One can declare a wait group object and along these lines pass it to each goroutine that is responsible for calling its Done() techniques when it’s totally done.

3. Channels-

Channels can permit goroutines to exchange data easily. One can make a channel and pass it on to a goroutine. The user can not just write the channel, yet in addition read from it.

Handles Error Seamlessly-

The whole concept of error handling is dealt with diversely by GoLang. By convention functions, GoLang will never fail at returning an error as its final return values. Despite the fact that one can’t return errors from a go-routine, he/ she can convey them to the world outside through a few different mediums.

It’s to be sure a decent practice to pass an error channel to a go routine. The users can likewise write errors to the database, log records or call remote services while utilizing GoLang.

🌐
Reddit
reddit.com › r/golang › reasons you prefer golang over java?
r/golang on Reddit: Reasons you prefer Golang over Java?
May 17, 2023 -

Background: I've been using Java for about 8 years and just started learning Golang.

So far, I'm in love with the language, and these are the top reasons:

  • More low-level control of memory. I hated how much the JVM's GC relied on the compactor. Objects can only be created on the heap and object arrays are arrays of pointers to non-contiguous locations in memory. Many like to say that Java has better GCs than Go, but that's because Go's memory model doesn't require such complicated GCs. It's also nice to have pointers in Go.

  • More paradigm-neutral. Java was designed from the beginning to be a language primarily for OO programming. Using Java for functional programming results in unnatural syntax and inefficient use of memory. Golang feels ambidextrous.

I'm still very new to Golang but as of right now, I even see it as a replacement for Node and Python in the areas of scripting and web server development. Golang's fast compile time closes makes it competitive against interpreted languages in terms of development speed, but 1-ups these languages because it gives the developer more low-level control of memory and has static typing.