Skip to content
Sign upLog in
← Back to Community

C or C++

Profile icon
DavidShen2

Hi all,

I have been debating if I should learn C or C++ as one of my primary languages. I have already learned the most simple basics of each and need to know which to focus on. I value speed and usability in robotics/engineering. Can somebody help me make a decision here? Also, as I am good with java, is java a good option here?

The following is what I have been thinking:

The case for C:

  • Fast
  • Popular in Robotics
  • Involves memory stuff I would like to learn.

The case for C++:

  • Fast, but a tad bit slower.
  • Also popular in robotics
  • Does some memory stuff in the background.
  • I think it has larger developer community

Which one should I focus on?

Thanks in advance!

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
Profile icon
PedroSantos64
Profile icon
DavidShen2
Comments
hotnewtop
Profile icon
Coder100

If you learn C then you know C++.

C++ was originally called C with Classes:

#include <stdio.h> int main() { printf("Hello, world!\n"); }

What will that do in C++? Whatever it does in C :D

Profile icon
DavidShen2

@Coder100
I know, but I don't know if I'd want to take advantage of features that c++ has that c doesn't.

Profile icon
Coder100

@DavidShen2
well, it definitely has more modern paradigms.

Profile icon
Coder100

use C++ then transition to C, it will be easier

@DavidShen2

Profile icon
DavidShen2

@Coder100
Are the syntaxs extremely similar? Also, which should I focus on? I can't really focus on both right now.

Profile icon
Coder100

They are the same syntax. C++ just has more features one would say.

It appears I was misunderstood, the plan is to first start with C++ then C afterwards.


@DavidShen2

Profile icon
DavidShen2

@Coder100
Just curious, why do you recommend moving to C?

Profile icon
Coder100

because C has less features and is less beginner friendly

@DavidShen2

Profile icon
DavidShen2

@Coder100
Thank you!

Profile icon
Coder100

no problem :)

@DavidShen2

Profile icon
Coder100
Profile icon
DynamicSquid

@DavidShen2
I would recommend learning C++ first as it's actually easier like standard output and teaches you important OOP concepts. Also C++ is more "modern" in a sense, and you can find great tutorials and help for it much better than you can with C

Profile icon
Coder100

pog

@DynamicSquid
approves

Profile icon
DynamicSquid

@Coder100
wait I read wrong I thought you said learn C first

Profile icon
Coder100
Profile icon
Coder100

either way you approve

@DynamicSquid

Profile icon
HahaYes

@Coder100
nonono C is easier than c++

Profile icon
Coder100

well there's less features

@HahaYes

Profile icon
Coder100

@HahaYes
this guy came from an object-oriented paradigm let him have classes smh

Profile icon
HahaYes

@Coder100
ew classes

Profile icon
Coder100

@HahaYes
well what do you use then

Profile icon
HahaYes

@Coder100
you could use static globals

Profile icon
Coder100
Profile icon
DynamicSquid

C and C++ have no considerable speed difference, so that doesn't matter. I would recommend C++ though since it teaches important OOP stuff and has a larger community for resources, asking questions, tutorials, etc. Also the transition to C from C++ is way easier than the transition to C++ from C. Any questiond just ask :)

Profile icon
NZHacker808

C++, because I like C++ (I just like to use C++)

Profile icon
DavidShen2

@NZHacker808
What aspects of C++ do you like?

Profile icon
NZHacker808

@DavidShen2
They already said my point
@DynamicSquid
@Coder100

Profile icon
HahaYes

if you are up for a challenge, C. C++ is just C with classes

Profile icon
k9chelsea2

learn C++ because yes