Terrible tips that sharpen your C++ coding skills

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Anastasiia123
    New Member
    • Jul 2023
    • 1

    Terrible tips that sharpen your C++ coding skills

    I’ve recently found a very interesting collection of terrible tips for C++ developers. Yes, that's right, they are terrible! And the coolest thing is that the book is both useful and entertaining.

    Here are some examples from the book that made me smile:
    • Real developers code only in C++!
    • Disable compiler warnings. They distract from work and prevent you from writing compact code.
    • Use invisible characters in your code. Let your code work like magic. That's cool.
    • All old books recommend using int type variables to store array sizes and to construct loops. Let's keep it up! No reason to break with tradition.
    • Undefined behavior is just a scary bedtime story for children. Undefined behavior doesn't exist in real life. If the program works as you expected, it doesn't contain bugs. And there's nothing to discuss here, that's that. Everything is fine.
    • Never test anything. And don't write tests. Your code is perfect, what's there to test? It's not for nothing that you are real C++ programmers.

    Of course, this is just sarcasm. Al the ″tips″ originate from the real-life cases and I liked it. To summarize, this mini-book is informative, entertaining, and easy to understand.

    Book - https://pvs-studio.com/en/blog/posts/cpp/1053/
  • Rina0
    New Member
    • Jul 2023
    • 13

    #2
    I agree, that sounds like a very entertaining and informative book! It's always good to have a laugh at the expense of bad practices, and it sounds like this book does a good job of that.

    I also like that the book is based on real-life cases. This makes it more relatable and believable, and it also helps to show the consequences of following these bad practices.

    Overall, it sounds like a great resource for C++ developers, whether you're a beginner or an experienced pro. I also agree with your point that it is important to test your code. Even if you think your code is perfect, it's always possible that there are bugs lurking in there. By testing your code, you can help to catch these bugs early on and prevent them from causing problems down the road. Here is another resource that you might find helpful.

    Comment

    • dricne
      New Member
      • Sep 2023
      • 1

      #3


      Polycarbonate is a versatile and durable thermoplastic material that is commonly used in various industries and applications due to its unique properties. Here are some key characteristics and uses of polycarbonate:

      Transparency: Polycarbonate is known for its excellent optical clarity, making it a popular choice for applications where transparency is essential. It is often used in the production of eyeglass lenses, safety goggles, and clear windows.

      Comment

      • Oralloy
        Recognized Expert Contributor
        • Jun 2010
        • 988

        #4
        Hello Anastasiia123,

        Perhaps you ought write a book called C++ worst practices.

        My "best" practices include enabling all warnings and treating them as errors.

        Four people tried to get me fired for that. I was creating errors in their code. . .

        Let us embrace the worst, it is for the best.

        [snip - rant about success oriented programming]

        Cheers,
        Oralloy

        Comment

        Working...