Is it best to learn different ways to do the same thing?

Is it best to learn different ways to do the same thing?

Post by disaster_voice on Tue Jun 26, 2012 9:27 pm
([msg=67546]see Is it best to learn different ways to do the same thing?[/msg])

I've been learning C++ for a few months now and have noticed that there are libraries that do a lot of the work for things I have been learning so far. For example, I learned first how to make C strings using char arrays. I have recently been learning how to work with strings using the string class, which makes things much easier.

For practical applications of programming (making something that works) would it be better to just learn the more advanced features of C++ or should I go ahead and learn the basic concepts in order to have a fuller and deeper understanding of the language?
User avatar
disaster_voice
New User
New User
 
Posts: 11
Joined: Wed Nov 24, 2010 5:23 pm
Blog: View Blog (0)


Re: Is it best to learn different ways to do the same thing?

Post by LoGiCaL__ on Tue Jun 26, 2012 10:19 pm
([msg=67548]see Re: Is it best to learn different ways to do the same thing?[/msg])

If you're learning from scratch I would suggest learning from the beginning along with the basic concepts. It does help to actually make the things you could use in libraries later after you gain some experience. The thing with C++ is you will very often create functions for things that in other languages have built in functions or are even in libraries for c++. As you become more experienced you can use re-written code or other libraries to speed things up especially if you are writing programs with hundreds to thousands of lines.
User avatar
LoGiCaL__
Addict
Addict
 
Posts: 1063
Joined: Sun May 30, 2010 12:33 pm
Blog: View Blog (0)


Re: Is it best to learn different ways to do the same thing?

Post by WallShadow on Tue Jun 26, 2012 10:23 pm
([msg=67549]see Re: Is it best to learn different ways to do the same thing?[/msg])

In my opinion, you should learn both approaches. You will never know when C++ strings fail at doing exactly what you want, and you may want to use char arrays. Another good idea is to try to always learn what is actually going on inside. For example; estimate what happens inside a string, and maybe even attempt to create your own class the mimic the string's functionality. Another thing you might want to try is learn the use the C++ vector class. Then attempt to write your own vector class to get a grasp of how it works inside. Good luck!

-WallShadow <3
User avatar
WallShadow
Contributor
Contributor
 
Posts: 626
Joined: Tue Mar 06, 2012 9:37 pm
Blog: View Blog (0)



Return to C and C++

Who is online

Users browsing this forum: No registered users and 0 guests