Should one learn C before C++?

Should one learn C before C++?

Attached: 1528382228206.jpg (768x544, 56K)

Other urls found in this thread:

cs.rit.edu/~ats/books/ooc.pdf
twitter.com/SFWRedditGifs

Depends on what you need. Modern C++ is not that similar to C.
2003 C++ programmers wouldn't recognize C++17.

it really doesn't make a difference since they serve 2 completely different purposes

Assembly is all you need.

Could you anons go further on that? What purpose does C or C++ serve that the other cant fulfill?

Yes, but first one should learn Lisp.

Speed desu senpai

Nothing, C++ does everything these days. Even in embedded most chipmakers offer compilers so learning shit like is useless

Python is the best though, almost fast as native

Yes, it's less confusing and teaches you more about how things actually work, with arrays and pointers and memory allocation and all that shit
C++ slightly hides some things and a beginner will be taught how to use standard library things instead of how they're more or less accomplished

C++ is better to write bloated unmaintainable code.

>Python is the best though, almost fast as native
Stop posting.

Adding onto this, learn the basics of Assembly as well while using C, you don't wanna be one of those tards who don't even know about CPU registers, it's an embarrassment really

user, what can I achieve with C and assembly knowledge? In broad, laymans terms

OK I will give you the broad vision

A basic knowledge of Assembly gives you, other than the knowledge of how the program gets 'translated' and how the memory works (which really helps you make more efficient programs believe it or not), it can be used to reverse engineer programs with a disassembler which is cool and will make you feel like a super h4x0r
It's not actually to program anything, a C compiler will write assembly more efficiently than you could

An intermediate knowledge of C will give you the last piece of 'how it works' in the higher side of programming, you will be able to see how everything is accomplished in higher level languages, dynamic shit, pretty data structures, all that
Unlike Assembly though you can also use it to write real cool programs instead of just small exercises entirely to learn

Now you can either move to higher level language and BTFO all the retards who don't know the slightest thing about how programming actually works, or if you git real gud at C and Assembly you could use the languages for low level jobs with high pay and be smug

Attached: 1525965073042.jpg (1000x800, 81K)

Thank you so much for the writeup anonon.

Very light and fast programs. But a large project wouldn't really be a one-man job by any means. Makes some more sense if you remember it was developed for UNIX and its philosophy.

C = not object oriented
C++ = object oriented

You can easily write OO in C. You should expand your mind on what languages actually are cs.rit.edu/~ats/books/ooc.pdf

no you can't

What makes C++ OO and C not OO.

Bullshit

you can't create your own custom types in C

It's funny how brainlets like you cannot fathom this. There is a reason why Sussman made a deal out of implementing OO in Scheme for his classes.

You can easily do inheritance through aggregation. methods through function pointers and polymorphism through your own vtables.

I see that you don't know C, because there is that thing called structs.

a struct is itself a type

giving a name to a struct doesn't make it something else

But that's not a requirement for being OO.
Even then you can still put that struct into a union or struct, which will give it another type.

struct base {
...
};

struct derived {
struct base mybase;
...
};


Literally the same thing as inheritance in OOP

You can pass around structs to functions, make pointers to them, put them in other structs, etc., right? Yeah having to typedef them is fucking dumb but it's not like they're not types.

Whats wrong with just using:
typedef struct

As a C++ programmer, I always recommend people learn C first.

declare an object without using the word "struct" in C

May I ask why? I'm learning C++ right now and everything seems to make sense. what am i missing out on from C?

Silly person, you don't declare objects with struct, you declare classes with it :)

so it's not an object oriented language then

k thanks for playing

not sure if joking

Attached: gaymers.jpg (454x703, 47K)

#define struct class

S I P B O Y S 2 0 1 8

>still uses word "struct"

you can write a C program to fly an airplane, doesn't mean it's an airplane flying program

you got it backwards

>achieve %GOAL% but don't use %KEYWORD% for literally no reason

yeah oops

Yes it is. If it's a program that can do airplane flying, then it's an airplane flying program. People like you are too stuck up on the semantics of programming paradigms.
It's not black and white.

see:

No. Go ahead. I know even if I told you you should, you'd learn C with the codemonkiest source possible anyway. Have fun learning C++03 and then complaining about modern C++ being "too complicated WAAAAAAAAAAH."

Depends on how you are using it, but I would learn C++ first if you are wanting to write modern applications. C is better for micro-controllers and lower level processor coding. Some people mentioned learning Assembly too which is a way better idea if you really want to learn to understand this stuff.

The words are different but mean the same.

>programming language
>semantics don't matter

Semantics is very important for a programming language. But I am talking about programming paradigms.

How well would that general knowledge about Assembly and understanding in general "scale" to higher languages in the future?

It helps you understand the differences and the power of C++.

Attached: xwHkCyV.png (608x510, 168K)

one shouldn't learn c++

you CANNOT learn C++

Technically speaking if the CPU has a cache and does speculative execution, looking at just plain assembly doesn't really tell you how things work.

>Very light and fast programs. But a large project wouldn't really be a one-man job by any means
What kinda programs coded in C would we be talking about?

You will need to know both, anyway.

How about you just learn C and never attempt object oriented programming? We all know your C++ code is going to "use" objects that immediately fall out of scope and bleed memory.

>a C compiler will write assembly more efficiently than you could

This is correct, although, there are exceptional cases.

>You can easily do inheritance through aggregation. methods through function pointers and polymorphism through your own vtables.

*picks up red pill*
*GULP*
Thanks doc

>Ph.D. in C++
>any job I want
>300k starting

Attached: 13425342.jpg (640x427, 34K)

There is zero reason to learn low level. Just learn high level languages like Python, js , java etc theyre almost fast as native while being a fullstack dev makes a fuck ton more than embedded

Easily? No, there is virtually no support for OO. You'd have to use libraries but even then it won't be as nice as when the language supports it.

Knowing C++ + Python is a pretty versatile and safe bet, if you know those two you can pretty much learn anything else anyway

Do you understand the meaning of the word 'oriented'?

There is virtually no support for object-oriented programming in C. Thus it's not an OOP language.

Yet you can do parallel programming in C (and it's not a parallel language) or logic programming in C (and it's not a logic programming language).

I wish people would stop responding to this obvious bait thread that gets reposted all the time.

>python as fast as C
>not knowing about the GIL

Attached: 1511837291169.jpg (558x614, 21K)

Its true though, gains are minimal on modern hardware

>Marco abuse and void pointer everywhere is efficient and maintainable

Literally every C project involves a lot of reinventions of the wheel and many end up imitating C++ features in slower and less type-safe/maintainable ways such as maintaining your own vtable.