Abstracting technical layer details in C++ to mitigate the language’s learning curve.

Recently, I came across a LinkedIn post showing a C++ developer’s reaction to seeingfor the first time how array sorting is done in Python. Unsurprisingly, the simplicity of Python’s approach was shocking.

arr=[64,12,22,55,44]
bubble_sort(arr)
print("Sorted Array:",arr)
Continue reading “Abstracting technical layer details in C++ to mitigate the language’s learning curve.”

Could Herb Sutter’s call to action for C++ safety be acheived soon?

Recently, Herb Sutter wrote an excellent article on C++ safety. He discussed numerous ideas, but I’ll provide a summary of his perspective on what can be done in the medium term to enhance C++ safety.

In C++, by default enforce …(A) Solution for new/updated code (can require code changes — no link/binary changes)(B) Solution for existing code (requires recompile only — no manual code changes, no link/binary changes)
Type safetyBan all inherently unsafe casts and conversionsMake unsafe casts and conversions with a safe alternative do the safe thing
Bounds safetyBan pointer arithmetic Ban unchecked iterator arithmeticCheck in-bounds for all allowed iterator arithmetic Check in-bounds for all subscript operations
Initialization safetyRequire all variables to be initialized (either at declaration, or before first use)
Lifetime safetyStatically diagnose many common pointer/iterator lifetime error casesCheck not-null for all pointer dereferences
Less undefined behaviorStatically diagnose known UB/bug cases, to error on actual bugs in existing code with just a recompile and zero false positives:
Ban mathematically invalid comparison chains
(add additional cases from UB Annex review)
Automatically fix known UB/bug cases, to make current bugs in existing code be actually correct with just a recompile and zero false positives:
Define mathematically valid comparison chains
Default return *this; for C assignment operators that return C&
(add additional cases from UB Annex review)

But what are the current possibilities for achieving this goal?

Continue reading “Could Herb Sutter’s call to action for C++ safety be acheived soon?”

OpenCV: The art of using the KISS and YAGNI principles.

As programmers, we’re often tempted to leverage design patterns, language idioms, advanced language features, and well-known libraries, which is certainly advisable. However, it’s essential to put on the KISS/YAGNI glasses before diving into these techniques 🙂

Continue reading “OpenCV: The art of using the KISS and YAGNI principles.”

The Must-Have Solution for C, C++, and Java Developers

CppDepend for C/C++ and JArchitect for Java are powerful software tools that offer a wide range of features to help C, C++, and Java developers create high-quality code.

Don’t wait – take advantage of these valuable tools and start improving your code base today!

Continue reading “The Must-Have Solution for C, C++, and Java Developers”

Code Complexity Analysis with CppDepend Tool

CppDepend is a powerful and versatile tool for analyzing code dependencies in C++. It is designed to help developers, architects, and project managers get a better understanding of the structure of their code and how different components depend on each other. With CppDepend, it is possible to visualize the relationships between different classes, methods, and other components, as well as to identify potential problems, such as tight coupling, circular dependencies, and other issues that can lead to code fragility and reduced maintainability.

Continue reading “Code Complexity Analysis with CppDepend Tool”