473,418 Members | 2,047 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 473,418 developers and data experts.

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/
Jul 3 '23 #1
3 19272
Rina0
13 Byte
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.
Sep 5 '23 #2
dricne
1 Bit
https://polykart.co/product-category...polycarbonate/

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.
Sep 11 '23 #3
Oralloy
988 Expert 512MB
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
1 Week Ago #4

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Eakin, W | last post by:
Unlike a coding question, which may have a definite answer, this deals more with opinion. As I continue my studies of PHP and MySQL, and get to the point of being able to use them in a work...
3
by: Raed Sawalha | last post by:
I've been developing since year ago , I noticed that I developed my programming skills in first 6 months then , my coding style and strategy been the same, so what you advice me to develop my...
1
by: oo7nij | last post by:
Hi all, I have been given an assignment of creating an application that must do the following: 1.) User inputs\sends WML scripts using a normal web browser that has functionality and appearance...
12
by: Tyno Gendo | last post by:
Hi everyone I wondered what if any methods people here use to speed up their PHP code (ie. speed at which you produce your code). Things like 'code templates', 'base objects' for this and...
0
by: zzzmail.01 | last post by:
I find some useful tips about C/C++ and want to share with you. Sorry if it bothers you. Tips for better Coding Style:...
0
Eli Lopian
by: Eli Lopian | last post by:
It's easy to get bored writing code day after day. This is especially true when you aren't building a new application from scratch but rather are coding bug fixes and minor enhancements. It's up to...
1
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool that can be used to create mobile, web, and desktop...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.