> Heap Memory - new, delete Keywords Should "modern" C++ even use new/delete? I'm a C++ n00b, but I thought these can be avoided entirely now.
Modern C++ Programming Course
101–110 of 221 posts
Re: Modern C++ Programming Course
#102Earlier quoted context omitted.
Mozilla is not “one of the biggest proponents of Rust” anymore, in that other, larger entities are now as well. Rust is at the center of many products, large and small. That doesn’t mean that C and C++ aren’t also large, even larger, but this has been changing for years and only shows signs of accelerating, not slowing down.
The size difference is like Sutter Buttes versus Mahalangur Himal, so unless it's accelerating at the speed of light, C++ will be dwarfing rust's usage for many years to come. This is the umpteenth time large tech companies have sponsored C++'s successor. Go was famously created to eventually supplant C++ at Google (or more specifically, solve the issue of long build times). Over a decade later, C++ is very much stil…
I agree with you that this is not the first time languages have tried to encroach on the last bastions of the spaces where C and C++ have not yet been ousted as the default choice, but Rust is actually gaining traction in production use-cases in those spaces, unlike many of those languages.
Re: Modern C++ Programming Course
#103Earlier quoted context omitted.
> Does it make sense to still invest time to learn C++ when Rust exists? Yes. The overwhelming majority of industry is using C/C++. Rust is still very much niche when compared to the overall market. Additionally, (Someone can correct me if this is wrong) IIRC, mozilla, was initially one of the biggest proponents of rust, but still just uses rust in a supplementary role. C++ still powers the heavy lifting.
Thank you!
Re: Modern C++ Programming Course
#104[flagged]
Genuinely asking: Why many programmers need tools to enforce something upon them? Why not they can't take slow, be mindful about what they write and add a couple of layers as pre-commit hooks? Like a code formatter and maybe a linter? This makes me sad. Programmers have the knowledge base to make some of the most sophisticated things bend to their will, and they tell a programming language is bad, because they can ma…
You can always count on the threads about C or C++ to have somebody ask questions like this.
As a hint, you won't see it asked on any other context. The answer is "all", no exceptions. It's widely known. For decades. In fact, C wasn't even universally used when people discovered this.
Re: Modern C++ Programming Course
#105There are at least a dozen C++ intros that go through every little detail like this and I don't get it. I have a pretty good ability to retain a lot of information presented this way, and I've been programming in various C-like languages for long enough that much of this isn't new to me, but this doesn't seem like a good way to learn the material. I'd much rather work through actual programs and iterate on them. I im…
I agree with your grievance: Many c++ tutorials are basically like: these are the internal workings of how the graphite in a pencil is structured, now go draw the rest of the owl. I am not saying that this isn't important, but learning about pointers and references is totally useless unless someone shows you why you would use them, where you would use them etc.
Re: Modern C++ Programming Course
#106Re: Modern C++ Programming Course
#107Earlier quoted context omitted.
Does Carbon or c++next fix the ootb handling?
It's being actively worked on for C++2x. This video is a fairly recent update on how it's progressing: https://www.youtube.com/watch?v=AoLl_ZZqyOk Note for those who are not used to C++Now talks: they are intented to be a bit more informal with regular interjections from the audience (who at C++Now are also often heavily involved in the development of the C++ standard), so don't think people are being rude by jumping…
Re: Modern C++ Programming Course
#108It is surprising how many people look surprised (that also claim they know the language) when you tell them that code in .cpp does not get inlined into other .cpp files no matter what doing compilation. (yes the linker can (and should) do that with LTO doing linking)
Re: Modern C++ Programming Course
#109One thing that would have helped me when I started learning C++ was learning the C++ compilation model i.e. translation units. It is surprising how many people look surprised (that also claim they know the language) when you tell them that code in .cpp does not get inlined into other .cpp files no matter what doing compilation. (yes the linker can (and should) do that with LTO doing linking)
Re: Modern C++ Programming Course
#110 Implicit type conversion rules, applied in order, before any operation: ⊗: any operation (*, +, /, -, %, etc.)
(A) Floating point promotion
floating type ⊗ integer type → floating type
(B) Implicit integer promotion
small integral type := any signed/unsigned integral type smaller than int small integral type ⊗ small integral type → int
(C) Size promotion
small type ⊗ large type → large type
(D) Sign promotion
signed type ⊗ unsigned type → unsigned type
Edit: oops, I missed the explainer. The ⊗ stands in for any operator in case that was confusing to anyone else who missed it. :-)