Planning to learn C++

Thalstan

Space Marshal
Jun 5, 2016
2,082
7,392
2,850
RSI Handle
Thalstan
As many others have already asked...why do you want to learn C++ (or any particular programming language)?

Let's give a for instance...."I grew up playing DikuMUD and I want to learn not just how to run my own server, but to make modifications to it as well." (I think Diku was written in either C or C+, not C++ though)

I want to create interfaces for people to run minor programs at my company.

I want to be a script kiddy and be a black hat hacker (or white hat, depending)

Great! That said, there are a lot of basic things you will need to learn besides the programming itself. Compiling, linking libraries, designing interfaces, etc. If you are designing for a certain platform and want an easy user interface developer, you might want to use something like Visual Studio (I think it was Visual Basic/Visual C++ back when I was interested in that types of stuff).

That said, if you are wanting to learn to program just for the fun of it....go down to the local Radio Shack (oh, wait...nm) order a Raspberry Pi from Amazon. Cheap, can do a lot of things, and because you are not working on your main Windows machine, WHEN you have a major screw up (not if...WHEN), you won't be re-installing windows and doing a lot of swearing. Now, I am not sure if it's still built like this, but I think the iRobot *(or was it the Roomba) used to have a fairly open architecture, so once you got beyond the Pi, you could buy one of those to start to progress towards building robots.

Thing is, even the best programming requires the basics. These are not best taught in a language where a misplaced or missing punctuation mark can screw everything up. Learn the basics in an easier language and then take those basics and apply them in other languages. Lot of advice given already on which ones you can use, so I would suggest listening to them.

Oh, one more piece of free advice....Document, document, and then DOCUMENT YOUR CODE SOME MORE!. Use LOTS...no...MOUNTAINS of comments. Write down what you think each section of code is supposed to do. There is nothing worse than trying to go though and figure out where your bug is, and why it is, if you can't remember what you were trying to accomplish with a particular subroutine. Your future self with thank you.
 
  • Like
Reactions: wd56

wd56

Commander
Jun 27, 2017
8
32
100
RSI Handle
wd56
Wow! Thank you @maynard @Sirus7264 @Stevetank @Snakey and @Xist and @Thalstan

Definitely a lot to think about. I thought about C++ because that was the only the programming language from the top of my head. I think I did BASIC back in school , 18ish years ago (but thats probably outdated?)

So based on all your responses I think my options are; Python, Javascript and C#, since it seems like C++ is harder than those. In terms of objective, I honestly didnt have anything in mind besides thinking it might useful at some point and figured it might be an interesting hobby to pick up. I loved building my pc from scratch, however on the hardware side, that gets expensive fast so was thinking maybe I'd like to learn how to create simple programs (For example, click on a button to switch 2 screens off (out of the 3 screens), etc.) Maybe tie in some home automation items and the pc turns on the moment I walk into a room (probably need engineering for that more than programming)

Based on some of the points made, I will probably go with C#. As I can see my progress and real life practice through a game I play (Space Engineers). Sure, would I like to create the next billion dollar app, hell yes, am I ever going to? probably not.

Also dolphin-person-thingy @Carlos Spicyweiner click on this link, it might rock your world. You can thank me later. http://www.popsci.com/article/dolphin-squeak-english-translator-works-real-time
 
Last edited:

Bruce

Grand Admiral
May 23, 2017
520
1,889
1,350
RSI Handle
ABAP
@wd56 - judging by your examples I second the suggestion of ThaIstan - get yourself a raspberry pie and play with SDK for it - you'd learn MANY things and would be able to accomplish some of the things you've mentiioned as well (w/o need for any engineering and even other major equipment at all - just a few cables and sensors ).
 

Bruce

Grand Admiral
May 23, 2017
520
1,889
1,350
RSI Handle
ABAP
Oh, one more piece of free advice....Document, document, and then DOCUMENT YOUR CODE SOME MORE!. Use LOTS...no...MOUNTAINS of comments. Write down what you think each section of code is supposed to do. There is nothing worse than trying to go though and figure out where your bug is, and why it is, if you can't remember what you were trying to accomplish with a particular subroutine. Your future self with thank you.
Considering that we are talking to someone who is relatively new to the field - let's start with TDD and say that he'd need to first create his unit test code and document it ... :)
 
  • Like
Reactions: wd56

Xist

Moderator
Staff member
Officer
Donor
Jan 16, 2016
903
2,654
1,650
RSI Handle
Xist
Wow! Thank you @maynard @Sirus7264 @Stevetank @Snakey and @Xist and @Thalstan

Definitely a lot to think about. I thought about C++ because that was the only the programming language from the top of my head. I think I did BASIC back in school , 18ish years ago (but thats probably outdated?)

So based on all your responses I think my options are; Python, Javascript and C#, since it seems like C++ is harder than those. In terms of objective, I honestly didnt have anything in mind besides thinking it might useful at some point and figured it might be an interesting hobby to pick up. I loved building my pc from scratch, however on the hardware side, that gets expensive fast so was thinking maybe I'd like to learn how to create simple programs (For example, click on a button to switch 2 screens off (out of the 3 screens), etc.) Maybe tie in some home automation items and the pc turns on the moment I walk into a room (probably need engineering for that more than programming)

Based on some of the points made, I will probably go with C#. As I can see my progress and real life practice through a game I play (Space Engineers). Sure, would I like to create the next billion dollar app, hell yes, am I ever going to? probably not.

Also dolphin-person-thingy @Carlos Spicyweiner click on this link, it might rock your world. You can thank me later. http://www.popsci.com/article/dolphin-squeak-english-translator-works-real-time
Keep in mind that C# is more difficult than either Python or JavaScript. It is very similar syntactically and conceptually to C++ but you don't have to worry about memory management so it's definitely easier than C++ as far as that goes.

Something you can try is using Unity. They offer a free version and it's based on C# and there are 1000s of tutorials. It's nice because you get some visual feedback about whether what you're doing works or not. Plus it's games, and who doesn't like games.

If you find it difficult to understand the code then try switching to another language. DO NOT waste your time with the Unity version of bastardized JavaScript. C# only IMO.

Good luck! :)
 
  • Like
Reactions: wd56

GrammarGestapo

Pro Chat Necromancer
Jun 8, 2014
814
761
2,370
RSI Handle
TheGrammarpolice
codeacademy.com will provide you with anything you need
 
  • Like
Reactions: wd56

Khad

Vice Admiral
Oct 13, 2015
50
42
400
RSI Handle
Khadbanks
Going to Echo the Python recommendation in this thread. Years back I learned Java initially but really didn't do anything with it. I ended up getting a job in Information Security and was told if I wanted to write scripts to learn Python. Having already known Java, Python was very easy to pick up - but I can also see it very easy to pick up for first-time coders as well. The thing with Python is that they made it very easy to deal with the Syntax. It is all tabbed based (or spaces if you're a nutjob) so you don't have to open functions (definitions in Java) with brackets or worry about ending every line in a semi-colon.

It is very robust as well. I have created pretty big scripts/collections of scripts with GUI's to make it easier for people not familiar with code or scripts to use. It comes with a lot of built-in libraries that can do quite a lot but there are tons of libraries that other people have built to make things easier as well.

Couldn't recommend starting with Python enough.
 
  • Like
Reactions: Bruce

Xist

Moderator
Staff member
Officer
Donor
Jan 16, 2016
903
2,654
1,650
RSI Handle
Xist
I thought it was up to C+++(Ultra Mega Graphical Edition) already?
C++ is the spiritual successor to C. One of the really cool things that C++ added that C didn't used to have is the "++" operator. It basically means "add 1 to this variable." (C and many other languages have since added that syntax because it's just too cool).

So if you have the variable i = 2 and you want to set it to i = 3, you can just say i++ instead of in old C you used to have to say i = i + 1

So "c++" essentially means "the next/greater version of C" -- they could have just as well called it D. But rather than call it D which seems like a totally different language than C, they were cheeky and said C++.

This is not dissimilar to "Objective C" and "C#" (C Sharp) which again are spiritual successors to C that seek to add features to an existing well defined/known/performant language rather than to create their own. (C# is a successor to C++ really, with one of the primary goals being to reduce the developer overhead related to memory management, buffer overflows and other related security risks, while preserving a lot of the cool stuff that C++ added to C).

TL;DR "c+++" while perhaps fancy looking doesn't actually mean anything, but "c++" is full of meaning to the geekiest of geeks. ;)
 
  • Like
Reactions: CrudeSasquatch
Forgot your password?