C++

Redpill me on C++ user

Attached: 1522635669452_1.jpg (854x493, 41K)

Other urls found in this thread:

cppedinburgh.uk/slides/201704-towards-composable-gpu-programming.pdf
youtube.com/watch?v=fbtO-wdohWI
twitter.com/AnonBabble

just use C

It's C+1 which is like 2C which is more good better

If you don't understand C fully don't fuck with C++ yet. To do so would be retarded and put you in the same camp as retard pajeets coding web apps and shitting up the whole ecosystem

C++ is so complex not even stallman could write a proper compiler for it

Just use C

This
I made the mistake of learning C++ first. Don't. Start from the ground up. Learn x86 asm if you're interested

C++ is great as a second/third language. Haskell or Scheme is better for beginners.

C++ is best language. People who say it's too complicated are pajeets.

It's a confusing and inelegant cluster fuck. Unfortunately, it's also the best we have in terms of systems programming.

I wouldn't say you have to lean assembly/stack frames/all that shit, but knowing how C really works on a lower level makes the language that much clearer and puts you on much better footing.

I'm a C++ veteran, actually have my name as a contributor on a handful of C++20 proposals.

I learned BASIC, Pascal, 6502 & x86 assembly, and then C, in that order, before I started getting into C++ in the 90s. Would go on to learn Lisp, Scheme, Haskell, and tons of other languages. Most of the people that I've worked with who have only learned say only Java/C# followed by C++ just simply lack something that makes it impossible for them to write clean, elegant and efficient code. Definitely recommend what the others have suggested, learn other languages and expand your horizons.

It's and incredibly complex language, but hopefully things are getting better so that the complexity becomes more manageable. It will never be a "batteries included" language, but the libraries it does provide are rigorously defined unlike many other mainstream languages. C++20 contracts (similar to Ada/Spark contracts) will make invariants enforceable at the compiler level, so library implementations will benefit.

At some point, if you end up doing lots of template/compile-time meta programming, you'll come to the realization that there's a lot in common with pure functional languages like Haskell. Boost.Hana for C++ uses a lot of the same terminology from Haskell, for instance. C++20 ranges are going to make doing functional or data-oriented design style programming a lot more viable and fun. There's going to be a lot of emphasis on making use of immutable & flat data structures, lazy evaluation and concurrent algorithms going forward. Only real way to safely scale with more cores. Would recommend checking out Ivan Čukić's recently published book, Functional Programming in C++.

My biggest pet peeve these days isn't so much with the language, but rather having to deal with all of the existing C++ programmers who don't care to put in the effort to relearn the language. Lots of guys still programming like it's 2003 and I don't have the patience to be a good teacher.

A well formatted, informative post on Jow Forums from an educated member of the industry?

Impossible.

Attached: 1536496534855.png (355x398, 161K)

Literally ignore this. Start from the top down. Learn high-level design and algorithms and work you way downwards. Ideally start from a mathematical perspective.

This guy has it 100% right. And afterwards template meta-programs are easy to write if you treat them like haskell with terrible syntax.

asm is definitely not mandatory but totally worth it if you're interested in learning about compiler optimizations.

Actually, do both. Learn assembly and some ML-family language (maybe Standard ML or OCaml rather than Haskell, which is basically the C++ of FP), realise what is annoying to do in each and then move towards the middle.

I remember watching one of Eric Niebler's (author of ranges and range-v3) talks where he mentions a paper published talking about the benefits of ranges for heterogeneous computing and how with C++ we can compose many view-adapters together and create, compile and execute them in a single kernel on either the GPU or CPU. This is kind of similar to what Eigen currently does with expression templates but this could be adapted for any kind of executor.
That shit is amazing. I can't find the paper but I found some slides. cppedinburgh.uk/slides/201704-towards-composable-gpu-programming.pdf

I'm here for the leadup to CES and the Ayyymd vs Shilltel memes. Hoping it'll be as exciting as the AMD GCN vs nVidia Fermi days.

This. If you know something with function roots like Lisp or Haskell, the bizarre shapes of template metaprograms finally make sense.

At this point, it's a /v/ shitpost competition, and considering that Intel's game is looking pretty bad, I think AMD's going to be the victor in this one.

Yeah, that shit is happening for real. nVidia, Codeplay and other devs are wrapping up the various C++20 executors proposals and working on receivers/senders for the future. Basically, it will allow for tighter integration with CUDA or SYCL and offer a unified API to make use of heterogeneous computer resources.

*compute resources.

Not impossible, but extremly rare, and we found the one out of a million

C++ is like cursive, niggers can't read it.

It's an abomination of a language that should have never been.

Here's a tl;dr.

Attached: 4skcofasa1p01.png (1452x2208, 843K)

While we're using spongebob analogies.

Attached: r_1464512_LrfhG.jpg (753x999, 118K)

Broken, unparsable language that actively hinders your attempts at making an organized project. Terrible compile times, terrible standard library, terrible to debug, doesn't have a stable ABI after over 30 years of development.

>doesn't have a stable ABI after over 30 years of development.
What is Itanium

PHP is better.

Dead

Best programming language ever.
Jow Forums is just too stupid for that.

Right, but the itanium ABI was used as the standard for most architectures in the linux world..

>a human is a kind of animal
>a dog is a kind of animal
>therefore a human is a kind of dog

Attached: 1542066855265.jpg (572x303, 32K)

>==
>is a kind of
wat

C++ the laziest way to get most of the functionality of c without all the lines of code. C++ unless youre making prosthetics/robots welcome to distant past. Just use python it has most of the functionality is much more relivant in ai development and has a much larger community that isnt just straight engineers hell even java would be more useful

>==
>===

It's okay user, syntax is hard.

>0 == []
>number 0 is a kind of empty array
wat

C++ is like English, overly verbose, highly complex, irregular, and is only used due to its popularity.

honestly just use c once you understand c move to c++ since c++ is just implicit C in a nutshell

Type conversion is implied when you chose to use == instead of ===, hence what said. Your fault for not understanding basic syntax of a given language.

The absolute state of this board

the point is that the basic syntax is bad, not that it's impossible to understand, you can define == to be anything, doesn't mean it's a good idea just because anybody that reads the definition can understand it

Tell me about it. Full of retards who think an operator in one language means exactly the same thing it does in another language.

>the point is that the basic syntax is bad

So, it's bad that there's an operator that checks for equality with type conversion and a separate operator that checks for strict equality? Doesn't sound bad to me at all. You may not like that 0 and an empty array are equivalent after type conversion, but 1) that's not a syntax issue and 2) any specialized language will prioritize functionality like that where it benefits writing code for said specialized application.

>just use the tool you like instead of the one that is appropriate for the task
Thanks, but I'd prefer not to use bloated and slow python programs on my desktop.
>AI development
99% of real world use cases of AI involve spying on people.

A good programming language has sane defaults, and it's rare that you want this kind of behaviour.

== should be strict equality and === should do the type conversions, that way it would be harder to accidentally fuck up.

Real programmers design and implement their own language

Excellent post.

The thing is, most of the time you want strict equality anyway, if you care about writing code that actually works correctly and predictably.

>My biggest pet peeve these days isn't so much with the language, but rather having to deal with all of the existing C++ programmers who don't care to put in the effort to relearn the language
THIS 100%

I love C++, but I hate other C++ programmers

>english
>highly complex
Do you know any other language besides English?

Yeah, Mandarin. No grammar. Absolutely good for healthy.

>well-formatted
you mean reddit spacing, redditor

>what are paragraphs

You have to go back.

x+1 != 2x you fucking nigger

Kill yourself.

it does for x=1 retard

@68825233
nice addition, i learned so much

>Reinventing the wheel.

Sounds good.

that is the problem with c++
nearly all the c++ programmers are shit
and it is nearly all the time a group project you are in, so you are fucked no matter which type of c++ coder you are

>x86 asm
:puke:
Start with MIPS, its super easy and nicely designed

Can't even in providing actually good hashmaps. Still a better option than C.

There is nothing wrong with having both weak and strong equivalence. But weak equivalence should remain an equivalence relation (transitive and reflective).

>syntax isn't bad
>talks about semantics
what did he mean by this?

try tsl::robin_hash or tsl::hopscotch_map. They're fast header-only implementations of hash-maps.

Once upon a time there was C. People didnt like C, it was too high level, too slow. Then computers got better. Hmm ok I will use C. Then people like C because now I can reuse source on different hardware. Then a mouthbreather came along. I want to structure my program so that it reflects my intuition about how things should relate to each other. And so came C++. But then someone said, we are too far from the metal now. I dont need what C++ offers. And so C++ tried to be everything to convince them and became garbage instead. The End.

this.

It's a programming language.

Are arrays continguous in Java too?

Nice story.

C++ needs to be abolished. It is a terrible programming language.

C++ is not the problem, you can write pretty nice code in C++11. The problem is C++ programmers.
The language makes it so easy to write really bad code and abuse the shit out of new delete inheritance ect.

>you don't have too
Except you do. Sure, you can mash the keyboard and spam compile until whatever garbage code you wrote finally Just Werks; but at the end of the day, until you get a full understanding of what's happening under the code, you will never be writing the most efficient or fastest code.

C++ is amazing. Of course it has few downsides and ugly syntax in few places but overall is nice.
It's the best thing to be used to compile to machine code and is easy to debug (unless you are using generics). Good thing is you have Boost and STD plus you can use C libraries with it.

This is not how logic works. You only have an implication:

"Socratus is a human" ^ "All human are mortals" => "Socratus is mortal"

(Notice the direction the arrow is pointed at) If we have a "=>" (if) , we can only go one way. Using a "" (iff) here (what you tried to do with your picture), would lead to the following:

"Socratus is mortals" "Socratus is a human" Which could be rewritten as "It is a human", "therefore it must be socratus and mortal", which leads to a contradiction: I am mortal but not Socratus.

The logic you used clearly states that the two statements are bound as the following:
[ a => c & b => c ] =/=> [ b => c ] In such a case, we would have:
[ "0 => []" & "0 => '0'" ] =/=> [ "'0' => []" ]

However, if these expressions were bound by a "" sign, we could assume that:
[ "0 []" & "0 '0'" ] But this leads to a contradiction, we can never have [a b & a c ] where c =/= b.

What? g++ is fine.

If you enjoy bugfixes and kludges marketed as features, then C++ is the language for you.

On the other hand, if you don't like hacky, fragile, and unstable programming languages, use literally anything else.

I prefer seg faults as it seperates the men from the boys and subhuman scum. If you can't trace your code and figure out where a segfault is coming from you should switch to new media or something.

Really dumb programmers who like to take on huge projects for no reason and lose sight of whatever they were trying to do.

unironically based and redpilled

Seg faults aren't even as big of a deal as people say. Sure it sucks because it crashes the program, but there are so many other ways to introduce bugs. Often I find it easier to debug a seg fault than some incorrect result.

Where’s the PHP version?

C++ is a unique challenge as you will be dealing with both high level and low level programming. If you spend your time learning low level, you'll be confused by the high level, if you only learn high level, low level stuff will bite your ass.

IMO to get the most done with the least amount of learning, you should focus on high level C++ and only go to low level when you need to. Stick to using libraries never write anything yourself if you can get away with it unless you just are doing it for the learning experience.

That being said, you will never be a great C++ dev unless you learn everything, starting from assembly, to C and up, but the same can be said for any programming language or discipline in general.

Just focus on a project and ask yourself "what's the least I need to learn to accomplish my goal", the projects will help motivate you and give you a broader education than just learning concept by concept.

Eventually after a few private projects you will be able to contribute on GitHub and find a job.

C++ is the most complex, messy, and powerful. Don't bother if you're easily frustrated and not interested in low level programming. That being said it has the best tutorials.

>relearn the language
i'm learning modern c++ using AoC challenges. lambdas and the stl are comfy desu senpai
// Returns the of the minute with the maximum sleep time
// value.
auto maxMinute = [](const auto &gi) {
return [&gi](auto minute) -> std::pair {
return {std::distance(gi.begin(), minute), *minute};
}(std::max_element(gi.begin(), gi.end()));
};

// Part 1: Find which guard has the most minutes asleep.
const auto &[guard_id1, guard_minutes1] = // structured binding
*std::max_element(guards.begin(), guards.end(), [](auto &g1, auto &g2) {
return std::accumulate(g1.second.begin(), g1.second.end(), 0) <
std::accumulate(g2.second.begin(), g2.second.end(), 0);
});

// Part 2: Find which guard is most frequently asleep on the same minute.
const auto &[guard_id2, guard_minutes2] = // structured binding
*std::max_element(guards.begin(), guards.end(),
[&](auto &g1, auto &g2) {
return maxMinute(g1.second).second <
maxMinute(g2.second).second;
});

// Retrieve the sleepiest minute for the sleepiest guards found.
const auto &minute1 = maxMinute(guard_minutes1).first;
const auto &minute2 = maxMinute(guard_minutes2).first;

Iterators are still some of the most retarded shit I've seen desu

yeah they're ugly and tedious to write, but flexible & powerful at the same time

The language is garbage, even though the ideas are great (on paper). OOP doesn't help one bit either to the language.

If there are any beginners here, learn C++ later on, but don't use those methodologies in your personal projects. You'll hit so many brick walls in the design aspect while using C++ language features.

Shit written in C++:
Operating Systems, Drivers, Kernels
AAA Video Games
Compilers
Extensive/complex software
Internet Browsers
Multitude of Linux software
Databases
High-level interpreters

Depends on what you're doing, of course. You won't write dynamic web content with C++, but you will write an httpd with it.

MIPS is for asians

If you see some of the shit people write in C++, how it absolutely fucks over projects and maintenance it's almost amazing.

I don't know why people are still so liberal with using C++'s feature set.

I used to hate iterators as a noob, but they really are a good feature.

>You won't write dynamic web content with C++
wasm can't come soon enough
then I can write my frontend in sepples too

Attached: Screen Shot 2018-05-09 at 7.28.58 PM.png (1078x1586, 232K)

The API is shit, the idea itself isn't bad. This is rather common with C++ stdlib components.

this is not an argument against c++. you can write shitty code in any language. c++'s problems are all cultural

1) c programmers who come to c++
2) oop niggers
3) google-tier shitty engineers who make no attempt to understand the tools they use

whats wrong with the api? i think you are being a little arrogant in your assessment, i would be surprised if you could design these APIs in a way which improves on what we have now

the problem is niggers who come from c and and just continue to write c even though they decided to switch to c++ for some reason.

The problem is that when you use C++ without the bullshit you're just using C with std::vector and std::map.

What people really need is C 2.0. You don't need classes and templates and iterators and operators.
C99 was about two steps in that direction. What else would you add to C 2.0? You could argue about that for years. But I think ideas like restrict and variable length arrays are a good start, even if they went back on that in C11.

>I have never looked at a C++ codebase in my life

The problem is C++ niggers.
youtube.com/watch?v=fbtO-wdohWI