Naming variables and arguments

I rewatched recently a C++ conference video:

CppCon 2018: Kate Gregory “What Do We Mean When We Say Nothing At All?”

Then I did some research and posted a comment which YouTube decided to remove because it detected “Spam, deceptive practices, & scams policies” violation.It didn’t provide any detail, or a way to check what the comment was or appeal the removal. Nice! I was only able to find out which comment it was by looking at my Your YouTube Comments history and see which comment was NOT there (you have to rely on your memory, because there is no mark that a comment was deleted, or when, on which video…). I will try to reproduce it from memory here (because I cannot find it anywhere), I’ll let the reader decide it it was spam, scam or not:


It’ not enough to name your arguments, the names have to be meaningful.
In 2023 we still have this:

  • const char * strstr ( const char * str1, const char * str2 );
    thanks cplusplus.com ! WTF is str1 and str2? And this is the 1st result on Google (I mean duckduckgo.com)
  • char *strstr(const char *haystack, const char *needle) tutorialspoint.com has it right
  • char *strstr(const char *str,const char *strSearch); so does learn.microsoft.com
  • char *strstr (const char *s1, const char *s2); geeksforgeeks.org can F*** right off
  • char *strstr( const char *str, const char *substr ); cppreference.com does it well
  • char *strstr(const char *string1, const char *string2); IBM can also go to hell
  • char *strstr(const char *s1, const char *s2); so do pubs.opengroup.org

Yay, at least they all name the arguments. Are we happy now?
Well, actually not all, this is what newlib has to say about this:

  • char *_EXFUN(strstr,(const char *, const char *)); 1 or
  • char *strstr (const char *, const char *); 2

Good luck to my fellow embedded developers!

How are junior programmers supposed to name arguments right when this is what they learn from the big guys?

And contrary to what cplusplus.com says, strstr returns a NON const pointer from 2 const pointer. Congratulation!

We are all doomed!

[1] github.com/eblot/newlib/blob/master/newlib/libc/include/string.h
github.com/32bitmicro/newlib-nano-1.0/blob/master/newlib/libc/include/string.h
[2] sourceware.org


… and I understand why YouTYube might detect the “excessive” domain name usage and a couple of links as spam, but FUCK them too for removing my educational comment without providing: 1/ any means to see the comment they have an issue with; 2/ recover a copy; 3/ appeal to restore it… Meanwhile leaving trash comment up and letting actual scams trough!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.