Anonymous
Templates allows you to optimize code for specific case Void* doesn't and makes you to do an extra indirection which is not a way to performance
Anonymous
You can import everything
Anonymous
Even headers!!!
Anonymous
Can you believe it???
Alex
You can import everything
thanks, one more issue: what about export in c++?
Alex
do you 'export' keyword?
Anonymous
What's the problem?
Alex
it was intended to resolve header template issue
Alex
What's the problem?
some compilers supports, another no
Anonymous
everywhere: human read, compilation errors, include template in header or not.. by the way modules are coming in c++, so new issue: mixing #include and module in c++. nice job
also, kernel code isn't human readable either. you need to study for weeks before starting to see the patterns. same with templates
Anonymous
Alex
what about throw specificators in c++? what about auto ptr?
Alex
Throw and auto ptr are deleted
they are deprecated, still is possible to use
Anonymous
wrong
This shit in pre C++11 1) was never in the standard 2) only one big frontend compiler supported it and then removed it
Anonymous
So please do not make it your argument
Anonymous
because system programming hard, not C
there is no such thing as hard. just "haven't studied the topic enough".
Anonymous
they are deprecated, still is possible to use
https://en.cppreference.com/w/cpp/memory/auto_ptr https://en.cppreference.com/w/cpp/language/except_spec Please check info before you say something
Anonymous
The topic is closed
Anonymous
do you use c++20 compiler?
Most of it was removed in C++17 if you read correctly
Anonymous
do you use c++20 compiler?
And I just don't use deprecated shit
Dima
auto_ptr is a nightmare
Anonymous
do you use c++20 compiler?
Read some C++ core guidelines
Anonymous
What? 🤔
If you don't know this words, google them
Renan
What? 🤔
C is great, if you know what you are doing. 🙂
Anonymous
goto cleanup; That's all C
Anonymous
Forgot? Get a resource leak!
Dima
modern c++ is not compact af and is just becoming retarded
Dima
if you treat C more than enough, then you’ll get what you need without leakin'
Anonymous
if you treat C more than enough, then you’ll get what you need without leakin'
Yes, in large codebase that you have no clue about? Good luck!
Mar!o
just use Rust
Mar!o
Chill Rust just has some great features if you like it or not
Mar!o
It is the most loved language for a reason
Mar!o
xD
Anonymous
just use Rust
reimplement C++ in Rust and call it R++
Mar!o
D:
Dima
reimplement C++ in Rust and call it R++
don’t let boost and stl community touch it
Mar!o
I want C++++ which is a mixture of C#, C++ and Rust
Mar!o
Idk I don't like D
Mar!o
And somehow its not getting popular
Renan
just use Rust
I told you. Rust's popularity is just increasing. 😅 👍
Anonymous
don’t let boost and stl community touch it
well, they can become roost and rtl if they want
Mar!o
I told you. Rust's popularity is just increasing. 😅 👍
Yeah Rust is cool. It's one of my 4 favourite languages: C, C++, C# & Rust
Mar!o
Wish Rust had a name with C too to have a full C family
Anonymous
Forgot? Get a resource leak!
But it’s not necessary to write like this. And you can forgot to Delete pointer allocated with New. What do you mean exactly ?
Anonymous
There's no destructor or other scoped management
Dark
If you can, can one of yours have a look at my code and see if I am doing something very wrong here. Source Code: https://pastebin.com/WmchiXX1
Dark
The aim is - open exe file and make it a char* - Map the exe - add a section to the exe - write shellcode, return point and jump point to the bytes in char* - rewrite the exe file That was the plan anyway
Anonymous
In C it's the only way
So, modern C++ is more advanced than C. Why people still continue to use C in operating system kernels and device drivers ? Is this because C just captured this field in time and today it’s impossible to do same amount of work because it would be comparable to Apollo program ? This completely ruins idea that one language is better than other.
Anonymous
Sorry for confusion
Dark
Lol
Anonymous
In some cases C++ is just overkill, so it is better to use C and avoid unnecessary complexity.
C++: std::vector<int> elems(n); C: int elemsSize = n; int* elems = malloc(sizeof(int) * elemsSize); ... free(elems); Tell me please what's more complex and more error-prone?
Anonymous
Managing resources by hand IS hard
Renan
Managing resources by hand IS hard
But it is a requirement of every programmer, or at least it should be. Someone has to do the hard work. 😅 👍
Anonymous
But it is a requirement of every programmer, or at least it should be. Someone has to do the hard work. 😅 👍
It's better to do it once (when you write a class for a resource) than every time you use the resource, don't you think?
Renan
It's better to do it once (when you write a class for a resource) than every time you use the resource, don't you think?
I think, but it does not mean programmers do not have to learn it. I mean, someone has to learn to do the hard things otherwise there would be no one to maintain all the comfort of languages like Java offers.
Renan
I think, but it does not mean programmers do not have to learn it. I mean, someone has to learn to do the hard things otherwise there would be no one to maintain all the comfort of languages like Java offers.
In video encoding, for example. The assembly optimization offers massive speed improvements and it is a hard thing to code. But if no one does it, then we would be in the hands of compiler generated code which is many times slower.
Bojan_Krdemn
Hi! I have a class Boggle which has an instance variable gameboard defined in a Boggle.h, for the purpose of testing i need to access the variable from class Boggleplay.cpp how can i do that,
Bojan_Krdemn
?
Bojan_Krdemn
when i try using Boggle::gameboard I get "invalid use of non static data member"
Anonymous
In video encoding, for example. The assembly optimization offers massive speed improvements and it is a hard thing to code. But if no one does it, then we would be in the hands of compiler generated code which is many times slower.
Again My point is you don't need do hard stuff unless you actually need that stuff to be done I prefer using vector instead of allocating bytes every time I prefer using C++ instead of C unless C++ doesn't give much control on generated assembly or C is the only choice
Anonymous
I prefer using C++ abstractions instead of C apis