Anonymous
Did you mean C++ is BAD for its OO features ?
No. I said "C" is function based and structured based. But "C++" is Object Oreinted.
Ludovic 'Archivist'
C++ is good for its "Object Oriented" purpose.
Because this was only true like a decade ago
Anonymous
Because this was only true like a decade ago
powerful and strong exploits and shell codes are written in C language, though.
Ludovic 'Archivist'
powerful and strong exploits and shell codes are written in C language, though.
Because yes, for writing exploits that you run once for demo purpose, you use C
Ludovic 'Archivist'
Wdym by Shell code ?
Anonymous
Because this was only true like a decade ago
NetCat is written in "C language".
klimi
linux is in C
Ludovic 'Archivist'
NetCat is written in "C language".
Reread the "a decade ago" thing
Anonymous
linux is in C
SO true. 👍🏻💪🏻💪🏻💪🏻
klimi
its just a fact
Ludovic 'Archivist'
klimi
like you are a human
klimi
SO true...
Anonymous
I love you all guys here in this group. I am so excited I found this group. 🙌🏻😀😀
Ludovic 'Archivist'
I'd rather have a whole decoration shop and use paint where I need paint and tapestry where it is better rather than working my way fixing big holes in a wall with paint
Ludovic 'Archivist'
Anonymous
Yeah, this is why I work on another kernel after all...
"ReactOS" is an open source operating system which is very similar to windows. I discovered it today! "ReactOS" is written in C++ I think.
Dima
Anyone ever have worked with c/c++ production project? All these “o C is smaller I can do all that myself” is a time waster thing, that’s where c++ comes to save your time. But yeah, it may waste more of your time and shot thru your leg if you use it wrong
Ludovic 'Archivist'
I think I saw Klimi post about it already here
Ludovic 'Archivist'
I did work with C and C++ in production
Ludovic 'Archivist'
C is just a big nope
Ludovic 'Archivist'
makes you lose lots of time when you are to ensure your resources are handled well
Dima
Modern is too bloated, keep it around 11 and less
Dima
It’s just perfect that way
Ludovic 'Archivist'
Having learned C before C++ also makes you quite capable of blowing legs
Ludovic 'Archivist'
Man
klimi
It's nearly same instructions tho
Ludovic 'Archivist'
Bloated by what ? templates ?
Dima
Mostly stl is
Dima
Itself it’s not
Ludovic 'Archivist'
templates are free for use
olli
Modern is too bloated, keep it around 11 and less
Imo There's no reason to go pre c++11. 14 and 17 are perfectly fine as well.
Ludovic 'Archivist'
Mostly stl is
man, 14 and 17 mostly added templates and real functional programing idioms that quite make the performance better
Dima
Functional programming in c++ lol
Dima
Well I got mistaken, mostly stl is
Ludovic 'Archivist'
Well I got mistaken, mostly stl is
Templates are still not hurting performance
Dima
I am not against templates & co
Ludovic 'Archivist'
Dima
But these allocators somewhere And I just don’t like it lol
Dima
*reasons*
olli
But these allocators somewhere And I just don’t like it lol
That's a reason to go for c++17 and use pmr :)
Ludovic 'Archivist'
But these allocators somewhere And I just don’t like it lol
?! allocators are vestigial from 03 ?! allocators are useful to make stuff: 1. Garbage collected 2. Use a custom allocation mechanism 3. make stl work in a kernel
Dima
I just like to keep it simple and see all stuff that is going on under this
Ludovic 'Archivist'
I just like to keep it simple and see all stuff that is going on under this
Which is pretty easy since STL is pretty much naively implemented and when it is not (example: std::sort) extremely well documented
Ludovic 'Archivist'
The GC used by Firefox for example
Ludovic 'Archivist'
Or by Mono
Ludovic 'Archivist'
Or by my company's internal DBMS
Ludovic 'Archivist'
Or by WebKit
olli
Okay, because there's no such thing in the standard. However I wonder what are the benefits using a garbage collection in c++?
Ludovic 'Archivist'
Okay, because there's no such thing in the standard. However I wonder what are the benefits using a garbage collection in c++?
Reusing arenas of memory allocated before, being sure you don't lose memory for programs that are quite demanding in uptime etc etc
Ludovic 'Archivist'
and also, implementing other languages in C++
olli
The thing I like about in c++, in contrast to other programming languages, is the deterministic object lifetime.why should I spawn another thread searching for unreachable objects (aka garbage) if I can use principles such as RAII?
Ludovic 'Archivist'
It gives you room for error, particularly when using fibers in C++
olli
I know a lot of environments where such an possibly undeterministic memory handling algorithms are forbidden to use
Ludovic 'Archivist'
RAII is good tho, but sometimes, it is not better to use refcounts than GC
olli
Ludovic 'Archivist'
Ludovic 'Archivist'
which is the best alternative to GC in heavily multithreaded environments
olli
Of course you can implement it using RAII
olli
But in contrast to shared_pte RAII is a language concept
Ludovic 'Archivist'
But in contrast to shared_pte RAII is a language concept
shared_ptr cannot be implemented another way than RAII
olli
That's what I was trying to say
Ludovic 'Archivist'
And Multithreading is not, yet it is in practice a very used element of the language
Ludovic 'Archivist'
now show me how you handle deterministic lifetimes without shared_ptr or GC or copies in a multithreaded environment
olli
but shared_ptr is not GC
Ludovic 'Archivist'
but shared_ptr is not GC
It is an alternative, uses refcounting over atomics, and is slow as per its memory constraints
olli
Correct but you can tell when an object is destroyed or memory freed.