For years, the C ++ community has sought a clear way to impose good modern practices without depending on the criteria of each team. The idea of having a Automatic system that helps keep the code clean, safe and updated seems logicaleven urgent. But it won’t arrive soon.
This has made it clear its creator, Bjarne Stourup, where he affirms that there are no official profiles in his programming language, nor is it planned to have them in the short term. Language, with more than four decades of evolution, has accumulated a huge amount of tools, paradigms and styles.
This versatility is precisely what has kept it in force in critical systems, video games, artificial intelligence models or high performance applications. But it also makes it a fertile terrain for errors, inconsistencies, as well as for outdated styles.
The proposed approach to solve this –The so -called profiles– It consists of defining a set of automated rules that the development tools can apply to ensure that the code meets certain quality standards.
It should be noted that it is not about changing C ++, but about helping to use it better. The proposal is on the table, but the standard committee has decided not to incorporate it, not even in the next version of the language (C++26).
It is important to mention what its absence is a lost opportunity, because it affects the work of developers and is a warning that has been launched around the use of language, the impact of artificial intelligence or replacement attempts with new proposals such as Carbon.
Profiles: The proposal that still has no official place in C ++
It is important to mention that a profile is a configuration that defines how the code should be written to meet a specific style. This would include modern practices such as avoiding unprocessed pointers, using automatic resource management, reducing unnecessary castings or prohibiting insecure patterns.
The tools could apply these rules during compilation or as part of the static analysis, allowing to maintain quality in large projects without depending solely on manual reviews.
This idea would allow teams to say: «We want our code to meet this level of security and clarity», and let the system automatically reinforce it. An elegant solution to a problem that is solved today based on discipline, documentation and external tools such as clang-hid. In fact, Stroustrup declared the following: «There are no, nor will there be soon».
The decision not to include profiles in the standard has generated frustration. For those who have led the design of language since its origins, this rejection represents an unsuspected occasion. The profiles would not change the essence of C ++but they would facilitate their use, especially in projects with multiple developers.
The standard committee, composed of dozens of companies, academics, as well as experts from around the world, progress slowly by design.
Its priority is to maintain the stability of the ecosystem, but sometimes that slows advances that could improve the experience of those who write code daily. Without official profiles, each team continues to depend on their own criteria to decide which practices are acceptable and which are not.
How to write C ++ today (if you mind doing it well)
Meanwhile, what you can do is adopt a modern style on your own. That implies using more expressive control structures, such as loops per range; Take advantage of type deduction to reduce errors; and apply RAII to automatically release resources and avoid leaks.
It also means abandoning unprocessed pointers, leaving unnecessary castings behind and moving towards a more direct, clearer and clearer writing.
You do not need the latest functions of the standard to write C ++, the important thing is not to use the newest, but to understand how language works as a whole and use it as a coherent system. That is the difference between surviving in C ++ or dominating it.
In parallel, new threats to the quality of the code have appeared. One of them is the excessive dependence of artificial intelligence attendees. Although these can help write faster, they can also get used to not thinking.
Many developers criticize that C ++ evolves at an insufficient rate. However, in environments where each change must be predictable – such as automotive, robotics or financial systems -, moving fast is not always a virtue.
According to Bjarne Staustrup, if there are those who complain that he is slow and others that he is going too fast, the language is probably moving forward in the right direction. It is true that it would like to see more tangible advances, such as profiles.
But it is also true that each new function of the standard is integrated carefully, without breaking any of the above. That balance is what keeps a tool alive that, despite criticism, remains essential in the most demanding systems in the world.
Know How we work in NoticiasVE.
Tags: Programción
