Are С and C++ Alive? Even More, IBM RPG Is! C and C++ Are Not Just for Old Systems. Are С and C++ Alive? Summary for C, C++. Embedded: C and С++ Are on the Rise.
Direct Style Effect Systems -The Print[A] Example- A Comprehension Aid
The Great and Mighty C++
1. The Great and Mighty C++
Andrey Karpov
karpov@viva64.com
2. www.reddit.com/r/programming
• SVG Is Turing Complete
• A step-by-step guide to analyzing JSON (and other semi-structured datasets) with SQL
• “Performance Matters” by Emery Berger (Strange Loop 2019)
• Why are large companies so difficult to rescue (regarding bad internal technology)
• Practical Ways to Write Better Javascript
• From UNIX to Linux, a time lapse of 45 years, Hendrik Jan Thomassen
• Stack Overflow Trends – Scala's decline mirrors Kotlin's rise
• Maximize learnings from a Kubernetes cluster failure
• Why Go and not Rust?
• Q&A: How Google Implements Code Coverage at Massive Scale
• Hierarchical Instrumented Tracing with Logback
• Court of appeals rules web scraping doesn't violate anti-hacking law - JavaScript Web Scraping
Guy
• Building GraphQL apis with Django
3.
4.
5. Everyone Just Lives in Their Own Reality
• С++ Russia x3 (Novosibirsk, Moscow, Saint Petersburg)
• CoreHard (Minsk)
• Meeting C++ (Berlin)
• CppCon (Colorado)
• C++Now (Colorado)
• Italian C++ Conference (Milan)
• emBO++ (Bochum)
• ....
6. Presenter:
• Andrey Karpov, PhD in physics and math
• Technical Director at SiProVer LLC
• Microsoft MVP
• Intel Black Belt Software Developer
• One of the PVS-Studio project’s founders
7. A Few Words About Us
• We stand on guard of code
quality.
• PVS-Studio detects errors and
potential vulnerabilities in С, C++,
C# and Java code.
• We actively participate in
conferences, do conference talks,
and write many articles dedicated
to code quality.
8. Are С and C++ alive? PDP Software Is!
•The PDP-11 mini-computer
9. Are С and C++ Alive? Even More, IBM RPG Is!
•IBM RPG is a programming
language whose syntax was
initially similar to the command
language of IBM’s mechanical
tabulators.
•Was widely used in 1960s and
1970s.
IBM 1401
10. C and C++ Are Not Just for Old Systems
• C++ Applications - http://www.stroustrup.com/applications.html
• Adobe Photoshop
• Mozilla Firefox
• Thunderbird
• World of Warcraft
• Apple – OS X
• Chrome (Launch date: September 2, 2008)
11. Are С and C++ Alive?
• TIOBE Index: if you add up C and C++, C/C++ will be the leader.
12. Summary for C, C++
• It’s a good idea to learn these languages
• There are and there will be many jobs for C/C++ developers
• The number of embedded systems in C is growing
13. Topics:
• Embedded systems
• A few words about innovations
• Development tool maturity and speeding up project builds
• The safe programming trend
• Various assistance tools that help control code quality
14. Embedded: C and С++ Are on the Rise
• Embedded
• IoT (Internet of Things)
16. std::string
• C++ Russia 2017: Anton Polukhin, What Not to Do: C++, How
to Invent the Wheel Correctly (for Experts)
https://youtu.be/rJWSSWYL83U (in Russian)
• vstring
• std::string
17. C++17: Constexpr if
template <typename T>
auto GetValue(T t)
{
if constexpr (std::is_pointer<T>::value)
{
return *t;
}
else
{
return t;
}
}
void foo()
{
int v = 10;
std::cout << GetValue(v) << 'n'; // 10
std::cout << GetValue(&v) << 'n'; // 10
}
19. C++17: A New Attribute [[fallthrough]]
switch (i)
{
case 10:
f1();
break;
case 20:
f2();
break;
case 30:
f3();
[[fallthrough]]; // The warning will be suppressed
case 40:
f4();
break;
}
20. C++17: A New Attribute [[nodiscard]]
[[nodiscard]] int Sum(int a, int b)
{
return a + b;
}
int main()
{
Sum(5, 6); // A compiler/analyzer
// will issue a warning
return 0;
}
22. С++17: Removed Features
• Trigraphs were removed.
• The register keyword cannot be used as a variable specifier
anymore.
• Prefix and postfix increment operators for type bool
removed.
• std::auto_ptr was removed. Use std::unique_ptr instead.
23. С++17: And So On
• I recommend an article by my colleague, Egor Bredikhin
"C++17"
https://www.viva64.com/en/b/0533/
24. Speed up Your Project Build: Distributed
Compilation
• IncrediBuild - https://www.incredibuild.com/
• distcc - https://github.com/distcc/distcc
• Icecream - https://github.com/icecc/icecream
25. Speed up Your Project Build: Compiler Cache
• When you compile a preprocessed file, a hash value is
calculated based on the file’s contents, the compilation flags,
and the compiler’s output.
• When you recompile an unchanged file that has the same
flags, the compiler retrieves a ready-made file from cache
and feeds it to the linker.
28. Speed up Your Project Build: More Information
• See my colleague Phillip Khandeliants’s article
"Speeding up the Build of C and C++ Projects"
https://www.viva64.com/en/b/0549/
29. A Tool’s Maturity Level
• Compilers
• Development environments
• Dynamic analyzers
• Static analyzers