Live data from Hacker News

C++ Cheat Sheets

hackingcpp.com

71–80 of 82 posts

Re: C++ Cheat Sheets

#71

Also, if you do not use Dash or an open source implementation like Zeal[1] (which is what I use), you are missing out. The supplied C++ docset comes from cppreference.com and is very, very useful to have to hand. The Python and CMake docsets are also particularly useful to me. [1] https://zealdocs.org/

A similar, online version: https://devdocs.io/

Re: C++ Cheat Sheets

#72

Also, if you do not use Dash or an open source implementation like Zeal[1] (which is what I use), you are missing out. The supplied C++ docset comes from cppreference.com and is very, very useful to have to hand. The Python and CMake docsets are also particularly useful to me. [1] https://zealdocs.org/

Is it worth paying the $30 for Dash? Zeal crashes one me every now and then.

Re: C++ Cheat Sheets

#73
post #2

Wow, this is really good, there are still things I can learn. C++ really has a lot of good things. It's just a shame it's so slow to compile. I'm curious if anybody is working to make C++ faster to compile. Even if it was a subset of the language, with some features removed, it would be good enough for me.

> I'm curious if anybody is working to make C++ faster to compile. Yes - C++20 added support for modules to the Core Language (both "header units" and "named modules"; header units are an intermediate step between classic includes and named modules), and support for header units to the Standard Library. Compiler/library support is a work in progress (MSVC's STL, which I work on, is the furthest along - see https://gi…

Wow, thanks, can't wait for this.

How hard will it for library writers to supply their libraries as modules?

Will the only requirement be to remove macros?

Re: C++ Cheat Sheets

#74

Probably semi related, but when I was looking at C/C++ job offers, why are they paid so little in comparison to Python or JavaScript? It seems like C/C++ is much more complex. I was mainly looking at embedded stuff vs Web. For example senior C++ role was paying £45k pa on average and over £60k for JS.

This is more a function of the sector. Embedded just does not pay as much as web ATM.

FAANG and FAANG-adjacent companies will pay way more than that for a senior C++ developer in London (they will also pay more for a web developer).

And of course there is the City.

The actual salaries are unfortunately usually not advertised.

Re: C++ Cheat Sheets

#75
post #43

Quoted post unavailable.

What are you talking about exactly ? I don't see anything in there that wouldn't be great for any language. E.g. knowing complexity bounds, random distributions... Those are things you need to know when you program, before even writing a single line of code. Surely you agree that the same slide ( https://hackingcpp.com/cpp/std/sequence_containers.png ) for any JVM or CLR language would be much longer ?

In fact, similar kind of information would be welcomed in any programming language.

Re: C++ Cheat Sheets

#76
post #32

Earlier quoted context omitted.

Is clang still faster? I thought it had slowed down in the past decade and was now worse than GCC.

For my own projects at least it is, by 10-20%

to give a very flagrant example on a project that i am currently working on:

- GCC 11 build: 4m20 (https://github.com/celtera/avendish/runs/5449993123?check_su...)

- Clang 14 build: 2m40 (https://github.com/celtera/avendish/runs/5449993033?check_su...)

Re: C++ Cheat Sheets

#78
The sizeof(variant) example is wrong. An extra byte is needed to store the discriminator value, which in practice results in 8 extra bytes for these particular types because of alignment. https://godbolt.org/z/vno3v9rPK

The tuple drawing is also somewhat misleading, because the first box (int) should be the same size as the second one (double), due to alignment.

Re: C++ Cheat Sheets

#79
post #70
post #67

Earlier quoted context omitted.

It has been literally decades since I last encountered it. In any case the title has exactly nothing to do with job listings or what may be inferred from them.

Ok, lets get job listings then, from companies whose staff seat at ISO C++. "Senior C/C++ Software Engineer" @ NVidia https://nvidia.wd5.myworkdayjobs.com/en-US/NVIDIAExternalCar... "Senior Software Engineer" @ Microsoft https://careers.microsoft.com/us/en/job/1152962/Senior-Softw... > Experience using scripting languages such as bash, Python, and PowerShell, or compiled languages such as C/C++, C# and Go are most re…

So, you are saying that clueless HR people are employed at such very large companies as NVidia, Microsoft, Google, Apple, IBM, AMD, and ARM? I'll bet you can find cigarette smokers working in them, too. And Russian Empire sympathizers.

If you ever had a point, you lost it some time ago.

Post reply on HN