I wanna talk about C++

I wanna talk about C++

Okay, what do you want to know?

>conio.h

It needs to break source compatibility with C otherwise it won't be able to keep up with new languages for much longer.
Literally the only thing keeping it alive is the massive amount of code that already exists for it.

>It needs to break source compatibility with the codebase
>the only thing keeping it alive is the codebase
confusedanimegirl.jpg

>hello rustlet

>sipote.h

Then it would be mostly useless. Also C++ doesn't need to "keep up".

You don't need source compatibility to be able to link new code with old code.

Nobody mentioned Rust but it's something that will eat into the C++ userbase.

>C++ doesn't need to "keep up"
It's definitely not keeping up.

language is ugly as fuck
namespace ns{
struct time{
std::chrono::high_resolution_clock::time_point t;
time():t(std::chrono::high_resolution_clock::now()){}
/**
* @brief Calculates the duration (from - to)
* I know... It is not a subtraction
*/
double operator-(const time& end) {
return std::chrono::duration_cast(end.t - t).count();
}
void reset(){
t = std::chrono::high_resolution_clock::now();
}
double duration() {
return std::chrono::duration_cast(std::chrono::high_resolution_clock::now() - t).count();
}
};
}

I believe you were looking for this user?


I don't see how source compatibility effects anything.

> Tiobe

into trash it goes.

C++ is falling out of favor because as the field grows more and more retards find their way in. C++ is too hard for them to understand so they need hand holding baby languages like Java, C#, Python ect.

No it doesn't. If you removed that you would halve the language's utility overnight and it would not help in the slightest, nobody would even notice it happened because nobody cares about C++.

What it needs is some positive press to shake off this absurd impression that the language is still like it was in the pre C++11 days It's not helped by universities like my own using C++ as an environment within which to teach memory management, giving almost every single graduate they produce the impression that it's a nightmarish wasteland of pointer arithmetic and heap allocated arrays.

For implementing final builds. Cant see any other use for this.

>pastes first random code found on internet
>never touched a single line of code on c++
>calls the language ugly

W E W
E
W

Java is better in every possible way

>you must be very st*pid or a troll

What's the purpose of pointers? What can you do with pointers in C/C++ that you *can't* do in other languages that don't support pointers?

C++11+ is great but
>I'm still writing const& in front of 90% of my function parameters
>there's no good packaging system so everyone is writing "header only" libraries
>templates are a horrible fucking mess and "concepts" have just recently been merged into the C++20 draft 10 years after they have first been considered
>templates, while they did become very powerful, are just a duct tape fix for a shitty type system
>the standard library has abysmal support for useful threading mechanisms like queues/channels
>just use boost

Rust will become a good language before C++ does.

>doesn't know what pointers are
>doesn't know how memory *does* work

They're useless. Only geeks use them. Real men use references.

They don't really allow you to do anything that was literally impossible in other languages (except that omitting them allows you to stack allocate a complex object in a way that I believe is impossible in Java), they're just one part of a larger memory management paradigm that (almost) totally unmasks the memory system and gives you very fine-grained control over what is stored where and how it's referenced.

>What's a critical system?

>holp
>I don't get low level management

A punk rock band from the early 2000s?

>I'm still writing const& in front of 90% of my function parameters
Is this not optional with any modern compiler? I do it anyway but I have a hard time believing they can't work it out.

>there's no good packaging system so everyone is writing "header only" libraries
Fair, including is still fucked.

>templates are a horrible fucking mess and "concepts" have just recently been merged into the C++20 draft 10 years after they have first been considered
>templates, while they did become very powerful, are just a duct tape fix for a shitty type system
Templates are fine unless you try to do something horrible (read: Variadic). For what most non-library writers will be doing they're easy.

>the standard library has abysmal support for useful threading mechanisms like queues/channels
It does but it's really not that bad, you can build a thread-safe queue in two seconds by strapping std::mutex and std::queue together. It's not ideal but I'll take it over having to deal with the bloated nonsense that is multithreading under Java any day of week.

>just use boost
It's true tho

Man, seeing these posts about how bad C++ is makes me wonder if it was even worth learning it.

Yeah, I hope you're right.

>Is this not optional with any modern compiler?
You mean in terms of performance? Probably. I write it because it's a form of documentation.
But the thing is that most arguments are constant so it would make a lot more sense to make const default.

>Templates are fine
They are not fine. They are only slightly better than Python's "object protocols" because they fail at compile time. And then they produce monstrous error messages.
Relying on method names is a horrible way of creating interfaces. Defining required behavior should be supported by the type system.

>something horrible (read: Variadic)
What the fuck is wrong with variadic templates?
Too hard for you?

>Defining required behavior should be supported by the type system.
It's coming in C++20.

Concepts are an extension for templates, not the type system.
They fix the symptom (incomprehensible error messages) but not the problem (inadequate type system).
The first concepts proposal was slightly better but it was removed in 2009.

I want to make a game and I'm learning c++

I don't want to call for the unity/unreal meme. Bad or good?

Replaced by Rust

They're both part of the type system you fucking retard.

Templates are just templates. Anything you write with templates can be replaced with copy-pasted code.

Not posting full memes, what's this bible reading group?

MUH TYPE SYSTEM THEORY

SUCK MY DICK FP FAGGOT.

You could write this in a much prittier form. You don't even know the language.

i took a c++ class and the prof always told us to include namespace std, but i never see it actually used in code examples. why not?

C++ is shit

real men use C

C is shit
real men use Assembly

namespace std is just the standard namespace, you can use others

Assembly is shit
real men use binary machine codes

binary machine codes is shit
real men have a phychic link with their computer and directly feed it instructions

Psychics don't exist and are shit
real men use magnetic finger tips to modify the data directly on the hard diskette

magnetic finger tips to modify data directly onto the hard diskette is shit
real men wait for random radiation to flip the bits on their disks to produce machine instructions

waiting for random radiation to flip the bits on their disks to produce machine instructions is shit
real men use the 4th dimension to manually birth universes over and over until one creates a hard diskette encoded with machine instructions

wew i dont think i can beat that
you're the true man here

real men beat it every day, son