Fifteen-layer pointer pyramid: how Java devs imagine every C/C++ session
Description
Large black text on white reads "What Java devs think C/C++ devs do". Below, a dark-theme editor tab titled "vim" shows C++ code forming a ridiculous star pyramid: #include <iostream>, int main(){, int p0 = 45;, int * p1 = &p0;, int ** p2 = &p1;, int *** p3 = &p2;, int **** p4 = &p3;, int ***** p5 = &p4;, int ****** p6 = &p5;, int ******* p7 = &p6;, int ******** p8 = &p7;, int ********* p9 = &p8;, int ********** pa = &p9;, int *********** pb = &pa;, int ************ pc = &pb;, int ************* pd = &pc;, int ************** pe = &pd;, int *************** pf = &pe;, std::cout << ***************pf << std::endl;, return 0;, }. Each successive declaration adds another asterisk, culminating in a 15-level pointer that is finally dereferenced for output. The meme satirises the perception that C/C++ developers constantly wrestle with extreme pointer indirection while Java developers enjoy garbage-collected safety
Comments
17Comment deleted
Fifteen levels of * is scary until you remember your Spring front-end → API gateway → service mesh → twelve microservices → Hibernate → DB call chain has more indirection than that
This is what happens when you tell a Java developer that C++ doesn't have garbage collection - they assume we're manually tracking 19 levels of indirection for every integer, probably while debugging with gdb and crying into our undefined behavior documentation
This perfectly captures the Java developer's nightmare vision of C++ - a Kafkaesque descent through fifteen levels of pointer indirection, as if we're manually implementing garbage collection one asterisk at a time. In reality, seasoned C++ engineers know that anything beyond a triple pointer usually means you've either discovered a novel data structure or should seriously reconsider your life choices. Meanwhile, Java devs are blissfully unaware that their JVM is doing pointer arithmetic behind the scenes anyway - they've just outsourced the segfaults to Oracle
Fewer derefs than our Kubernetes YAML indentation, but twice the crash potential
Fifteen layers of indirection: the C++ answer to “add another abstraction layer” - cout eventually finds 45; your pager finds you when a single & goes missing
Java devs think C++ is “count the asterisks until it prints”; veterans know the real work is deleting indirection so the cache stays warm, ownership is RAII-clear, and UB doesn’t wake you at 2 a.m
What C++ actually do: std::unique_ptr<int> p0 = new int(45); Comment deleted
Why would you use new operator with smart pointers? Comment deleted
And for this meme it's more like: std::shared_ptr<int> ptr = std::make_shared<int>(45); And sharing it with other shared pointers. Comment deleted
auto p0 = std::make_unique<int>(45); Comment deleted
but they do Comment deleted
I've told my child that if he behaves badly, a c++ developer will reinterpret_cast him! Comment deleted
Multi-dimensional arrays are shit Comment deleted
they can be useful Comment deleted
It's true tho Comment deleted
int p0 = 42; int * p1 = &p0; @@@ std::unique_pointer<int> p0 = new int(42); @@@ std::shared_pointer<int> p0 = make_shared<int>(42); @@@ auto p0 = std::make_unique<int>(42); @@@ C++ in a nutshell Comment deleted
https://bartoszmilewski.com/2013/09/19/edward-chands/ Comment deleted