‹ BackHN Continuity

Thread

German Rheinmetall open-sources its Battlesuite connected weapon system protcol

284 points · 109 comments · summarity

  1. jjmarr · · focus · HN ↗
    Open the C++ example up and the first thing I see:

    ```cpp std::cout << "Received ReportCoordinateFrameSettings" << std::endl; ```

    Generally, I've heard `std::endl` instead of \n has bad performance because it forces the statement to print immediately. And because cout is guaranteed to flush anyways when the program ends, you're adding a delay for no reason.

    I wonder if there's something I'm not seeing that led to them adopting this rule. e.g. "abnormal program termination" caused by the weapon blowing itself up circumventing a buffer flush?

    1. gavinray · · focus · HN ↗
      The modern C++ idiom is std::println() anyways...

      <a href="https:&#x2F;&#x2F;en.cppreference.com&#x2F;cpp&#x2F;io&#x2F;println" rel="nofollow">https:&#x2F;&#x2F;en.cppreference.com&#x2F;cpp&#x2F;io&#x2F;println

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.