Is it necessary to spend a lot of time on C before learning C++?

Is it necessary to spend a lot of time on C before learning C++?

Other urls found in this thread:

en.wikipedia.org/wiki/Modular_programming
twitter.com/NSFWRedditGif

You can just go straight into C++

I shouldn't learn C first?

Yes, because learning C++ without learning C leads to tons of bad habits and a very incomplete picture of how C works.
Think of C++ as a giant framework of abstractions that ALMOST KINDA is backwards compatible with C but not really.
It's much easier to see what C is doing, you can very clearly see where all the processor cycles go.
C++ does tons of sneaky shit and makes debugging a pain.
C++ actually started as a preprocessor for C called Cfront that spat out compliant C code.

What is the best way to learn C well?

Do you know how to program already?

I know the basic stuff. Control flow, variables, operators. I can do basic programs in pseudo code but I don't know any particular syntax.

Don't learn C or C++

Learn Modern C++, C++11 should be the minimum nowaday

check out "programming in C" by kochan
the 3rd and 4th edition are basically identical, 3rd edition is piss cheap, and easy to find if you wanna pirate

I used to recommend K&R but it's examples are too clever for their own good, a beginner will be exposed to them thinking they're good ideas when they're not.
You shouldn't be doing stuff like while (*dest++ = *src++); in reliable code.

When talking about C++ I was implying C++11 and C++14.
Thanks.
>thinking they're good ideas when they're not
Because they compromise safety?
Isn't K&R outdated anyway?

>Is it necessary to spend a lot of time on C before learning C++?
No. It helps and gives you a sense of history and why things work the way they work, but it is by no means necessary. And it works just as well as something to study later on for completion, rather than in preparation.

No, the language changed very little since it's standardization.
C89 is the canonical C and C99 and C11 add only minor quality of life stuff that most compilers already supported anyway, stuff like dynamically allocated stack arrays and the mixing of declarations and code, using initializer list items that weren't static or computable at compile-time.

I forgot to add, C++ is the exact opposite.
Idiomatic C++98 is very different from C++14, it's a language that tries to copy every other language awkwardly.
The next big addition will be MODULES!
Guess where they got those from? Web developers.

But, isn't C++14 or C++11 at least an improvement over previous versions? I thought the latter was considered the standard.

They're all standard, they just keep bolting more shit onto an already bloated language.
There shouldn't be 10 different ways to do the same thing, it leads to C++ devs using all of them at once.

definitely learn C. It's a reasonably compact language, fairly close to hardware level, but still powerful enough to basically create any level of abstraction you need.

C++ is extremely feature rich and complex, to the point that it's considered best practice in group projects to limit yourself to a small subset of it (often just C plus a bit of class syntactic sugar)

some of us C++ people hate the shit hipsters have done to fuck up C++ in C++1x

what are you learning C++ for? have you been memed by Sup Forums?

Can I claim to "know" C++ and then write C with classes exclusively?
I just really like C, and would rather deal with data hiding through opaque types and not public and private class members.

>I just really like C, and would rather deal with data hiding through opaque types and not public and private class members.
You realize that the whole and only point of private class members is to enforce the opacity of your types, right?

Yet is it useful to bother learning about previous versions?
It's very versatile, and I'm interested in scientific and high performance computing.

>have you been memed by Sup Forums?
I thought Sup Forums hated C++ almost as much as Java.

You realize using opaque types does the same thing?

>The next big addition will be MODULES!
Guess where they got those from?

> Modular programming, in the form of subsystems (particularly for I/O) and software libraries, dates to early software systems, where it was used for code reuse. Modular programming per se, with a goal of modularity, developed in the late 1960s and 1970s, as a larger-scale analog of the concept of structured programming (1960s). The term "modular programming" dates at least to the National Symposium on Modular Programming, organized at the Information and Systems Institute in July 1968 by Larry Constantine; other key concepts were information hiding (1972) and separation of concerns (SoC, 1974).

Modules were not included in the original specification for ALGOL 68 (1968), but were included as extensions in early implementations, ALGOL 68-R (1970) and ALGOL 68C (1970), and later formalized.[6] One of the first languages designed from the start for modular programming was the short-lived Modula (1975), by Niklaus Wirth

en.wikipedia.org/wiki/Modular_programming

>scientific computing
python
>high performance computing
sounds like a buzzword. are you going to be writing bruteforce software for supercomputers?

Nah c++ was my first lang. I learned C afterward and it took like 30 mins.

Yeah -- minus the compiler enforcement, which is a useful feature.

Why is Python so popular in science?

because it has the best libraries and doesn't require a lot of boilerplate and setup

best libraries for scientific computing that is

yes, it's useful. you'll find many projects still using the older standard and older C++ is actually less complex, with only l/rvalues instead of the fucking mess that's here now because of muh move semantics.

Easy learn language, get some attention of big corp and communities make libraries, academia found easy to learn and high number libraries was very obviously use python for introduction programming to Non EE/Physic/Math person.

>which is a useful feature
if you have no clue what you're doing. pointers are scary aren't they?

I learned C++ before I learned C. You can start out with either one. And both are interchangeable in a modern compiler. You might end up using both C and C++ libraries in your code.

This has nothing to do with pointers and you know it. If you don't think compilers stopping you when you are about to make a mistake is a good thing, then you clearly haven't been programming for long enough to have a meaningful opinion on this.

There's no point learning C or C++. Learn Rust and be part of the future.

>he says seething with rage behind his clusterfuck of inheritance

Opaque types are enforced through pointers, retard.
In C, you can make a pointer to a type you know nothing about because the pointer is 64-bits, it's size it's known.
The size of the type it's pointing to can be ANY size, and since that specific translation unit doesn't know the layout, (it doesn't have the type definition, hence opaque), you can't make any meaningful modifications to the data it points to, the compiler won't let you do it either unless you start recasting pointers as union pointers, but this is basically malware tier at this point.

>There's no point learning C
yea I'll stop ya there. Rust is a meme. Until theres a release of the linux kernel written in C you're just being silly

That works, but it means you pay an unnecessary runtime cost (an additional indirection) as a workaround for dealing with an insufficiently expressive language that doesn't let you express what you actually mean. While certainly a nice implementation of poor man's information hiding under the constraints of C, I hope you'll agree it is rather impoverished as a replacement for real fine-grained and zero-cost opacity controls.

damn, son what the fuck kind of fart app programming do you do?

What are you talking about? There's already a release of the Linux kernel written in C and has been for a long time. If you mean Rust, there's Redox OS.

yes i meant Rust, but for the record, the kernel in Redox is not linux, I did mean an /official/ release

>Modern C++
kek, just learn Java

I don't understand why so many people plug c++ on this god forsaken board

Why would you learn C++ if we have C?

Absolutely not

Fizzbuzz crowd that's high on memes and low on professional experience. They also hate Java because it's monstrous to try and develop it in Vim.

I work with Fortran and C++ programs that get 12 cores and 20 gigs of RAM and still run all night.
I'm experimenting with Clojure on our high performance network but by HPC standards it's like molasses.
A lot of scientific software is extremely calculation-heavy. High performance computing is a real thing.

Python is pretty much the best language for non-programmers to make a quick script to get something done and it has libraries for everything.