You may already know that pre-increment/decrement is faster than post, because post creates a copy of the original value before incrementing, whereas pre doesn't, and so you should only do post when you actually need to. With the for loop here it may be a little confusing to some about which is needed; this increment operation actually takes place at the end of each loop not the start, so post incrementation is entirely unnecessary. Your compiler may very well optimise this away for you automatically, but personally I think it's better to always explicitly use pre unless you really specially need post.
Even in debug builds any compiler worth its salt will optimize away an unused value like that, but funny things can happen in C++ with overloaded operators on STL iterators and whatnot. As you mention, it's more correct anyway to write the pre-increment. That said I find that in C# it is basically a matter of style and I don't try to impose this on others (as I do with many other nagging details :p).
Why the start menu gets so much attention on windows is beyond me. It designed to make windows accessible to everyone , from a complete novice to a power user. Hooray if you use the start menu, and Hooray if you don't
It's iconic and a useful accessible place to see all your apps. That was its core goal, and it still delivers that today, in arguably a much simpler, easier to manage way than in years gone by.
I think the key thing to note is MacOS has the Launcher, a place where all apps are listed. Prior to that, a list of apps were only accessible via Finder Apps folder, and the dock was auto populated as apps were installed. With the upcoming MacOS 26? release it looks like Launcher is becoming more menu like, rather than full screen, which I think shows how useful such a feature actually is.
At the end of the day, the vast majority of users will rely on the Start Menu for accessing their apps. While there are many other ways to go about it, it's actually a very well designed, simple, yet feature rich menu (obviously with some issues) that make using a computer so damn simple. And that's why Microsoft needs it, because Windows isn't Linux.
Question
Andre S. Veteran
Conversation split from https://www.neowin.net/forum/topic/1229331-c-need-help-for-converting-roman-numerals-to-decimalinteger/?p=596576971
Even in debug builds any compiler worth its salt will optimize away an unused value like that, but funny things can happen in C++ with overloaded operators on STL iterators and whatnot. As you mention, it's more correct anyway to write the pre-increment. That said I find that in C# it is basically a matter of style and I don't try to impose this on others (as I do with many other nagging details :p).
Link to comment
https://www.neowin.net/forum/topic/1229623-merits-of-using-prefix-vs-postfix-increment-operator/Share on other sites
41 answers to this question
Recommended Posts