• merthyr1831@lemmy.world
    link
    fedilink
    arrow-up
    45
    arrow-down
    2
    ·
    8 months ago

    If C++/C were real languages for real programming they’d enforce this in the compiler.

    No sane language designer would say “it is imperative that you do not implement your class in its header file” then write a compiler designer to say “oh you implemented your code in the header file? lol lmao that rocks”

    They have played you all for fools.

    • SubArcticTundra@lemmy.ml
      link
      fedilink
      arrow-up
      19
      arrow-down
      1
      ·
      8 months ago

      I actually like how much freedom C++ gives you. As long as it is fed valid code, it does not give a fuck about how you choose to structure your project

      • tyo_ukko@sopuli.xyz
        link
        fedilink
        arrow-up
        2
        ·
        8 months ago

        That freedom becomes misery on the instant you have to start maintain the code from some other free spirit, whose style is totally different from yours.

    • Lauchmelder@feddit.de
      link
      fedilink
      Deutsch
      arrow-up
      5
      ·
      8 months ago

      not saying it’s good design, I ditched C++ long ago. at least the C++20 modules API is gonna fix this, right guys?

    • stingpie@lemmy.world
      link
      fedilink
      arrow-up
      1
      arrow-down
      5
      ·
      8 months ago

      If C++/C were real languages for real programming they’d enforce unreadability in the compiler.

      No sane language designer would say “It is imperative that you write the most unreadable code possible” then write a compiler that says “oh your code doesn’t triple dereference pointers? lol lmao that rocks”

      They have played you all for fools.