// Implement
-
This post did not contain any content.
-
This post did not contain any content.
It might be an absolutely adequate method. Imagine that is C++. operator-- is overloaded and controls some machinery. You can't just command capacity = currSize. Process is important.
-
This post did not contain any content.
a logical skeuomorphism, how eccentric
-
It might be an absolutely adequate method. Imagine that is C++. operator-- is overloaded and controls some machinery. You can't just command capacity = currSize. Process is important.
that's why c++ gets bullied
-
that's why c++ gets bullied
That is why it is loved: it allows you to use ideas/objects the same way as you do as an engineer. Super cool.
-
a logical skeuomorphism, how eccentric
Haha! I had the same thought.
-
It might be an absolutely adequate method. Imagine that is C++. operator-- is overloaded and controls some machinery. You can't just command capacity = currSize. Process is important.
Yes. Sometimes you're limited by the hardware you're controlling. This code is a bit hard to justify with that excuse though. Normally your code would do a read from hardware to see if the value decremented and then repeat the write. (Possibly a sleep/yield in there if required.)
-
That is why it is loved: it allows you to use ideas/objects the same way as you do as an engineer. Super cool.
yes, but in this particular case I wouldn't want to second guess my decrement operation just happens to also be calling the white house or whatnot. Just make a method.
-
This post did not contain any content.
-
This post did not contain any content.
If those are normal integers, the compiler optimizes that to a simple compare and branch/cmov.
-
So one understood the assignment.
-
That is why it is loved: it allows you to use ideas/objects the same way as you do as an engineer. Super cool.
But when you do shoot yourself in the foot, it blows your whole leg off.
-
yes, but in this particular case I wouldn't want to second guess my decrement operation just happens to also be calling the white house or whatnot. Just make a method.
It is a method!
-
It is a method!
thanks
-
But when you do shoot yourself in the foot, it blows your whole leg off.
As a shotgun. That's why people don't shoot themselves in the foot with a shotgun.
-
That is why it is loved: it allows you to use ideas/objects the same way as you do as an engineer. Super cool.
Until the next person with a slightly different mental way of defining things comes along. Or just a future version of you.
-
yes, but in this particular case I wouldn't want to second guess my decrement operation just happens to also be calling the white house or whatnot. Just make a method.
You wouldn't second guess the decrement operation if it's a basic type like int. If I opt into using complex types, then I am responsible to understand/establish/forbid the syntactic sugar for it. That's the mindset I often use to program C++
-
It might be an absolutely adequate method. Imagine that is C++. operator-- is overloaded and controls some machinery. You can't just command capacity = currSize. Process is important.
Yeah, just to say it more clearly: that kind of thing is why lots of people out there insist that operator overloading is a bad idea.
And yeah, it's a C++ thing that mostly doesn't happen in other languages.
-
yes, but in this particular case I wouldn't want to second guess my decrement operation just happens to also be calling the white house or whatnot. Just make a method.
wrote last edited by [email protected]That's just life of a C++ programmer: you second guess everything, and there are still optimization you haven't tried, and pitfalls you haven't got into
-
If those are normal integers, the compiler optimizes that to a simple compare and branch/cmov.
wrote last edited by [email protected]for others - https://godbolt.org/z/osaKrxsPx