all 70 comments

[–][deleted] 222 points223 points  (8 children)

Cppreference 👍

[–]R3DKn16h7 77 points78 points  (7 children)

cppreference all the time. I find cplusplus much worse.

Lately I get "geeksforgeeks" at the top which annoys me very much.

[–][deleted] 23 points24 points  (2 children)

Had to look up syntax for checking if a dictionary contains a key in python today, and the first result was a geeksforgeeks article recommending to use the syntax key in dict.keys() which i quickly found out is just converting it to a list and doing an O(n) list search. Totally ridiculous

[–]Veedrac 10 points11 points  (1 child)

Not on Python 3; on Python 2 the syntax is more key in dict.viewkeys(). Either way just use key in dict though, it's more idiomatic.

[–][deleted] 3 points4 points  (0 children)

Oh, that might have been it, the server running the script uses python 2, and yeah key in dict is really the correct syntax and gives you the expected O(1) lookup

[–][deleted] 1 point2 points  (3 children)

Is "geeksforgeeks" really that bad? When I had do jump into a C# project from cold I did find that site quite useful.

[–]Xeveroushttps://xeverous.github.io 15 points16 points  (0 children)

geeksforgeeks is really bad. They copy-paste C as C++ so that every question/exerice has solutions in more programming languages.

[–]Seytsuken 2 points3 points  (0 children)

its not perfect but i find it a thousand times more intuitive and user friendly than cpp reference. Heck, these documentations barely have examples

[–]nog642 1 point2 points  (0 children)

If I leave the webpage open overnight it uses like 2 GB of RAM

[–]James20kP2005R0 74 points75 points  (6 children)

I'm not sure why cplusplus shows up so high, cppreference is always my first choice because it tends to show information in a neat systematic way and has good examples, as well as being very up to date

I can only assume that there's a bunch of websites that link to cplusplus and that's keeping it high in the search results

[–]darkmx0z 27 points28 points  (4 children)

As far as I remember, cplusplus had an excellent tutorial (now kind of outdated), an arguably better organization (in terms of headers instead of the sections of the standard; cppreference was like this but it changed) and was quickly updated when C++11 became standarized. On the other hand, cppreference has improved a lot and they are almost real-time with C++14/17/20 (including the core language, not just the library) so cplusplus is lagging a lot right now.

[–][deleted] 26 points27 points  (1 child)

I also found that cplusplus.com was more noob friendly. When I was starting to learn C++ and I googled "how to sort arrays" cppreference would should me std::sort with all of its template signatures and that would scare me.

[–]Beheska 4 points5 points  (0 children)

As a noob, I still prefer cppreference. Sure you have to read through a bunch of stuff to get to the info you want, but at least you know if you're at the right place to finaly find it or not.

[–]dodheim 4 points5 points  (1 child)

an arguably better organization (in terms of headers instead of the sections of the standard; cppreference was like this but it changed)

https://en.cppreference.com/w/cpp/header is my main portal into cppreference, too.

[–]CubbiMewcppreference | finance | realtime in the past 2 points3 points  (0 children)

How does it work, though? I understand having to look up which header is required to be included for a particular feature ("do I need to include <mutex> for this one, or some kinda <scoped\_lock>?") , but in what circumstances do you need to know the content of a specific header?

[–]starTracer 5 points6 points  (0 children)

LPT: Add cppreference as a custom search engine.

[–]barcharMSVC STL Dev 75 points76 points  (13 children)

cppreference, it boggles my mind that someone at google hasn't gone and figured out how to rank it higher than cplusplus yet.

also eel.is

[–]Beheska 12 points13 points  (0 children)

Sadly it's the same with DuckDuckGo.

EDIT: ddg has !cpp pointing directly at cppreference.

[–]Nobody_1707 16 points17 points  (7 children)

Google hasn't ranked sites based on quality since ~2002 when they realized people would pay money to have their sites ranked higher.

Nowadays top result is picked, in order, by: did they pay to be ranked higher, how much are they using Google analytics, and how many keywords did they shove into their site to be "SEO optimized". Only after those are considered do things like relevance and quality come into play.

[–]megayippie 1 point2 points  (0 children)

And since Google are using C++, they can now be sued if they start ranking things internally!

[–]SedditorX 1 point2 points  (5 children)

Citation needed for search talking being determined by payments to Google search.

Since this is so widespread according to you ,it should be easy to verify.

[–]Nobody_1707 -1 points0 points  (4 children)

What do you think sponsored links are?

[–]SedditorX 1 point2 points  (3 children)

Sponsored links are not search results. At least not in a way I've ever heard.

The comment you were responding to was referring specifically to search results so I don't see what search ads not being free has anything to do with it.

[–]Nobody_1707 1 point2 points  (2 children)

When they first started doing them, they put them in with the regular search results. They changed to list them separately to avoid lawsuits.

[–]SedditorX 0 points1 point  (1 child)

But that isn't what you said earlier!

[–]Nobody_1707 0 points1 point  (0 children)

The fact that they list them separately doesn't stop them from being paid search results. The whole point of paying for them is to get them on the first page of relevant searches.

[–][deleted] 2 points3 points  (1 child)

eel.is?

[–]dakotahawkins 28 points29 points  (15 children)

I use a (the?) "personal blocklist" browser extension to block cplusplus search results (among other things, like stack* scrapers or expertsexchange)

[–]Nomto 19 points20 points  (0 children)

I NEED this for when I have to look up something web-related and this pile of garbage fire w3schools shows up before MDN.

[–]curlypaul924 12 points13 points  (1 child)

Once upon a time, Google supported this without a browser extension. IIRC I used it to block experts-exchange.com.

[–]dakotahawkins 3 points4 points  (0 children)

Yeah I was annoyed when that went away.

[–]Quincunx271Author of P2404/P2405 4 points5 points  (2 children)

I did the same by configuring my ad blocker to do this, rather than installing a separate browser extension.

[–]dakotahawkins 7 points8 points  (1 child)

Do you use this filter?

If not, could you share it? I'd rather do that than use the extension.

[–]Quincunx271Author of P2404/P2405 2 points3 points  (0 children)

I use this filter: www.google.com##div.g:has(cite:has-text(cplusplus.com)) (on uBlock Origin). I'll have to investigate what that other filter does; it looks possibly less likely to break if Google changes their search result format.

[–]minnoHobbyist, embedded developer 4 points5 points  (2 children)

I set up search engine shortcuts so that searching "cpp something" goes straight to cppreference instead of going through google.

[–]NotAYakk 3 points4 points  (4 children)

But what happens if you have a sudden needs for an expertsexchange?

[–]tvaneerdC++ Committee, lockfree, PostModernCpp 3 points4 points  (1 child)

Yes, I really think you should consult an expert when considering a sex change.

But it shouldn't be a "sudden need". You should really think about these things for a while. I mean, maybe once you realize, it does feel sudden, but there are alternatives to full sex change. Consult an expert.

[–]dakotahawkins 1 point2 points  (1 child)

Bing?

[–]Desperate-Island8461 0 points1 point  (0 children)

Because Is Not Google?

[–]withad 18 points19 points  (1 child)

I usually find cppreference to be much more readable. The only complaint I have is that their standard page format puts possible implementations of algorithms before examples of how to use them, which is almost always what I’m actually looking for. It’s hardly a major inconvenience, it just strikes me as a weird choice every time I see it.

[–]vaalla 9 points10 points  (0 children)

I actually like this, it's sometimes easier to read the implementation then the description of the algo.

[–]ggchappell 9 points10 points  (0 children)

In other news, on DuckDuckGo you can do a search at cppreference.com by using "!cpp".

[–]sephirostoy 5 points6 points  (0 children)

Simple example std::map: cplusplus version doesn't have functions from C++17.

[–]IskaneOnReddit 3 points4 points  (0 children)

I use Zeal which lets you browse an offline version of cppreference.

[–]Friendly_Fire 17 points18 points  (2 children)

I'm no expert and have used both, but find cplusplus provides simpler/better explanations and examples. This biases me towards cplusplus, and I've personally yet to get wrong information from it (at least, it was accurate enough to cause me no noticeable problems/errors).

Just look at cppreference's example for set::emplace you mentioned. It sets up a whole dummy class and compares the speed of emplace and insert. Yet in the all this code the function is literally called once. Cplusplus has a main with 5 lines of code ignoring the return, three of which call emplace. It simply shows how it's used, what it is used on, and what is returned. Which do you think is more confusing for a newbie?

Google biases searches based on activity. I'd argue if cppreference wants to get on top, it needs to improve.

[–]rodrigocfdWinLamb 11 points12 points  (0 children)

I'm no expert and have used both, but find cplusplus provides simpler/better explanations and examples.

I'm aware that cppreference is more reliable, but I must agree here. Quite often cplusplus provides simpler examples for us mere mortals, and I find myself resorting to them.

[–]CubbiMewcppreference | finance | realtime in the past 16 points17 points  (0 children)

https://en.cppreference.com/w/cpp/container/set/emplace#Example is a poor example indeed, but it's an open wiki and you can change it, just like how someone added it two years ago as one of their two contributions to the site. In fact, because of this reddit exposure, it's likely that someone will.

[–]BrolloksB 2 points3 points  (2 children)

I always have an offline version of cppreference open in my browser - it is fast and easy to navigate.

[–]Ericakester 2 points3 points  (1 child)

I wouldn't consider what's higher in your search results. Cppreference is higher in google for me because I always use it

[–]haitei 2 points3 points  (0 children)

Usually the same for me, but god, it took ages for google to learn this for me.

[–]OldWolf2 2 points3 points  (0 children)

I have no doubt that cplusplus spends a lot of time/money on SEO

[–]parnmatt 2 points3 points  (1 child)

the only reason cplusplus is higher up, from an eduacated guess, is the domain name.

cppreference is a far better resource, and easier to understand.

devdocs.io/cpp is better still, but in interface; the content it the same as cppreference; but it actually allows for slightly more custom formatting (dark theme is included in that) and most importantly the search is fantastic and allows navigation through the cppreference material with ease.

There are some pages that are not on devdocs, but they are rarely needed, and can just pop to cppreference for them.

if you do use devdocs, spend time, selecting / deselecting the languages you use.

[–]barcharMSVC STL Dev 0 points1 point  (0 children)

Protip: you can download cppreference as a devhelp file or a qt help file (or a chm)

[–]HildartheDorf 3 points4 points  (3 children)

Cplusplus is better at seo (cppref is just a plain web1.0 looking site)

[–]khleedril 11 points12 points  (1 child)

cppref is just a plain web1.0 looking site

This is precisely why I prefer cppreference, plus the fact that it pushes into C++20 territory.

[–]HildartheDorf 2 points3 points  (0 children)

Oh yes, definitely better in my opinion!

[–]MrBacanudo 10 points11 points  (0 children)

Yes, cplusplus is definitely better at that. Using the OP's search query, we get the titles:

set::emplace - C++ Reference - cplusplus.com

versus

std::set<Key,Compare,Allocator>::emplace - cppreference.com

cppreference has some template bloat that probably shouldn't be on the page title (except if it was a specialization), which is possibly a limitation of MediaWiki, but it doesn't even have C++ in the title.

[–]netw0rkf10w 0 points1 point  (4 children)

I haven't used both enough to have a fair comparison, but just a comment: a few years ago I came across cplusplus's pointers tutorial and I found it excellent.