Welcome, Guest. Please login or register.

Author Topic: C vs C++ ... or whatever language  (Read 21037 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline PlazTopic starter

C vs C++ ... or whatever language
« on: February 07, 2018, 03:28:35 AM »
I was posting in another thread and found myself going way off topic, so I decided to spin this off to it's own thing.
 
Longer ago than I care to admit, I moved from embedded asm projects to C. I found C annoying and after a couple of projects I changed up careers and moved on to other interesting things. C++ came up along the way, but I said, "meh, looks like that annoying C to me. no thanks."

Fast forward a good bit. I'm now back to C++ based projects "for fun and profit".
My personal story...  First  C++ was a huge, complicated PIA to learn. I don't seem to be alone in this opinion. However once I started getting the hang of it, I found I preferred it over plain C. Why? who cares. My point is, if you want to learn to program, find what works for you and go with it. Java, Rust, python... try them all on for size, pick one or two and run with it. I think I made a mistake for along time asking "what's the best one to learn?" Instead I found projects I really liked, then learned what the project called for. I turned up my nose a bit a first at the C++ based stuff because , ya know... C. But I dug in anyway and find myself enjoying coding again.

Side note to my side note...
For a couple of years now  I've been reading about "the next thing to replace C++ because it so complicated". Since C++ is continually evolving, I just can't see that happening soon and I can't understand why so many seem to want to replace it. "Because programming is too hard, we have to make it easier", is my personal guess at the reason. YMMV

Thanks for reading

Plaz
« Last Edit: February 07, 2018, 03:30:36 AM by Plaz »
 

Offline PlazTopic starter

Re: C vs C++ ... or whatever language
« Reply #1 on: February 08, 2018, 02:05:06 AM »
Quote
I guess I just need to find a "driver" usually in the form of some other project

Exactly were I finally found my motivation. Before that I wondered aimlessly knowing I needed to improve, but never sticking to any study or project long enough.

Quote
learning curve like going from C to C++?

For me it was more of a perspective change than a learning curve. If you're already good with C, then you're starting farther along than I did.

I'm a very visual learner, if you are too see if this helps... Visualize a world full of C structures who's internals not only include data, but also their own independent code and functions. Matter of fact those internal functions might even be other structures. A new structure might clone an existing structure and then add it's own uniqueness, all the while being able to to refer back to the original structure's "guts".

What I've quickly and crudely described is a class with members and methods. An object.
The language is still C (with more semantics added), but the ways in which you can use it to manipulate "objects" is expanded.

I've never found one great book on C++. But the one I got the most from was
C++ primer plus by Steven Prata

 Watching different videos on a tough subject was typically helpful.

Quote
I think C/C++/C# were created by satan and I want to slit my wrists when I code in them or have to look at code.

oh boy does that sound familiar.  But I'm in a better place now.

On the other hand what I still find evil is when people code their projects with no comments. C++ can be buried in layers of abstraction if the coder so chooses, Trying to unravel what they've written can be soul killing. Clearly they never meant to share their code so why bother explaining it? I've seen a couple of projects wither and die after someone tried to pick up where someone else left off. Better to borrow the concept and start over with a new code base.

Also as a newbie don't be afraid to assume the code in a project you're looking at might not be correct. (rare as it might be) I once spent hours and hours assuming I had learned something wrong and I was just too dumb to figure out how the code I was looking at worked. While I'm often a dummy, in this case I finally figured out the flaw in the code. Annoying as it was, the time I spent troubleshooting was valuable in my learning.

One last tip. C++ syntax is only one part of the puzzle. Understanding what your compiler is doing with your text is as equally important. Compiler is making a lot of assumptions that a beginner doesn't know about. Study guides refer to this but I don't think they highlight the topic nearly well enough.

Plaz
 

Offline PlazTopic starter

Re: C vs C++ ... or whatever language
« Reply #2 on: February 09, 2018, 02:10:31 AM »
Quote from: Thomas Richter;835912
Good documentation is great. Code that requires good documentation is bad.



Well put. I find most code I meet pretty good. Commentary would make the learn curve much easier on the "new guy" though. Heck, even more sensible naming conventions would be a big improvement.

So much reading to figure out "x_blah"... what is this a member of and what it is used for?  dig dig dig

Plaz
 

Offline PlazTopic starter

Re: C vs C++ ... or whatever language
« Reply #3 on: February 12, 2018, 11:49:08 PM »
Quote
Accelerated C++: Practical Programming


I gave this a quick read today. I found it moves very quickly which may be a problem for new learners. (of course the first clue is "accererated") By the end of chapter 3 I wanted to raise my hand and as the instructor a question. Dang it, not included. :)

Plaz
 

Offline PlazTopic starter

Re: C vs C++ ... or whatever language
« Reply #4 on: February 18, 2018, 12:11:32 AM »
Quote from: kolla;836231
What C++ options are there for Amiga? :)


With tech assist from Chris_Y I built GCC 6.x cross compiler, successfully build Netsurf and ran it on AmigaForver.

Plaz