Tech Industry
15h
600
What is the minimum number of years you should spend at a company so that it doesn’t look bad?
Personal Finance
7h
868
Thank you AAPL and NVDA
Health & Wellness
Yesterday
991
Lasik cost
World Conflicts
12h
481
Israeli precision-guided munition likely killed group of children playing foosball in Gaza, weapons experts say
World Conflicts
10h
363
Why I Find Free Palestine Inspiring
People can’t get over this ancient language and just keep adding more shit on top. Did you know uint64_t exists because uint64 was already a “thing” on some compilers before becoming standard and so now millions of people have to add _t in millions of places. Yes you can typedef or whatever but no one does it because everyone knows uint64_t. This one example defines the entire problem with C++. Also, the language doesn’t have garbage collection so garbage collection is implemented using constructors/destructors with a wrapping type as objects go in and out of scope, so you end up with: std::vector>> persons; C++30 will no joke look like this:: std::optional>>> HelloWorld; std::main_threadSayHello>>> helloCall; “hello world” Like please dump this shit in the garbage already. All these artificial constructs are trying to do patchwork on foundations and contort the language into something it was never meant to be. So dumb. Java is shit but at least it is honest about it. The “high performance” meme of C++ is gone once you have to use vtable lookups for every virtual call on abstract types, and look into the heap for shared_ptrs, it basically becomes less readible Java at that point.
Funny to hear this from a googler. I think I only used shared pointers a couple of times there. I think Google does c++ right.
The Google recommendation is to always use unique_ptr and share raw references to it, which is comically dumb, but we all do it so it “works”. Google does not do c++ right, it does it in a super dumb and opinionated way, but is consistent about it so it “works.”
FB is much more... exciting... in this regard. You should come.
In the limit, "safe" C++ becomes Python... But yes, I used to be C++ hardcore fanboy. Then C++ 20 came and I just said f*ck it. It's too bloated now. They shoulda stopped at C++ 11. Maybe 17.
You may not like the execution of cpp20 features but cpp users were desperately asking for concepts, coroutines and modules for forever. Ranges seems to be a bit more of a "quality of life" upgrade though. * Does your company use templates extensively? Compiling and understanding heavily templated code is a nightmare without concepts. * Heavy use of templates in turn leads to a lot (and I mean a lot) of header files. This bloats up the compile times to the point where you can't even compile the code without a machine having 128GB ram. Modules are a welcome change to tackle this issue. * Do your servers use synchronous or asynchronous programming? Asynchronous programming with callbacks is so bad that it has its own term "callback hell". Please Google it. Coroutines provide a more natural program flow. Languages shouldn't just stop evolving. Instead, accept that industry C++ is well-suited only for expert and niche use and move on.
Anyone using rust on a daily basis?
I love rust but not all companies use that language since it is more difficult to find Rust developers.
I do. Absolutely love it.
I dunno, I've always found C++ to be more understandable than something like Scala. Also I'm glad it doesn't have garbage collection. I want to understand and have better control of my service runtimes, and not have nondeterministic pauses while things are cleaned up...
Isn’t it creating new jobs? Wasn’t that the reason to keep it this way?
There are actual valid use-cases for C++ (and its complexity) over something like Rust. Not everything is a conspiracy.
Obviously, was just joking as I use c++ on a daily basis. Keen on hearing though what use cases you can think of over rust please? How’s TRC btw, how your code base looks like? Lot’s of legacy and mess?
If VTables are a problem, just don't a lot of inheritance? C++ has a million different ways to do the same thing - some of which are very fast.
Easier said than done People use to believe OOP was the best way to do everything. Now you have a bunch of objects running around in your legacy code. You can re-architect it (sacrifice developer time) or you can just inherit stuff (sacrifice perf). Either way it's costly, but one takes less time to implement.
"Has a" vs "Is a" paradigm is a simple solution and allows you to continue using existing objects. Much easier to follow imo too. C++ is nice because it can be fast but it's also versatile. It's like a grab bag of a bunch of languages all put together, and it's possible to cobble something that works well out of it.
Not having garbage collection is one of C++'s strengths. It allows developed to choose when to destroy things explicitly rather than have it occur at random times. They also leads to much more tonight about creating fewer objects (still not enough imo) and leads to more efficient code.
And to be fair you could add a garbage collector if you wanted. I've built one.
I do not think OP understand C++ at all.
It's better than having to explain to your boss why you can't lower the p99.9 latency = 5 second due to garbage collection.
GO is supposed to be as fast as C++ and more readable right?
the automatic garbage collection overhead of GO means it cant be as fast as c++ in most cases
Go is not more readable. People botch structs to try to do OOP and end up with a ton of global state. Theres also a ton of memory overhead for goroutines. Go works for like 5k LOC services that only have to do one thing, like writing to or reading from a database. That is all it is used for.