473,880 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Terrible tips that sharpen your C++ coding skills

1 New Member
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 24284
13 New Member
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
1 New Member

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
988 Recognized Expert Contributor
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]

Apr 17 '24 #4

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

Similar topics

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 environment, I look at the job sites (Monster, Dice), and no-one, asks for just one skill. Therefor, what other skills will complement best my knowledge of PHP/MySQL? I already have a firm knowledge of html, css, and the web layout side
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 programming skills and development strategies
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 of a WAP browser 2.) The WML scripts must then be verfied somehow as being genuine WML language 3.) The WML is then stored in a database, most likely a SQL database 4.) The user then has the functionality to retrieve the scripts from the database...
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 that? I thought it would be interesting to find out if I'm missing out any anything cool that could aid in speeding up development.
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: http://tmh-coding-tips.blogspot.com/2008/09/cc-guidelines-for-better-coding-style.html Tips for better Memory Management: http://tmh-coding-tips.blogspot.com/2008/09/cc-tips-for-better-memory-management.html Tips for Performance Enhancements
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 developers to challenge themselves and build the skills that will keep their jobs interesting and motivate them to get out of bed every morning. Here are six skills you should work on to keep enjoying your software career. 1. Build Technical...
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 applications that can be used to automate tasks, improve efficiency, and increase productivity. However, in order to get the most out of PowerApps, you need to have a qualified PowerApps developer on your team. A qualified PowerApps developer will...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.