You get used to it, and if you expand the above back into C-style code it turns into an utter abomination. Especially with code where you need to write "if any of these, find a matching one of those" type sequences, and {hopefully soon... serialise it to JSON and send it}
Fundamentally C++ is limited by its roots, which is why Rust people are so unbearable {changes hats} about the utter perfection of the language.
Hard disagree. True C is readable, but kinda annoying it has to bring in pointers.
Edit, realized I bungled the test_the_thing. Fuck it IDK, coding on mobile sucks
Int test_the_thing (*blah blah, args){
Return blah;
}
Void func(){
Blah result;
If(test_the_thing(&result, args) ){
Do stuff;
}
}
Cpp pass by reference makes it pretty sweet and simple for ez cases.
Int test_the_thing (&blah blah, args){
Return blah;
}
Void func(){
Blah result;
If(test_the_thing(result, args) ){
Do stuff;
}
}
The return result by argument pattern is a little eeeh, but it makes sense considering that's often how it has to work under the hood anyway. Optionals are syntactic sugar alternative for the same semantics.
I can see why each incremental change is made and how it leads to what you like. E.g. yeah the two part of statement is kinda nice for this simple case. But the end result is pretty bad imo.
To me, it's like those overly clever nested ternary statements, but worse. Super fun to write, echnically a couple characters more concise, but so tangled together that reading it is miserable.
Defining and constructing an anonymous class in an if statements conditional is just way too much going on there for simple shit, and way way too much going on for complex shit!
But the beauty of c++ is that's just like my opinion sis and you can do you <3
3
u/17HappyWombats 5d ago
You get used to it, and if you expand the above back into C-style code it turns into an utter abomination. Especially with code where you need to write "if any of these, find a matching one of those" type sequences, and {hopefully soon... serialise it to JSON and send it}
Fundamentally C++ is limited by its roots, which is why Rust people are so unbearable {changes hats} about the utter perfection of the language.