4 ms·
I agree with you. I am doing a lot of coding in Go for my multiplatform home projects and C/C++ at work 8 hours per day. Go brings faster results due to the re
by stiray 6y ago
I agree with you. I am doing a lot of coding in Go for my multiplatform home projects and C/C++ at work 8 hours per day.
Go brings faster results due to the really great and easy to integrate 3rd party libraries. There is literally no way that I would go for such a large number of third party dependencies with any C++ software - it is just too much work to prepare the libraries for use.
The amount of thinking to make Go programs run fast and with low memory fingerprint is about the same as C++ with a huge minus that you dont have a delete/free keyword that designates "now the memory is de-allocated". With go, you need to think hard, I would prefer GC language that has a deallocation keyword, so I can forget about everything I dont care about but still deallocate what I want in specific moment.
For me personally, the hugest difference of Go against C/C++ is the ecosystem and how simple is to use 3rd party libraries/modules/whatever.
- CyberDildonics 6y agoAre you actually using new and delete outside your own data structures? I have barely used new or delete for years, I don't even use them when building data structures - the vast majority of the time I make compound data structures out of what is in the standard library. It is only when memory layout needs to be very specific that I use new and even then it is placement new.
- usrnm 6y agoYou don't need to use delete explicitly to control the lifetime of objects in C++. A properly placed "}" or a call to something like .release() can be just as effective. The problem is, there is simply no way to do it in a GC language.
- CyberDildonics 6y agoI think you completely misunderstood what I wrote. I was asking the person I replied to why they needed to use new and delete.