Dead Men Walking

dMw Chit Chat => The Beer Bar => Technology Section => Topic started by: smilodon on January 15, 2014, 01:43:15 PM

Title: Learning C++
Post by: smilodon on January 15, 2014, 01:43:15 PM
I think I may have been struck by lightning dring the storms and suffered from some brain frazzle, but I've decided to spend some of my spare time (I have lots) learning a programming language. I'm familiar with the concept of programming and have done a fair bit years ago with BBC Basic. After a bit of research i have decided to go with C++. I'm using Microsoft Visual 2013 (the free version) and learning via http://www.learncpp.com/ which seems pretty decent and is pitched at my level... so far!

If there are any coders out there who are familiar with C++ any suggestions for additional resources, on-line video tutorials etc would be appreciated. And no I promise I won't endlessly badger you with questions if you reply here :D
Title: Learning C++
Post by: JanuZ on January 15, 2014, 03:18:49 PM
I started following this when I started dabbling with c++ but it was a little basic for me since I knew other programming languages from before.

https://cs50.harvard.edu/

I also looked at stanfords cs106, the cs106a has changed to java which is meant for the beginner programmers but cs106b is still c++. The lecture videos on http://www.stanford.edu/class/cs106b/ are from 2008 and cover both a and b at the time but the assignments for B are harder then A if I remember correctly.
If you prefer books I recommend C++ Primer 4th edition which is very good.

Edit: Forgot to mention, it can be very hard to change from different versions of Visual Studio, so if you try the stanford assignments install VS2008 and use that instead of trying to convert it to newer VS.
Title: Learning C++
Post by: OldBloke on January 15, 2014, 04:51:31 PM
Before I joined the hoards of the great unwashed I was told by my IT director that I had to start coding in C# as that was now the standard in my industry. I dabbled with it for a year using VS and, although in the early days I spent more time on Google than coding, I did get to like it ... sort of.
Title: Learning C++
Post by: smilodon on January 15, 2014, 05:32:41 PM
It's been half a day but I'm quite enjoying it so far. I can add stuff up and multiply stuff by other stuff. Small steps :)
Title: Learning C++
Post by: Jamoe on January 15, 2014, 08:49:15 PM
stackoverflow.com (http://www.stackoverflow.com) - for all your programming questions (and answers)

I would be tempted to learn C# rather then C++. C# is a beautifully designed language. C++ is C but with classes, templates and exceptions. So I assume you want to delve into an Object Orientated language. Learning Object Orientated Programming can difficult as it's a bit of a shift in mindset, shout when you get there (if you need to).

What are you going to make for us? :)


When you get done with learning the language syntax and want to move on, the following sites might be of interest. (not all free)

http://www.cleancoder.com
http://www.destroyallsoftware.com
http://martinfowler.com/
Title: Learning C++
Post by: DrunkenZombiee on January 15, 2014, 10:16:11 PM
C++ is jumping in the deep end somewhat however visual studio does help a lot compared to notepad and a command line compiler. The basics of C++ is pretty simple so you should be fine till you start getting into more complicated things such as pointer arithmetic and bitshifting etc. Most of the principals are the same across most object oriented languages and C++ is very similar to C# and JAVA so the syntax will be roughly the same.

Very soon you will get past the basics of the operators, assignment and classes move onto the more complicated data-structures part. This is pretty much the most important part of programming as while you don't need to work out the big-O noatation for everything you write its important that you get use to writing optimal code and pick the correct data structure and algorithm to access the stored data. The great thing is that these principals are the same as a linked list in JAVA is the same in C++ as its a fundamental construct even though JAVA's VM will often make the run-time slower.

I am not too sure if i agree with the comments about Java being a starting programming language as making a UI from scratch without using the visual designer is annoying as hell, as I would have thought VB would be the culprit for that.

If you do want any help on that let me know as while my C++ is a little rusty I still write a fair amount of code in a variety of languages.

DZ
Title: Learning C++
Post by: Gunnzie on January 16, 2014, 10:30:01 AM
I can't emphasise enough that it would be far better to learn Object Oriented Design first.

I've worked in the industry now for 19 years and the amount of poorly designed code I see is ridiculous. Poorly designed code leads to difficult to maintain applications at best. Poorly designed code can never be exception safe for starters.

Last round of interviews at my company I was more interested to see if candidates really understand OOD rather than coding.

For starters learn how and when to use inheritance or composition. Learn the difference between the different types of inheritance. Learn when to use composition instead of private inheritance and why. I'm only scratching the surface of the basics here. Those that delve straight into the coding side of c++ rarely if ever make good developers. Harsh but true.
Title: Learning C++
Post by: TeaLeaf on January 16, 2014, 10:55:29 AM
Quote from: Gunnzie;380212I can't emphasise enough that it would be far better to learn Object Oriented Design first.
For those interested, do you have any links to good resources to do that?
Title: Learning C++
Post by: smilodon on January 16, 2014, 11:12:26 AM
I'm learning C++ as a hobby. I've no aspirations to take it up as a profession though. So far it's making sense but it's early days yet.
Title: Learning C++
Post by: JanuZ on January 16, 2014, 11:42:10 AM
I would say learning the SOLID principles (http://en.wikipedia.org/wiki/SOLID_(object-oriented_design)) is the most important for good code design.

Can't remember where I read about it first but http://www.c-sharpcorner.com/UploadFile/akkiraju/s-o-l-i-d-design-principles-explained-part-1/ is a decent starting place for reading up on it.

Understanding SOLID and implementing it requires good understanding of Coupling (http://en.wikipedia.org/wiki/Coupling_(computer_programming)) and Cohesion (http://en.wikipedia.org/wiki/Cohesion_(computer_science)).
Title: Learning C++
Post by: Jamoe on January 16, 2014, 12:21:53 PM
Quote from: Gunnzie;380212I can't emphasise enough that it would be far better to learn Object Oriented Design first.

I've worked in the industry now for 19 years and the amount of poorly designed code I see is ridiculous. Poorly designed code leads to difficult to maintain applications at best. Poorly designed code can never be exception safe for starters.

Last round of interviews at my company I was more interested to see if candidates really understand OOD rather than coding.

For starters learn how and when to use inheritance or composition. Learn the difference between the different types of inheritance. Learn when to use composition instead of private inheritance and why. I'm only scratching the surface of the basics here. Those that delve straight into the coding side of c++ rarely if ever make good developers. Harsh but true.

You comment warms my heart, not enough professionals in our craft :) But, I can't help but feel we are getting over excited and giving Smilodon his pudding before he's even ordered his starter.

Quote from: TeaLeaf;380213For those interested, do you have any links to good resources to do that?

http://www.cleancoder.com have a tonne of training videos by Robert Martin, he's the legend that came up with/collated the SOLID principles which is an essential foundation to good OOD. Those aren't free resources and the guy is a fruitcake but the content is quality. These are not for beginners in my opinion.

I recently watch this http://vimeo.com/26330100 which should be quite accessible. It's a look at why clean code and how to get to a good design.


I can't help but feel we are derailing Smilodon's thread, in my opinion this isn't stuff you want to delve into when you first start out.
Title: Learning C++
Post by: smilodon on January 16, 2014, 02:57:49 PM
Quote from: Jamoe;380216I can't help but feel we are derailing Smilodon's thread, in my opinion this isn't stuff you want to delve into when you first start out.

I do have an honours degree in Information Management. I specialised in System development which deals with planning, creating and deploying information systems. So I understand the concepts of design and something of object orientated design. That being said right now I'm just working out how to add two inputs together and show the result on the screen :)

Thanks for all the links as well.
Title: Learning C++
Post by: Jamoe on January 16, 2014, 03:23:36 PM
Quote from: smilodon;380222I do have an honours degree in Information Management. I specialised in System development which deals with planning, creating and deploying information systems. So I understand the concepts of design and something of object orientated design. That being said right now I'm just working out how to add two inputs together and show the result on the screen :)

Thanks for all the links as well.

Apologies Smilodon, hope my enthusiasm hasn't come across as patronising.

You mentioned you did some research before choosing C++. What other languages did you consider and why did you opt for C++?

I'm hoping to learn Erlang this year, no commercial/career reason, just for kicks.
Title: Learning C++
Post by: smilodon on January 16, 2014, 04:16:02 PM
Lol, I was agreeing with you, hence the quote. I get the concept of good design. I'm just trying to learn the language and find out the best free resources to choose. I have no idea why I picked C++, it seems a very popular language and I've been told it's a good way to learn broader programming concepts. I could have gone for French or basket weaving :) It was just am impulse decision. I am really enjoying it so far though.
Title: Learning C++
Post by: Jamoe on January 16, 2014, 04:44:56 PM
Ah, read far too much into your post :)

One thing you might consider is to try doing some TDD (Test Driven Development) Katas. It might be an interesting way to learn a language.

http://osherove.com/tdd-kata-1/

A screen cast of someone doing the above Kata in C++.
http://vimeo.com/8446999 and


A few more Kata's to try - http://content.codersdojo.org/code-kata-catalogue/