What's your favorite c++ feature Jow Forums? For me it's <functional>

What's your favorite c++ feature Jow Forums? For me it's

Attached: e1a07c7e25d7f42aa8312a852d1af34b25222e.jpg (400x438, 32K)

Rust

Dilate and have sex

My favorite feature of any programming language is that it allows freetards to code for me out of some meaningless idealism instead of pragmatic enlightened self-interest.

For me, it's segmentation faults

I had no idea this guy taught at A&M

Attached: 1545667786271.gif (300x198, 490K)

The "C" part. ++ is bloat.

rust is not a good subset of c++, c is though

I like ints and doubles. Also for loops.

Constexpr. I love making my programs an imperceivably small amount of time faster in exchange for insane compile times that cause ever developer to abandon the project.

Destructors. It's the only reason why everything works. In gnu C we have to use __cleanup__ which isnt part of the standard.

Destructors are great. Related to that: RAII, stupid name, great concept.

My favorite is Qt.

My favourite feature of C++ is }

Why don't they just add Qt or something to the base libraries?

My favorite feature is the freedom not to use this language and instead use a real man's language, like C.

...

RAII

you can literally write C inside C++

Isn't GNU C compiler written in C++?
If you are going to lock yourself in GCC or Clang why not go full C++ and not use a mongrel mutt dialect of C that requires C++ to be developed?

Also, how long until the Linux switches to C++?

Daily reminder that only code-monkeys care about languages while real engineers care about algorithms as they're what're important.

That dude looks 100% like when some mid 20s actor gets makeup caked on and a bald head piece to look late 60s. Wtf

Attached: 1538872455170.png (172x172, 51K)

>>>>>>>>>>>>>>>>academia

this but i always do that
typedef uint8_t byte;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;

>Also, how long until the Linux switches to C++?
lol never

Attached: 2019-08-24-002747_1366x768_scrot.png (1366x768, 19K)

Algorithms + Data Structures
Once you have the right data structure the algorithm almost writes itself

Attached: 9130UP5DUYL.jpg (1931x2560, 615K)

You need to explicitly cast the return value of malloc, calloc and mmap

for me, it's if constexpr. really cuts down on all of the SFNIAE std::enable_if overload bullshit.

My favorite feature is that c++ generics are turing complete

yeet

Once Linus steps down I give it a year.
Of course by then Linux will be such a mess (Linus is what's keeping Linux good) that no one would care.

void pointers are cancer

then how do you make arrays without using vlas?

>What's your favorite c++ feature Jow Forums?
For me it's being able to ignore C++ at all and write decent C with the same compiler.

My favorite C++ feature is completely unreadable error messages if you ever use anything with templates. Made me look for a better language, the best decision I ever made in regards to programming.

>No move semantics
>No templates
>No constexpr
>No OOP
>No RAII
>No type safety
>Everything is a pointer to a pointer to a pointer
yeah no

concepts will fix this and then you'll have no excuse

>hurrr i only quit c++ because it wasn't good enough for me
keep telling yourself that, user.

>concepts
Wtf is this?
What are they adding now?
When will the madness stop?
Is C++ a prank that has gone too far?

Write a data structure without generics.

>>No move semantics
Lol
>>No templates
Void*
>>No constexpr
Bloat
>>No OOP
Good
>>No RAII
Good
>>No type safety
Good
>>Everything is a pointer to a pointer to a pointer
Good

Another feature that nothing will utilize for the next 20 years, like the spaceship operator.

>Everything is a pointer to a pointer to a pointer
>implying an object reference isn't a pointer pointing pointers pointing pointers.

If C++ is so good why Rob Pike and Ken Thomson invented Go?
Why Google is using Go instead of C++?
Why was Java and C# created if C++ is so good?

>Bad
Good

Attached: a1Q4VyG_460s.jpg (460x454, 23K)

lets you constrain what types can be provided into template arguments. for example, if your dumb ass tried to pass a std::thread into a generic numerical algorithm, instead of giving the error message you described, you'd get back a "std::thread does not satisfy Numeric."

>using generics

lmao

bandwagon fallacy is not an argumen

bad bait

The answer to all three is H1B

>write a data structure without generics.
Is this what C++ does to people?
I can write data structures with anything.
C++ was a mistake and a code monkey language.
I can make elegant data structures with C and void pointers without leaks.
Fuck the unnecessary complexity of C++.

i want metaclasses and i want them now
someone yell at the committee to hurry up

Concepts are basically something that you already use when writing templates, but you only use it in your thinking, introducing templates to the language will make this checkable by the compiler.

For example if you write something like a sum of some container: first of all the container has to really be a container, so it has to have some properties, you have to be able to iterate over it's elements. So we could define the concept "Container" if it offers an iterator.
Also the elements of the container have to support the + operation, we can call that concept Addable or something like that.

Now if you use a type that does not fit those strictly defined concepts which are checked by the compiler, it will give better error messages.

It's kind of like in runtime polymorphism all types that are accepted have to implement a certain interface, or be a subclass of some class that fits that generic algorithm, but apparently concepts are more powerful.

C++ is the buzzword language
Dropped

>>No templates
>Void*
want to know why std::qsort is faster than c's sort? because it can optimize for types and doesn't need to spend 10 years dereferencing and casting a pointer. you can complain about a lot of shit about C++ but the templates and generics are an objective strong point of the language especially in terms of performance

>Template system built into the language are unnecessarily complex compared to having to hack together a bunch of void pointers every time you want to have anything resembling generics
You cannot be serious

This is the effect of for-profit universities.

ad-hominem

>>>>Good
>>>Bad
>>Good
>Bad
>Wojak

Attached: 1566288014128.jpg (1280x720, 207K)

>Beliving in zero-cost abstractions

HAHAHAHAHA

It's a preprocessor hack that grew into a second language within C++
It's ugly as fuck

types are zero cost abstraction

u do know most freetards are payed to write open source code.

A pointer is a structure containing an address and length(excluding other bullshit). Void pointer just contains the address part, and can't be used without casting it to a certain type(adding length). How is your clusterfuck template mash better than my simple void?

>payed to write open source code
Living the dream.
Ethical and a nice income.
RMS was right all along.

Believe me, I think C++'s templates are a mess (Rust does generics right imo), but it's better than nothing
templates literally are. they define types at compile time and generate the related code

>complains about the costs of abstractions
>proceeds to use indirection everywhere instead of letting the compiler bake the code and optimize on types

Muh raii, muh zero cost abstractions, muh templates
Linus is right
C++ causes brain damage

>How is your clusterfuck template mash better than my simple void?
By not using a pointer at all. Also it can inline the comparison function because it knows all the types in advance.

paid*

it avoids needing to cast it every time -- literally a negative cost abstraction compared to your void pointer garbage

Consider a 64 bit cpu:

Pass void pointer to my 32bit int to function.
Pointer is stored in a 64bit register, int is stored in a 32bit register. Total = 96bits used

Pass 32bit integer in 32bit register to function. (because templates are compile time substitution). Total = 32bits used

>generate the related code
That's why they suck
I don't like this

>not making code fully custom
>being a retarded zoomer
>using electron
>what is RAM?

XD

It's hard to pick just one... But I really like std::unordered_map. It really opened my eyes to what C++ is really about. Especially with lambdas in C++.

>std::unordered_map
Literally a hashtable, every JS kid used this.

once you combine lambdas and std::function you don't need any more classes

>writing objectively worse code
>being proud of it
>not even understanding how C++ templates work
>projecting

keek

I like how std::vector is not threadsafe, even if all threads manipulate different indexes.

>Thinking lambdas are remotely interesting

lisp more faggot

because a bool is 1bit, but memory is addressed in parts of 8bits wide. creating a bool costs 8bits instead of just 1. std::vector tries to save some memory by packing 8 boolean values in a single byte (hence it's not thread safe)

>If you don't know as much as the machine, how can you trust it?
>If you know as much as it, why use it?

Only faggots trust the compiler

>le assembler maymay
neck yourself

Foo foo(Bar());//creates a function pointer

Foo foo{Bar()}; //fixed your code fag[/spoiler]

>not knowing asm

lelxdlmao

>Literally a hashtable, every JS kid used this
Yes, but C++ was my first exposure to, it, and seeing the implementation made it click.

I've done this.

I hadn't heard of them until I learned C++. Seeing them was cool. Later on when I learned JavaScript, it I saw them again. Before C++ I only learned C# 2005 and C.

>imagine writing code that will only ever work on one cpu family because every cpu family has it's own instruction set and registers

>I hadn't heard of them until I learned C++.
I hope no one has employed you.

Sometimes it annoys me that languages always add new features. Sure, you don't have to use them, but when you apply for jobs, or when you work at a company and always have to be up to date it can be annoying.
I would like to learn other languages or technologies, but I always have to keep up with the new features instead.

C's besst usecase is OS programming, C++ is good for everything else.

>it's own
its
>imagine being illiterate

>No OOP
is that supposed to be a bad thing?

C++ is shit for low level and needlessly obtuse for high level

>I hope no one has employed you.
Well I never had interest in programming as a career. I just learned it from books on my own time. That being said I have used JavaScript and C++ at work, and I picked up PHP along the way.

Don't listen to that meanie.

>hurrr OOP bad because Jow Forums told me so durrrr
OOP is a great programming paradigm that is useful in (almost) all cases. Dont listen to the C'tards

Attached: 1508417922085.jpg (851x714, 80K)

The part where structs get functions attached to them. Everything else is bloat.

kek

Attached: enlightenment_logo_1200px.svg.png (1200x1656, 349K)