Advertisement

Learning C++ by Writing C++

Started by November 24, 2017 10:59 PM
7 comments, last by alvaro 7 years ago

So I have a class next semester where I need to learn C++. I'll be going through the class textbook too of course, but I hate textbooks because I learn much better by programming than taking notes. I understand there's got to be some reading just to understand the syntax, but I have trouble remembering much from a whole chapter before programming. I prefer to work with smaller bits of information and gradually expand.

So my question is, how could I learn C++ in smaller bits?

Sounds like you need a good ol' fashioned cup of Don't Worry About It. If you're taking a programming class in school (especially at the university level), you'll have more than enough hands-on programming exercises, assignments/projects, and exams/quizzes to get the practice you need.

 

If the class is shaping up to be something that doesn't fit your learning style, work with your teacher/professor to get the right instruction for you (which could possibly mean dropping the course, to take it with a different professor.. but I'm getting WAY ahead of myself).

Advertisement

Due to my experiences over the last four semesters, I think I'm just going to be transferring to another college. That likely won't be until after the next semester though.  I don't have the option to take any of my planned courses with anyone else, and I sign up for 12 credits or higher or my Financial Aid will be cut by more than $2000.

For instance, we had no chapter quizzes in Computer Architecture this semester despite our professor listing them in the syllabus. we're going to take our final in a few weeks and it will be the first test or quiz we've had in the class. Otherwise he just lectures, or gives fairly random assignments. Once he assumed we (who had no prior ARM programming experience) would be able to write iterative and recursive Fibonacci and Factorial programs in an ARM simulator without a MUL instruction (and many others) in two days. That professor is also my advisor, and he recommended the class to me, and overrode the class requirements despite it requiring content from two other classes I hadn't taken.  Many other classes and professors have had similar sorts of problems.

I don't like to complain about this sort of thing, but I'm really up against a wall here. I had to withdraw from two of four classes this semester to avoid failing grades, and that costs my folks they shouldn't have to spend. My parents also agree with my idea of transferring. 

I'm just trying to get a leg up for next semester here, and get ideas for how I can improve.

Hmm, that sounds like an incredibly disorganized teacher/department/curriculum, and/or one that lacks oversight.  If the professor isn't following his own syllabus, that's not a great sign.  Also, it's not customary for professors/advisers to be so liberal with pre-reqs (though it's not unheard of to recommend classes even if you haven't taken the pre-reqs).

Like you, I also had experiences with professors not knowing the prerequisites (mainly adjunct profs who weren't actually employees of the school).  That's a tough situation to be in, but it happens, unfortunately.  It sounds like you do need a more organized program, and one where hopefully the 'bad seed" teachers are held accountable and weeded out.

As for your original question -- how to learn C++ in small bits -- I don't have the definitive answer, but one thing I've done personally is to google for computer science lecture slides/assignments/exams that are available from other schools.  E.g. if you search for "Intro to C++ site:edu", you'll find all kinds of material (the "site:edu" bit limits the search results to those with a domain of .edu).  Your mileage may vary, but hopefully some of the results might fit your learning style.

I wish you the best of luck with your education.

 

I see books as sources of information for look-up, rather than a collection of knowledge that I have to learn by heart.

That is, I don't necessarily need to know everything that's in it, but I do need to know what kind of information I can find in it. As a simple example, I would not bother about the precise syntax of a class definition, but I would remember it tells me "basic stuff about classes".

So whenever I have problem falling in the category "basic class problem", I know which book to pick to find the information I need.

 

It is, as you say, much easier to learn by doing, preferably before you have to make something "for real". I always try to  do a small private project beforehand. Anything that you pick is good, as long as it contains the matter you want to learn about. In a sense, whether the project succeeds isn't even relevant for learning.

 

As for your education, can't you express your concerns? If you get courses that don't work eg because you didn't have other courses, why not say so? If you got a course chosen, and it doesn't work as proposed, try to find an alternative solution by moving things around and discuss that. If you don't, you're the only person with the problem, so it's in your own interest to speak up.

I learned C++ by doing the following. This is by no means how you should do it, it's just how my brain is wired.

1. http://www.learncpp.com/
I went to the above site. I read every single article that the person wrote on there, and I wrote my own articles on my personal blog

2. I took a C++ course at my university, and I asked as many questions as possible

3. I bought the book "Jumping into C++"
I believe that the author is the guy that manages www.cprogramming.com, however, I could be mistaken.  The book is cheap (relatively) and not that many pages (my kind of book).

4. I transferred to a position internally at my old company where they needed someone to do some C++ work.
I did this while I started my course at school in C++, and during this time I was reading the book that I mentioned above and I was writing articles on my blog about what I had learned from the site mentioned above, and from other sources.

Overall, regardless of what you know coming into it, with discipline and focus you can pull off anything you want to achieve. By the way, personal projects are your best friend, just try and keep the scope small.

Good luck.

Advertisement

I followed the same road as Daniel pretty much.

I started with the worse C++ book in the world.  Teach yourself C++ in 24 hours.  24 hours I later signed up for a course at a local community college where I completed two semesters.  I transferred to a job within my company where C/C++ skills were needed.  I continued at the university level.

I have to say the best way to learn this language is by writing code in it.  Find a good book with plenty of exercises and a code examples.  When you start chapter one come up with a generic project of your own...a text based RPG for instance.  Every chapter read, do the exercises and then implement something you learned in the lesson into your project.  

The Quarry Works Creed

We who shape mere stone must always envision cathedrals

I also learn programming much better by writing programs. "A capar se aprende cortando cojones", my father would say. ("You learn how to castrate by cutting balls.") :)

I would use the textbook as a list of concepts to learn. Take a look at the table of contents and see what they cover first. Say it's basic integer types and input and output using <iostream> (I have no idea if that's a reasonable place to start, but whoever wrote the book probably has thought about the proper order more than I have). Challenge yourself to do something with that. For instance, try to write  a program that asks the user for 2 integers, adds them up and displays the result. You can learn how to write that however you learn best (tutorials, references, reading sample code...). Once you are satisfied that you understand the concepts, go back to the textbook and read the chapter. Chances are it will be very easy to understand at that point, and there might be things you didn't figure out yourself, or details that you had overlooked.

If you have a hard time getting started, or if you get stuck, or if you want some suggestions for a targeted challenge, you can post here, or you can PM me.

 

This topic is closed to new replies.

Advertisement