Live data from Hacker News

Modern C++ Programming Course

github.com

101–110 of 221 posts

Re: Modern C++ Programming Course

#102

Earlier 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 certainly do not disagree that C and C++ will be in general usage for a long time, if not forever. However, because the industry is still growing, the proportions change, even as the total number grows in size. C and C++ do not have to die, or even shrink, to become a smaller part of the overall pie, and Rust does not need them to outright die in order to grow and thrive.

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

#103

Earlier 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!

It really depends on your career goals and whether you're doing greenfield or maintenance coding. If you want to be part of the "new generation" of tech, learn Rust. If you want job security, dont care about doing anything glamorous or exciting, and don't mind a long learning journey, go with C++. It will always be around and it's hard enough to learn that you won't have as much competition.

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…

> Why many programmers need tools to enforce something upon them?

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

#105
post #98

There 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.

I think Kate Gregory makes similar good points about the structure of C++ learning materials here:

https://www.youtube.com/watch?v=YnWhqhNdYyk

Re: Modern C++ Programming Course

#107
post #34

Earlier 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…

[dead]

Re: Modern C++ Programming Course

#108
One 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

#109

One 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)

This also helps understanding why template code completely wrecks compiletimes and ram usage since the compiler cant share template instantiations. This becomes very relevant if template metaprogramming is used in bigger projects.

Re: Modern C++ Programming Course

#110
Can someone explain how to read the Conversion Rules section in the second chapter? I haven't seen this style of notation before. For example:

    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. :-)
Post reply on HN