I have written some code that executes fine, but I am looking to further optimize the code with any nuanced methods that I probably haven't learned yet in my classes. I am willing to look up and study any methods mentioned. What I learned from reading this forum is that there are a lot of beginner methods taught in schools that aren't really efficient.
C++ is not the best beginner's programming language, the learning curve is quite high for barest minimum proficiency, but it is one of the more common ones.
Too often some new concept being taught could require an idea that is something to be taught later.
I am someone that believes teaching what the C++ Standard Library has to offer first should be a priority. Learn to use C++ containers such as std::vector instead of starting off with regular arrays, etc.
Later intermediate and advanced courses can delve into how to deal with legacy code, craft a custom container, etc.
I agree, I have learned a lot from this forum that trumps what I leaned in classes. I would like to think that these courses are trying to teach the students how to understand how the language works on a conceptual level. But there are a lot of things that they could teach us from the start, like how using namespace std; isn't good practice.
well, you learned something in the class as well. The trick is getting past outdated info and 'do it yourself' classroom stuff towards 'what can it do for me' and 'what is the current way'. Using namespace std was highly recommended for a while, until people realized the issues and reversed that.
sure, max element can do it for you, but you hopefully learned how to do it yourself, or at least how to approach it? Its a simple problem, good for a student to get a handle on looping through the data and finding something etc. What if you needed to find the second largest element? Or the median? Can you do those now? For every built in algorithm, there are dozens of nearly identical problems that are not in the toolset. You can either do something weird and usually inefficient to make the built in ones work (eg sort it and take the next to last works, but its slower than doing it yourself) or you can roll one out that does what you need. I consider the algorithms to be handy, ultra commonplace shortcuts to stuff that I really should be able to do myself, and recommend you take them with that mentality. Use them, absolutely, but know how to re-create them too.