|
|
Subscribe / Log in / New account

The US military wants to understand the most important software on Earth (MITTechnology Review)

The US military wants to understand the most important software on Earth (MITTechnology Review)

Posted Jul 15, 2022 9:41 UTC (Fri) by adobriyan (subscriber, #30858)
In reply to: The US military wants to understand the most important software on Earth (MITTechnology Review) by amarao
Parent article: The US military wants to understand the most important software on Earth (MIT Technology Review)

Those preincrementing variables in for loop are very suspicious.


to post comments

The US military wants to understand the most important software on Earth (MITTechnology Review)

Posted Jul 17, 2022 5:46 UTC (Sun) by NYKevin (subscriber, #129325) [Link] (3 responses)

Unfortunately, in C++, preincrement is sometimes more efficient than postincrement (usually when the variable is not a primitive type), and the sickness has spread from there back into C.

The US military wants to understand the most important software on Earth (MITTechnology Review)

Posted Jul 17, 2022 13:05 UTC (Sun) by mathstuf (subscriber, #69389) [Link]

Once C++ developers get more into the habit of `for (type x : c)`, hopefully that would stop happening :) .

The US military wants to understand the most important software on Earth (MITTechnology Review)

Posted Jul 17, 2022 22:15 UTC (Sun) by rschroev (subscriber, #4164) [Link] (1 responses)

Why do you consider preincrement a sickness? What are the arguments for preferring postincrement?

The US military wants to understand the most important software on Earth (MITTechnology Review)

Posted Jul 18, 2022 1:53 UTC (Mon) by mathstuf (subscriber, #69389) [Link]

I would guess it is mostly about code churn/noise from contributors flipping from one to the other.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds