East const vs const West
two styles — both correct East const one consistent rule: What's left of const is constant. const West (still) more widespread, but less consistent int i = 1; int & r = i; int * p = &i; int const c = 1; int const& cr = i; // pointer to const int int const* pc = &i; // const pointer to int int *const cp = &i; // const pointer to const int int const*const cpc = &i; const int c = 1; const int& cr = i; // pointer to const int const int* pc = &i; int *const cp = &i; // const pointer to const int const int *const cpc = &i;
The meme compares two valid C++ styles for placing the const qualifier: East const puts const after the type, while const West puts it before the type. Both styles compile and mean the same thing, but the joke says the East style follows a more consistent rule, whereas the West style is more widespread but less consistent. It is used as a humorous reaction in programming discussions about C++ formatting and coding conventions.
C++ code / код на C++code comparison table / таблица сравнения кодаtext editor screenshot / скриншот текстового редактораconst qualifier / квалификатор constpointer / указательreference / ссылкаvariable declarations / объявления переменныхhighlighted text / выделенный текстleft column / левая колонкаright column / правая колонка
#c++#programming#программирование#coding style#стиль кодирования#const#pointers#указатели#references#ссылки#syntax#синтаксис#code formatting#форматирование кода#east const#west const#developer meme#мем программистов#reaction#реакция#comic#комикс#screenshot#скриншот#programmer humor#юмор программистов
- @ithueti / 4180 2021-05-24
- @right_wing_dev_squads / 3416 2022-02-06
- Type
- image
- Size
- 632×800 · 63.5 KiB
- Mood
- sarcastic, nerdy
- Language
- en
- Added