I think it's a matter of convincing some folks in the space to make courses. There are a few books you can search on amazon on low-latency and finance programming in C++ and Python recently however.
I think there is indeed more to the 'auto' story :) auto itself is really useful I think for the use case where you really need to use it, meaning you want to write generic code and be able to let the compiler do the hard work of deducing the correct type what the variable would be. Of course, the situation you mention, with even 'auto&' as a reference type in a 'for-each' loop is useful for folks to understand the difference.
Most of the time I peek at Google's if I'm unsure as they have the most encyclopedic guide. Companies I've worked at also usually default me into their style, so that's how my own personal style has evolved I suppose.
I really don't like auto. As a programmer, I want explicit control and clear code. Auto is a little too loosey goosey, and left to the compiler which changes over time.
I think 'almost always auto' is something I've backed off. That said, I'll provide a few use cases where I do and do not like auto off the top of my head below. Good: 1.) auto iterator = vector::iterator // for use in a loop 2.) auto collection = GetVectorCollectionFunction(); // Pretty reasonable 3.) In template / generic programming, in my mind that is the real reason to have 'auto' for type deduction. It's not explicit as you say, but that's the point of generic programming. Bad: auto i = 10; // Just use int, long, etc. auto i = 10.0f; // Better, but still better to make this code greppable. 'f' suffix easy to miss.
Its very good info thanks
Cheers!
Professor, why are there no C++ courses for designing financial software for desktop?
I think it's a matter of convincing some folks in the space to make courses. There are a few books you can search on amazon on low-latency and finance programming in C++ and Python recently however.
awesome! I wish you teach DSA problem solving in modernC++, paid course is still no one do it.
Something to consider in the future! 😀
Interesting. I hope that in one of the next videos you will talk about auto&&
I think there is indeed more to the 'auto' story :) auto itself is really useful I think for the use case where you really need to use it, meaning you want to write generic code and be able to let the compiler do the hard work of deducing the correct type what the variable would be. Of course, the situation you mention, with even 'auto&' as a reference type in a 'for-each' loop is useful for folks to understand the difference.
not the scary forwarding references !
Which C++ style guide do you follow?
Most of the time I peek at Google's if I'm unsure as they have the most encyclopedic guide. Companies I've worked at also usually default me into their style, so that's how my own personal style has evolved I suppose.
I really don't like auto. As a programmer, I want explicit control and clear code. Auto is a little too loosey goosey, and left to the compiler which changes over time.
I think 'almost always auto' is something I've backed off. That said, I'll provide a few use cases where I do and do not like auto off the top of my head below.
Good:
1.) auto iterator = vector::iterator // for use in a loop
2.) auto collection = GetVectorCollectionFunction(); // Pretty reasonable
3.) In template / generic programming, in my mind that is the real reason to have 'auto' for type deduction. It's not explicit as you say, but that's the point of generic programming.
Bad:
auto i = 10; // Just use int, long, etc.
auto i = 10.0f; // Better, but still better to make this code greppable. 'f' suffix easy to miss.
when using "auto", IDE becomes important.
100%
well, tNice tutorials is going to take forever...
More tutorials coming!