(Bar sport) Do you Google C++ code to cut and paste?

When you're trying to apply some algorithm and are thinking maybe there is some code you could snatch for it, do you google C++ code to cut and paste? (do you literally put "c++" / "c++ example" etc into a google query), and try to find someone who has written exactly that code sample)?

I mean for esoteric sorts, filters, running averages, HyperLogLog, etc.

This question is without any value which is why it's in bar sport "Jokes, mobs, and all sorts of unrelated topics."

You should be looking at other peoples code. You'll learn a lot more, and faster. As not everyone thinks the same, you might see some solution you haven't thought of, or a concept which you have to go learn even more to understand.

Oh, and if you copy code, at least ensure you put a comment with it containing a link to the source of it, with the Authors name if applicable, so others can search for documentation and such.

Also remember, under copyright law, any code without a licence or copyright info is not usable. So if your Arduino hobby makes you a million, ensure none of the unlicensed stuff remains in your code.

I will take code from other places, but not as a blind copy and paste. I'll only use a piece of code if I can understand how it works and what each line does. If not, I'll study up before I take it. The surest route to disaster in coding is stitching together a bunch of code you don't understand.

No. If I am looking for randomly written code through Google (or whatever) I do not put c++ in the search terms. I use the word "arduino" instead. Now this may support your contention that "arduino" is a language onto itself, or at least a dialect. (yep, I suspect that you are a linguist) It does not.

The search term "arduino" will return sources that mention the term or that are closely associated with the term. As Arduino programs are written in C++, the results will heavily favor C++ code. Additionally the presumed hardware (as most projects are hardware projects, using software only as a necessary evil - well, maybe evil is too strong a term) of such a search will mostly be Arduino projects, that I can reproduce on my Arduino equipment without much trouble.

If there were a language that I could use, other than C++ for an uploadable, runable, Arduino sketch, then I would surely love to use it! (Just for you know, the thrill.) There is no reason it could not be done* but so far, I have not seen it.

*I am aware of Forth interpreters that can be loaded onto an Arduino board. I have not yet been successful in getting one of those to run in a way that I can use it.

I mean for esoteric sorts, filters, running averages, HyperLogLog, etc.

You might be surprised at how rare it is to actually use those sorts of things...
I spent essentially an entire career without using floating point.

If I want cut-and-paste code for an Arduino, I search for Arduino. For cut and paste, you need to be as specific about the target environment as possible. For example, there is GitHub - WestfW/ArduScan: ArduScan is a windows program that passively scans the COM ports on a system looking for ones that are likely to be Arduinos is C++ for windows that has some pretty-much cut&pasted code, and when I was searching for how it might be done, I sure as heck included "windows" in the search terms and not just C++ (clearly showing that it was written in "Windows system development language", and not "just C++"; I wonder why they bother calling it C++? :-; )

If I want an implementation of a fancy algorithm, I usually don't specify a language, nor do I expect cut-and-paste level code. This is one reason that someone who wants to be a "programmer" needs to understand several different languages.

curious48:
(do you literally put "c++" / "c++ example" etc into a google query)

No. I literally use "cplusplus" but only search for C++ source to check syntax or find standard library functions. I never c&p verbatim. When I can not get my head around an alogorithm, I will prototype in BASIC or Pascal and transcribe to C++ when I know what I am doing.