Skip to content
DevMeme
2447 of 7590
Languages Post #2720 · source on Telegram

C++ and the US Constitution: A Shared Legacy of Foot-Guns

Description

The image is a screenshot of a conversation on a forum, likely Reddit, presented in a light theme with black text. There are two comments. The first comment, from user 'nnamtr', draws a detailed analogy between the C++ programming language and the Constitution of the United States. It points out that both were developed long ago, have many oddities, and accumulate new features (amendments) without removing old ones, yet remain important and groundbreaking. The user expresses a preference for living in a European country and programming in Rust, suggesting both have learned from the mistakes of their predecessors. The second comment, from user 'zesterer', adds a witty punchline to the analogy: 'Also, they both enshrine in law the right for people to blow their own feet off with automatic weapons.' The technical humor stems from the clever and layered analogy. For experienced developers, C++ is known for its power and performance but also for its complexity and lack of safety features, such as manual memory management, which makes it easy for programmers to introduce critical bugs - a concept often referred to as 'shooting yourself in the foot.' The reply brilliantly connects this technical term to the Second Amendment of the U.S. Constitution, creating a sharp, insightful joke that resonates with senior engineers who understand the history, trade-offs, and design philosophies of systems programming languages like C++ and Rust

Comments

10
Anonymous ★ Top Pick C++ gives you a firearm, Rust gives you a firearm with a safety manual written by three different committees, and Java gives you a water pistol that you have to request from the `AbstractWaterGunFactory`
  1. Anonymous ★ Top Pick

    C++ gives you a firearm, Rust gives you a firearm with a safety manual written by three different committees, and Java gives you a water pistol that you have to request from the `AbstractWaterGunFactory`

  2. Anonymous

    Modern C++ is basically constitutional law: we keep adding smart-pointer precedents, but the Second Amendment still guarantees every raw pointer the right to bear segfaults

  3. Anonymous

    The only difference between C++ and the US Constitution is that when C++ shoots you in the foot with undefined behavior, at least you can blame the compiler instead of the founding fathers

  4. Anonymous

    The comparison is spot-on: both C++ and the US Constitution let you exercise your freedom to create undefined behavior, and both communities will defend to the death your right to segfault in ways the founders never imagined. Meanwhile, Rust is like a parliamentary system with a borrow checker - sure, it's more restrictive, but at least the compiler catches your constitutional violations at compile-time instead of letting you discover them in production at 3 AM

  5. Anonymous

    C++ enshrines your Second Amendment right to bear wild pointers - just don't dereference unless you enjoy self-inflicted segfault surgery

  6. Anonymous

    Backward compatibility is the Second Amendment of C++ - the footgun stays legal forever; Rust puts it behind an unsafe permit and a borrow-checker background check

  7. Anonymous

    Modern C++ is constitutional law: we keep passing std::amendments, yet backward-compat precedent still protects the right to bear footguns - dangling pointers, reinterpret_casts, and UB; Rust is the rewrite that finally outlaws them

  8. @nuntikov 5y

    C++23 will actually remove one entry from C++11 standard. "Garbage collection and reachability based detection". Look it up

    1. Deleted Account 5y

      yoo they removed noop

      1. Deleted Account 5y

        they actually removed auto_ptr some time ago

Use J and K for navigation