So I have been intrigued by the ?? operator, but have still been unable to use it. I usually think about it when I am doing something like:
var x = (someObject as someType).someMember;
If someObject is valid and someMember is null, I could do
var x = (someObject as someType).someMember ?? defaultValue;
but almost invariably I get into problems when someObject is null, and ?? doesn't help me make this any cleaner than doing the null check myself.
What uses have you guys found for ?? in practical situations?
By learning C, you will be able to understand and visualise the inner workings of computer systems (like allocation and memory management), their architecture and the overall concepts that drive programming. As a programming language, C also allows you to write more complex and comprehensive programs.
There are numerous big tech companies that hire C/C++ developers with some decent salary packages such as Adobe, Oracle, Microsoft, Nvidia, etc. And to learn C/C++ in 2021 is not only beneficial from the career perspectives but it also somehow makes it easier for you to learn other programming languages afterward.
C is worth learning in 2022 because it is easy to grasp. It gives you basic knowledge about the inner workings of computer systems and the core concepts that drive programming.
Yes, you should learn C no matter the year since the language is a good foundation to stand on and will make you a good programmer. That's the quick version of why you should learn C and why it's a good language.
The ??
operator is like the coalesce method in SQL, it gets you the first non-null value.
var result = value1 ?? value2 ?? value3 ?? value4 ?? defaultValue;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With