Anon, you could have asked this in one of the generals. Just go on google and look up "the bible of c++" and there's usually a consensus on the GOAT of *insert programming language here*
It is not necessary to learn C first, but it is a natural and easier way to understand C++.
Learn the basics of C++ however you want, but after that, please read this book.
I never see you complaining like this in the millions of inane threads with an anime girl asking the dumbest question imaginable, or generally the infinite supply of tech support threads that belong in /sqt/. What general do you want him to post this? /dpt/ where all the trannies are?
I have 4 favourite C++ books and they complement each other rather well.
>Stroustrup - Programming: Principles and Practice
Intro of intros, just had a new edition last month. Used to be 1200 pages, now it's half that size. Uses modern C++. >Koenig, Moo - Accelerated C++
For those with some basic programming knowledge, uses pre-11 C++, but it turns out to be rather useful. Makes you do "implement" some basic stuff like a list woth iterators. Also extremely well written. >Meyers - Effective C++
This
Idioms for well-written C++. He wrote two sequels: More Effective C++ (outdated, a secondary read for an experienced C++ programmer) and Effective Modern C++ (latest, but less fuundamental than Effective C++) >Stroustup - Tour of C++
Also a recent edition, gives the best and most focused overview of the language.
If someone wants to go serious about C++ in current year, those would be my recommendations for getting started.
I never read C++ Primer and I don't see why anyone would want to read that over Stroustrup's PPP (updated) or Koenig/Moo (really a great, great book).
I'm like 590 out of 800 pages on this book and I still feel like I don't know much. The fact that I already knew how to code adds a lot to that feeling but I also think it's hard to memorize some of stuff if you don't practice a lot.
So read your little book but eventually is right. And
You think books about languages teach you any of those?
it's a bloated amalgamation of redundant features and macro magics, the moment you get reliant on somebody else's library and you need to actually understand the code underneath you're doomed.
the only sane way is to limit yourself to a simple subset, but even then you'll get overwhelmed by the thousands of ways to do the exact same thing.
>a simple subset
Most people use C++ as C with classes anyway
2 weeks ago
Anonymous
maybe if they're moronic, examples of such are ITT with all books mentioned so far, I haven't read a single one and I know more about C++ than you ever will, nocodeshitter
You think books about languages teach you any of those?
have you ever done anything real like fishing? Did you read a book to learn how to do it or did you just drive to a lake with your father and do it? Lmao.
Read C++ and figure it out.
it's rocket science, very very difficult, but when you have trouble with C++, you can look at your C++ book that covers the subject you are having trouble with.
but at the end, C++ isn't that difficult, and 99% of the issues you encounter will not be mentioned in the book (it's not the books job to include a troubleshooting section that has every reddit / stackoverflow post in history).
Use godbolt.org to play around, set these flags for gcc or clang:
-g -Wall -Wextra -Wpedantic -fsanitizer=address -fsanitizer=undefined
godbolt also has pvs-studio which is the most intelligent static analyzer C++ has (you need to pay an undisclosed amount of money to use PVS-studio with your IDE/standalone, but you can use the free license which requires all your code files to include a comment at the very top.
I use onlinegdb if I really needed to debug (it's probably too advanced for you, and your IDE is better, but it's important to learn).
I would unironically tell you to install WSL to start learning C++ (unless you already dual boot linux, I only suggest dual booting if you have 2 separate SSD's).
With WSL you should be able to set up C++ in vscode (with cmake or using the compiler command directly, use cmake with vcpkg when you want to use a library like SDL2 and etc).
I don't think you need to learn compiler commands, but learning them is useful when building issues are not caused by cmake, but by the wrong flags being given to the compiler/linker (you can compare commands that you tested work, and you can figure out why cmake is generating bad commands).
When you are comfortable with WSL / linux, I suggest using msvc on windows.
MSVC is a bit stupid, but it has address sanitizer, and it avoids many of the issues with debugging msys2 / mingw code.
I don't mind people starting off with mingw (espeically if they pair it with drmingw's ExcHndl), just understand it has minor debugging issues that msvc and linux don't have to deal with.
clion is good.
The parts of C that matter are usually already covered by decent C++ books (things like pointers, arrays, strings).
It doesn't hurt to read a 30 min C tutorial, there might be things that aren't explained in C++ tutorials (but the code might not work in C++ because of casting, easily fixed).
you are probably going to forget everything if you don't do anything with what you learnt.
You can pirate all the books off libgen or whatever flavor you prefer (is gentoomen library still updated?).
Having a direction in programming is more important than the book or language or tutorial, like maybe C++ or C isn't even the right language for you (game developers should use C# for unity, or GDscript for godot, AI research is all in python, and rust is a decent option in a few areas like server / web / security oriented stuff).
I honestly think that after copying someone's code on advent of code, you should be able to attempt some of the easiest challenges, and you will still learn a lot from reading solutions. You can also try cppquiz.org.
Over all most of what I learned from C++ comes from looking at examples on cppreference.org. You really don't need more than an example when it comes to learning stuff, most of the words in textbooks just don't stay in my head, but when you use the knowledge to solve issues, I memorize it quickly.
>isn't even the right language for you
I want to learn it because anything that has to do with high performance usually requires C++
2 weeks ago
Anonymous
C++ isn't fast, it crashes at lot.
There is still demand for C++ but performance is a pretty boring goal, you will probably waste a lot of time if you are learning C++ for no reason other than "le C++ is fast".
Like wtf are your long term goals? work on stock trading software?
2 weeks ago
Anonymous
>There is still demand
It doesn't seem like it's getting replaced by anything though. I don't think performance is boring, I think fields like HPC are quite interesting >work on stock trading software?
That could be interesting yeah
Embedded as well
2 weeks ago
Anonymous
The problem is that I don't know what the path to learning HPC step by step is.
Harsh reality is that most of the momentum right now is probably in AI so you are dealing with a lot of GPU specific API's and languages, and it's very technical / reading research papers and not so much about code (and most developers are using python, like I said, I can't imagine what the C++ backend to pytorch / AI backends looks like).
Like when it comes to not getting burnt out programming, you must have projects that can be completed in a reasonable time span, and the projects need to have some sort of purpose (coding for the sake of coding can be enough for certain people, like maybe projects that fill up a resume or something, but you should know what job you are aiming for, maybe in your city and figure out what they code, and learn their language / etc).
For embedded, I think only robotics really makes use of high compute, unless you plan on mass producing something with the cheapest 5 cent microcontroller running C, most of the work is still probably in electrical engineering.
2 weeks ago
Anonymous
>most of the momentum right now is probably in AI
Maybe I should delve deeper into that then. I don't expect the AI craze to be gone anytime soon, it's only getting started
You're right though, maybe my mistake is wanting to learn things but not having any project to apply them. I'm interested in a lot of stuff but I don't really build anything.
2 weeks ago
Anonymous
Oh it can disappear as quickly as it boomed with the help of a few laws.
It helps if you are actually enjoyed using AI however, it's weird to learn to develop video games if you don't like video games.
2 weeks ago
Anonymous
>it's weird to learn to develop video games if you don't like video games.
I like making small games but I never really liked playing vidya for some strange reason
2 weeks ago
Anonymous
an artist doesn't need to be obsessed with other people's art to be an artist.
but the artist does have an opinion on what makes a good or bad game, so they technically have an interest in art even if they don't actively seek other people's art.
And I think it's impossible for someone under the age of 30 with computers at home or school as a kid to have never enjoyed playing a game. Like come on bro, you never played motherload?
2 weeks ago
Anonymous
>does have an opinion on what makes a good or bad game
I do. Kind of off topic I guess but my criteria for good games are mostly aesthetic and not really "functional". I really love something like hylics 2 for example, but creating something like this is less about being good at programming and more about visuals, music and so on >come on bro
You're right, it's inaccurate to say I never liked video games, I enjoyed pokemon platinum/BW/BW2 and metroid fusion a lot when I was a kid. But I never played the more "modern" stuff.
2 weeks ago
Anonymous
>good game is when le visuals
back in my day we played games to have fun
Writing good C++ code and writing good C code are completely separate skills. You don't need to be a C wizard to be good at C++, but you need to understand the basics, especially memory management, and you need to understand how C concepts map to assembly. There is no need to know every specific assembly instruction and be able to write assembly yourself, but you need to have a rough idea of what kind of assembly a C statement will compile to. For example, dividing by 10 will take a lot longer than dividing by 4 or 8, even though it's practically the same statement in C.
Anon, you could have asked this in one of the generals. Just go on google and look up "the bible of c++" and there's usually a consensus on the GOAT of *insert programming language here*
It's such a large language with loads of functionalities that everyone seems to be recommending something different though.
It is not necessary to learn C first, but it is a natural and easier way to understand C++.
Learn the basics of C++ however you want, but after that, please read this book.
I never see you complaining like this in the millions of inane threads with an anime girl asking the dumbest question imaginable, or generally the infinite supply of tech support threads that belong in /sqt/. What general do you want him to post this? /dpt/ where all the trannies are?
I have 4 favourite C++ books and they complement each other rather well.
>Stroustrup - Programming: Principles and Practice
Intro of intros, just had a new edition last month. Used to be 1200 pages, now it's half that size. Uses modern C++.
>Koenig, Moo - Accelerated C++
For those with some basic programming knowledge, uses pre-11 C++, but it turns out to be rather useful. Makes you do "implement" some basic stuff like a list woth iterators. Also extremely well written.
>Meyers - Effective C++
This
Idioms for well-written C++. He wrote two sequels: More Effective C++ (outdated, a secondary read for an experienced C++ programmer) and Effective Modern C++ (latest, but less fuundamental than Effective C++)
>Stroustup - Tour of C++
Also a recent edition, gives the best and most focused overview of the language.
If someone wants to go serious about C++ in current year, those would be my recommendations for getting started.
I never read C++ Primer and I don't see why anyone would want to read that over Stroustrup's PPP (updated) or Koenig/Moo (really a great, great book).
>is it a requirement to learn C beforehand
Yes, and assembly
Both can be done in about two days
>assembly
Which architecture?
>Assembly Compiler:
installed.
>Assembly VSCode extension:
added.
>Assembly Udemy Course:
bought.
>Hello World Screenshot:
posted
Who else is down to learn assembly???
The only good C++ book was written by trout soup himself
>best seller since 1986
the kind of book that makes cniles believe that C++ is bad
ill say this once and ill say it again homie
all you need:
>learncpp.com
>cppreference.com
homie just sit down and code.
>don't learn about algorithms, data structures, optimization or anything like that bro
You think books about languages teach you any of those?
I'm like 590 out of 800 pages on this book and I still feel like I don't know much. The fact that I already knew how to code adds a lot to that feeling but I also think it's hard to memorize some of stuff if you don't practice a lot.
So read your little book but eventually is right. And
is also right.
I don't think it's even possible to learn C++ in current year
Why not
it's a bloated amalgamation of redundant features and macro magics, the moment you get reliant on somebody else's library and you need to actually understand the code underneath you're doomed.
the only sane way is to limit yourself to a simple subset, but even then you'll get overwhelmed by the thousands of ways to do the exact same thing.
>a simple subset
Most people use C++ as C with classes anyway
maybe if they're moronic, examples of such are ITT with all books mentioned so far, I haven't read a single one and I know more about C++ than you ever will, nocodeshitter
have you ever done anything real like fishing? Did you read a book to learn how to do it or did you just drive to a lake with your father and do it? Lmao.
Read C++ and figure it out.
it's rocket science, very very difficult, but when you have trouble with C++, you can look at your C++ book that covers the subject you are having trouble with.
but at the end, C++ isn't that difficult, and 99% of the issues you encounter will not be mentioned in the book (it's not the books job to include a troubleshooting section that has every reddit / stackoverflow post in history).
Use godbolt.org to play around, set these flags for gcc or clang:
-g -Wall -Wextra -Wpedantic -fsanitizer=address -fsanitizer=undefined
godbolt also has pvs-studio which is the most intelligent static analyzer C++ has (you need to pay an undisclosed amount of money to use PVS-studio with your IDE/standalone, but you can use the free license which requires all your code files to include a comment at the very top.
I use onlinegdb if I really needed to debug (it's probably too advanced for you, and your IDE is better, but it's important to learn).
I would unironically tell you to install WSL to start learning C++ (unless you already dual boot linux, I only suggest dual booting if you have 2 separate SSD's).
With WSL you should be able to set up C++ in vscode (with cmake or using the compiler command directly, use cmake with vcpkg when you want to use a library like SDL2 and etc).
I don't think you need to learn compiler commands, but learning them is useful when building issues are not caused by cmake, but by the wrong flags being given to the compiler/linker (you can compare commands that you tested work, and you can figure out why cmake is generating bad commands).
When you are comfortable with WSL / linux, I suggest using msvc on windows.
MSVC is a bit stupid, but it has address sanitizer, and it avoids many of the issues with debugging msys2 / mingw code.
I don't mind people starting off with mingw (espeically if they pair it with drmingw's ExcHndl), just understand it has minor debugging issues that msvc and linux don't have to deal with.
clion is good.
Thanks for all the knowledge, you think i should learn c or is it too much of a specialty? Dont i need that base?
The parts of C that matter are usually already covered by decent C++ books (things like pointers, arrays, strings).
It doesn't hurt to read a 30 min C tutorial, there might be things that aren't explained in C++ tutorials (but the code might not work in C++ because of casting, easily fixed).
you are probably going to forget everything if you don't do anything with what you learnt.
You can pirate all the books off libgen or whatever flavor you prefer (is gentoomen library still updated?).
Having a direction in programming is more important than the book or language or tutorial, like maybe C++ or C isn't even the right language for you (game developers should use C# for unity, or GDscript for godot, AI research is all in python, and rust is a decent option in a few areas like server / web / security oriented stuff).
I honestly think that after copying someone's code on advent of code, you should be able to attempt some of the easiest challenges, and you will still learn a lot from reading solutions. You can also try cppquiz.org.
Over all most of what I learned from C++ comes from looking at examples on cppreference.org. You really don't need more than an example when it comes to learning stuff, most of the words in textbooks just don't stay in my head, but when you use the knowledge to solve issues, I memorize it quickly.
>isn't even the right language for you
I want to learn it because anything that has to do with high performance usually requires C++
C++ isn't fast, it crashes at lot.
There is still demand for C++ but performance is a pretty boring goal, you will probably waste a lot of time if you are learning C++ for no reason other than "le C++ is fast".
Like wtf are your long term goals? work on stock trading software?
>There is still demand
It doesn't seem like it's getting replaced by anything though. I don't think performance is boring, I think fields like HPC are quite interesting
>work on stock trading software?
That could be interesting yeah
Embedded as well
The problem is that I don't know what the path to learning HPC step by step is.
Harsh reality is that most of the momentum right now is probably in AI so you are dealing with a lot of GPU specific API's and languages, and it's very technical / reading research papers and not so much about code (and most developers are using python, like I said, I can't imagine what the C++ backend to pytorch / AI backends looks like).
Like when it comes to not getting burnt out programming, you must have projects that can be completed in a reasonable time span, and the projects need to have some sort of purpose (coding for the sake of coding can be enough for certain people, like maybe projects that fill up a resume or something, but you should know what job you are aiming for, maybe in your city and figure out what they code, and learn their language / etc).
For embedded, I think only robotics really makes use of high compute, unless you plan on mass producing something with the cheapest 5 cent microcontroller running C, most of the work is still probably in electrical engineering.
>most of the momentum right now is probably in AI
Maybe I should delve deeper into that then. I don't expect the AI craze to be gone anytime soon, it's only getting started
You're right though, maybe my mistake is wanting to learn things but not having any project to apply them. I'm interested in a lot of stuff but I don't really build anything.
Oh it can disappear as quickly as it boomed with the help of a few laws.
It helps if you are actually enjoyed using AI however, it's weird to learn to develop video games if you don't like video games.
>it's weird to learn to develop video games if you don't like video games.
I like making small games but I never really liked playing vidya for some strange reason
an artist doesn't need to be obsessed with other people's art to be an artist.
but the artist does have an opinion on what makes a good or bad game, so they technically have an interest in art even if they don't actively seek other people's art.
And I think it's impossible for someone under the age of 30 with computers at home or school as a kid to have never enjoyed playing a game. Like come on bro, you never played motherload?
>does have an opinion on what makes a good or bad game
I do. Kind of off topic I guess but my criteria for good games are mostly aesthetic and not really "functional". I really love something like hylics 2 for example, but creating something like this is less about being good at programming and more about visuals, music and so on
>come on bro
You're right, it's inaccurate to say I never liked video games, I enjoyed pokemon platinum/BW/BW2 and metroid fusion a lot when I was a kid. But I never played the more "modern" stuff.
>good game is when le visuals
back in my day we played games to have fun
Writing good C++ code and writing good C code are completely separate skills. You don't need to be a C wizard to be good at C++, but you need to understand the basics, especially memory management, and you need to understand how C concepts map to assembly. There is no need to know every specific assembly instruction and be able to write assembly yourself, but you need to have a rough idea of what kind of assembly a C statement will compile to. For example, dividing by 10 will take a lot longer than dividing by 4 or 8, even though it's practically the same statement in C.
surely bjarne's book is the best
This is good if you already know some basic programming.
Is it true that cpp stands for c**t penis penis?
>Also, is it a requirement to learn C beforehand?
No, and C will teach you terrible habits.
>C will teach you terrible habits.
What a nocoder homosexual
Enjoy your memory leaks and segmentation faults, you unemployed moron.
>Enjoy your memory leaks and segmentation faults
Laughing my fricking ass off, what a nocoder homosexual!
Its better to learn C after, otherwise you'll be trying to use C antipatterns in C++.
>antipatterns
HA
HAHAHA
HAHAHAHAHAHAHAHA