Discussion about C++

whats your opinion on C++ ?

Attached: index.png (225x225, 3K)

Other urls found in this thread:

stroustrup.com/P0977-remember-the-vasa.pdf
en.cppreference.com/w/cpp/compiler_support
isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
david.tribble.com/text/cdiffs.htm
port70.net/~nsz/49_c++_vs_c.html
twitter.com/SFWRedditVideos

it is poopoo caca

Ids bretty gud :DD

The only language I bother using for personal projects. C++17 is a beast.

BASED

She's my wife.

Attached: wifey.jpg (600x880, 94K)

Hey wow a discussion about C++, how do you think about something creative like this, we had never something like this on Jow Forums. Never. Except fives times every day. Fucking faggot.

It's a mess

well i dont see any c++ discussion out there right now besides this threat

Too hard to get a job. Switched to JS. C++ > JS for personal projects.

I can't seem to find a good compiler, which one does Jow Forums recommend besides some online tool?

>junior C++ job
>5 years of experience
every time

g++

>C++17
Stroustrup seems to imply its the worst revision yet

>The foundation begun in C++11 is not yet complete, and C++17 did little to make our foundation more solid, regular, and complete. Instead, it added significant surface complexity and increased the number of features people need to learn. C++ could crumble under the weight of these – mostly not quite fully-baked – proposals. We should not spend most our time creating increasingly complicated facilities for experts, such as ourselves.

>We need a reasonably coherent language that can be used by “ordinary programmers” whose
main concern is to ship great applications on time.
>We now have about 150 cooks; that’s not a
good way to get a tasty and balanced meal.
> We are on the path to something that could destroy C++. We must get off that path!

stroustrup.com/P0977-remember-the-vasa.pdf

>my language is no longer pajeet friendly

link?

On windows you probably just need to install MinGW(Google it).
g++ is probably the most used c++ compiler, it's also pre-installed on basically every Linux distro.

Clang is better now tho, in every possible aspect.

What's wrong with Microsoft C/C++?

en.cppreference.com/w/cpp/compiler_support

>t. freshman college student

it's an unusable shitfest of a compiler for anyone who wants to do more than hello world, even more garbage than clang

better than c and rust worse than python

is visual studio good for c++?

I think you're talking about gcc on windows

Since you're beginning, you should check out Clang, it's gonna become standard since compile time is significantly faster.

MSVC's compiler is a shit, it lets EVERYTHING go through and always has tricks here and there to make your shitty code compile.
Since you can't force it to use a C or C++ standard on the compiler, it means debugging can get real rough sometimes.
It happens a lot less on a good compiler that just tells you when you have pajeet code instead of going out of its way to make it compile.

t. 40 years old that doesn't keep with his time

If you're targeting Windows then yes, you want MSBuild for that.
If you just need it for studying purpose, I'd recommand Clang or g++ (on a *nix VM or with MinGW).
Clang's error output is often better than g++ tho.

Best actual programming support you'll get for the language as far as I know (in terms of 100% accurate syntax highlighting, code completion, go to definition function, accurate in-line errors, etc.) but it's a bit of a pain in the ass as far as everything else is concerned, managing libraries is a pain, dependencies are much harder to get than on Linux. There are like four invisibly different types of DLL that aren't compatible (Debug, Multi-Threaded Debug and the like, I forget all the possible combinations) and if your dependencies use the wrong sort you need to redownload or recompile them. It doesn't play nice with CMake some of the time but if you don't use CMake it's even worse, tons of navigating through unintuitive cluttered menus to add new libraries, includes, etc.

I think you cant read

how accurate is this graph?

Attached: 1530048448278.jpg (663x1408, 309K)

what do you guys think of codeblocks?

I use it but it's shit.

>Too hard to get a job
Why?

I have only had C++ jobs. Feels like there's little competition given that I've gotten every job I've applied to, and I am certainly not that good.

why is it shit?

IntelliSense isn't that far ahead of others tools used in any open source IDE on Windows.
I think that for anyone starting to code C++, Visual Studio Community (or the like) might be a pain in the ass.
VS Code is a better alternative IMHO, the editing options are wider and it actually forces you to understand what you're doing cause it's basically a code editing tool with a built in console.
What makes VS Code better than Sublime or the like on Windows is the fully featured editor, the large collections of good plugins and the debugging tool.

>Since you can't force it to use a C or C++ standard on the compiler
Dare I say it
*blocks ur path*

Attached: Blocksurpath.png (643x147, 8K)

>C++ Primer 5th edition
very good book, 10/10, would read again and have read again

>more solid, regular, and complete.
even bjarne talks about c++ as if it were a bowel movement

I think it lets you do cool shit with abstract architectures.
Most Design Patterns are easily applicable for Object Oriented Language. And C++ compiles in ASM, not in a shitty VM or whatever.

You got me there, I thought the only option that lets you change the standard in MSBuild was /Za.

what books would Jow Forums recommend to read for learning c++?

boost is for pseuds

Slow compile times, splitting code into multiple files is very tedious, templated code leads to nonsense error messages, the syntax itself is at times ambiguous(for example nested templates ending in >> compile in msvc but not in gcc, and the most infuriating part is gcc is in the right here according the standard. Also see most vexing parse.), the standard library can be immediately thrown out the window since it doesn't even handle Unicode properly and even simply building stuff is a mess, though not as awful as in Java. That's just from the top of my head. A lot of this is bullshit inherited from C.

The best language ever.

it is good for maths right?

>Slow compile times
Use Clang, Apple already made it standard for their proprietary IDE
>splitting code into multiple files is very tedious
What the fuck are you talking about ?
>compile in msvc but not in gcc
Like said, use /std to force a C++ ISO.
>doesn't even handle Unicode properly
Can't argue here.
>A lot of this is bullshit inherited from C.
C++ is completely different from C, you're a hack if you think otherwise.

>I thought the only option that lets you change the standard in MSBuild was /Za.
To be fair its a pretty new feature and doesn't support C++ standards older than 14.

What kind of jobs?

Depends what you wanna do.
It's very probable that Matlab, Scilab, or python will do everything you want to do in an easier way than in C++.

if Boost didn't exist, where would the committee took features to add in from?

>Stroustrup
He's butt hurt that he still hasn't finished concepts. C++17 is awesome. Every added feature is appropriate.

E.g. structured bindings:

std::map xs;
...
for (auto& [k, v] : xs) {
...
}

>What the fuck are you talking about ?
If you want something to be visible from multiple cpp files you have to declare them elsewhere first and then include this file everywhere you need to use the stuff you declared. Effectively you end up with two files per class. In other languages you just use namespaces.
>C++ is completely different from C
It has the worst parts of C intact though. The entire include system has to go.

>structured bindings
So that's what you call destructuring taken from Javascript? Why is C++ copying JS so hard?

>If you want something to be visible from multiple cpp files you have to declare them elsewhere first and then include this file everywhere you need to use the stuff you declared. Effectively you end up with two files per class. In other languages you just use namespaces.
namespace exists in C++ tho, I don't use them so I wouldn't know if they're badly implemented.
I don't fully understand your problem, you don't like that the #include system copies code inside your source file ?

>The entire include system has to go.
How would you replace it ? Something more Python like ?

> Why is C++ copying JS so hard?
the design principle of C++ is "look, we have that too!"

from every paradigm, from every other language

>namespace exists in C++ tho
They are useless in C++ since you still have to use includes.
>How would you replace it
With what most other languages do, like C# - if you declared a class in a file it's immediatley visible from other files and you use namespaces to manage the visibility. It's not only more convenient but also faster to compile.

best language in the world and I don't give a shit about haters.
Stop eating shit retards say about it and don't use all features at the same freaking time.

You'd have to change the way how C++ compilation pipeline works. I don't even understand how something like that could work in any language tho, they all need to have the same namespace ?
Pic related, that's C compilation tho, so without namespace.

Attached: 936959_10201130798217031_1000180529_n.jpg (636x424, 20K)

Wrong pic

Attached: 8072.png (521x275, 12K)

>Since you can't force it to use a C or C++ standard on the compiler, it means debugging can get real rough sometimes.
How does this relate to debugging?

Pretty regular

One consulting firm (all sorts of jobs), one in the steel industry for developing tools for process development, one (current) for a company selling computer vision products

>MSVC's compiler is a shit, it lets EVERYTHING go through and always has tricks here and there to make your shitty code compile.
What's a concrete example of code that "shouldn't compile" but does under MSVC?

>You'd have to change the way how C++ compilation pipeline works
You mean C compilation pipeline.
>I don't even understand how something like that could work in any language tho
Try using a different language.
>they all need to have the same namespace ?
No. It's all visible everywhere by default, and if you put it in a namespace you just NamespaceName.ClassName from other files. It even solves naming conflicts that would make C++ code fail to compile, or, even worse, silently use the wrong function.

>Don't adopt features from [your favorite language]
"C++ doesn't even have x!"
>Adopt features from [your favorite language]
"Ha! You copied that from y, how original!!!"

The life of a computer illiterate.

>How does this relate to debugging?
It happened to me a few times that the compiler just lets some code that might seem fine slip through.
When that happens, figuring out the problem might be tough.

Recently I was tasked to make a 20 years old MSVC project compile under gcc (not g++).
MSVC compiles #include "my_header.h" differently from gcc and seems to pick only what it needs.
I had a hard time understanding what the problem was.

this is the average C++ function. why was this allowed to happen?

Attached: 1528821308540.png (1016x98, 72K)

To have powerful abstractions, remember that this still compiles in ASM.
To produce the same behaviour in any other language, writing only 5 lines of code and with the same performance is not some small task.

Love it, use it daily.

hey Jow Forums, if c++ is so good, how come there are no OS kernels written in in it?

That's an extreme case.
A terrible implementation of an extreme case might I add.

>"C++ doesn't even have x!"
only brainlets say this
>The life of a computer illiterate.
says the person who thinks the two statements are said by the same person

the true computer illiterate is the person who believes he can make one language for everything

the absolute state of Jow Forums

there are

haiku is mostly sepples

g++ and clang are great, avoid msvc

the stepanov books are goat

Well, writing a kernel is a job for a low level language.
So, by default, C++ shouldn't be used for that, but you could still do it.
But that's not entirely true, LLVM is written in C++, as well as Clang. And incoming GPU compilers might use LLVM.

Fuchsia

Is there any real alternative to C?

Is C a low level language?

Yes, you need to handle everything from allocating to freeing memory. You can also specify how registers are used, or even write assembly code directly in your C code (C is compiled in ASM in object files (*.o) like )

PL/I, XPS, and BLISS historically
Zig and Myrddin currently
Rust and C++ in some cases

it is a mature language with good features and bad features

it is a good choice for many projects

it is an incredible litmus test for navel-gazing PL bloggers. if someone flinches when I say I work with C++, it's solid evidence that they're either inexperienced or have strong opinions about unimportant shit

I want to learn and master c++, which meme list should I follow? is enough?

>even simply building stuff is a mess, though not as awful as in Java
Now I know you're a fuckwit. On both counts.

reading books is never enough but the books i've read in that diagram were all good

Agreed, I didn't read it from start to finish, but it was great to have handy when I needed to look something up.

I'd say it checks out!

I like the language. It's flexibility in both paradigms and implementation make it easy to design yourself into a hole.

Doing anything more than the simple cases with templates is a bitch and a half. The ruleset around templates is completely batshit at this point and they keep changing up the rules with every major language revision. It's aggravating. They at least made consuming easier with the using directive. OTOH, I really do want to get into template metaprogramming and get rid of those little loops that litter the code everywhere.

Platform support has degraded over the years. Microsoft has taken a big, fat shit on the faces of its C++ users time and again and is surprised when they go web instead of .NET. Well, I should rephrase that. They've come around a little bit and have updated MFC and made their managed extensions less of a bitch to use. Trying to use UWP with C++ is godawful still. Linux support is bleh. You either work for a megabank with a toolchain set up or you do things the hard way since linux users always shat on C++ and its users.

Attached: 1373090793709.jpg (773x1008, 223K)

also 2 books not on this list but seen recommended:
Programming Principles and Practice Using C++
Discovering Modern C++

are they any good? to which tier in graph would you assign them into?

I'm kind of butthurt that noexcept may imply std::terminate at runtime.
I also really wanted coroutines but it didn't happen yet.
A standared dependency or package manager like cargo would be nice.
The C++ standard library is kind of meh, and third party libraries are pretty much all garbage.

far too complicated for its own good. It needs to be dramatically simplified. C is flawed to be sure but the solution is not to build upon broken foundation.

How/where can I start to learn it from scratch?

Attached: 1502079956740.jpg (225x225, 5K)

learncpp.com, 'C++ Primer' book or 'Programming Principles and Practice Using C++' book

Thank you

Attached: 1523908697663.jpg (400x333, 22K)

godlike if used correctly

Only used correctly when you don't use it.

also C++ Core Guidelines isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines

You are right BUT:

* Fastest language there is (along with C, but quite often it's the same compiler backend anyway)
* Probably the most expressive and powerful language (it actually won the ICFP programming contest more times than functional languages like Haskell or Ocaml, and it's the language of choices for programming competitions like Google Jam or Topcode)
* Best GUI library of any language, ever (Qt)
* Excellent support in terms of books, tools, libraries, etc.
* Can interface with C directly, giving you access to the very best libraries (quite often the reference libraries) for cryptography, numerical computing, graphics, etc.
* Most portable language (can run on mainframes, game consoles, embedded systems and whatever); can't do that with the meme languages like Rust or Go or even Java, that only support the main architectures

Basically, C++ has no equivalent. At some point Python will have full support for Qt and will become more competitive, but still much slower. Java is less portable, a bit slower and has poor integration with C libraries.

>I'm kind of butthurt that noexcept may imply std::terminate at runtime.
noexcept means you're going to keep your word. No exceptions.

>The C++ standard library is kind of meh, and third party libraries are pretty much all garbage.
Agreed for the most part. Anything decent from Boost gets rolled into the STL eventually.

Attached: 1332720636879.jpg (640x519, 91K)

>Fastest language there is
C++ can be in practice faster than C by using constexpr, but overusing abstractions kills performance on various unexpected places
>Can interface with C directly
this one is tricky, C library writers need to pay a tax for their code to really be compatible with C++
david.tribble.com/text/cdiffs.htm
port70.net/~nsz/49_c++_vs_c.html
>Qt
too bad it comes with the build tool madness by bringing yet another terrible tool on a table, Tk is really much simpler to work with but nowhere matches the performance Qt can do
>most portable language
portability is very vague term

s/kills performance/kills optimizations/

>the design principle of C++ is "look, we have that too!"

>from every paradigm, from every other language

c# does that better tho

>only brainlets say this
That's most of you. Especially insufferable Rust faggots.

i like chillitomatonoodle. His vid on youtube are ongoing and has many playlists for beginner and intermediate

We're talking about having codejams in /dpt/, first theme seems to be "find a project and improve on it", nicely general. No central repository, showcase your solution however befits you.

Attached: Prova.jpg (400x400, 47K)