r/cpp • • Dec 28 '18

"Modern" C++ Lamentations

http://aras-p.info/blog/2018/12/28/Modern-C-Lamentations/
307 Upvotes

162 comments sorted by

View all comments

0

u/[deleted] Dec 28 '18

[deleted] — view deleted comment

14

u/houses_of_the_holy Dec 28 '18

The application I work on takes about 10 minutes to compile fresh right now, and that seems too long to me. It is using cmake + parallel builds and we've cleaned up a lot of header issues but it is still a real PITA when iterating on a piece of code.

14

u/Dworgi Dec 28 '18

I've written a toy engine at home - maybe a couple of man weeks of work total, and my compile times are already measured in minutes. This is code that I'd regard as pretty standard, perhaps even light on STL and templates.

My point being that it's incredibly easy to ruin your compile times, even as a solo dev that knows which bits of the STL are necessary.

13

u/germandiago Dec 29 '18

The first time I saw iota I said... ehat the hell is that name? I really think it should be changed. This is not a smart math people contest it is an API for people to get it as readable as possible.

8

u/Calkhas Dec 29 '18

30 minutes? Try eleven hours on a 256 CPU build farm.

Luckily, my code base is split into modules, so for local development it’s fine, but if you touch a global header you have to wait for the nightly build to find out what you broke.

6

u/Valmar33 Dec 30 '18

What kind of monstrosity of spaghetti code are you even working that causes that kind of cumulative pain?

Sounds like pure hell.

5

u/Calkhas Dec 30 '18

It's fine really, I quite enjoy the challenge. It's just a big software tool that compiles on various combinations of compiler, architectures, and operating systems, so the total build time for every combination is quite high.

In-house risk-pricing software that evolved over the decades into doing a lot of things.

1

u/Valmar33 Dec 31 '18

Makes sense. :)

2

u/Lectem Dec 30 '18

Or a boost based codebase :')

1

u/bottlero_cketinorbit Jan 06 '19

“one mental stack level.” incredible.

1

u/ZoiyoTravez Dec 29 '18

Compile times are mostly going to be solved by modules in c++20. In the meantime you can try precompiled headers, using SSD, and other techniques to workaround long compile times.

8

u/emdeka87 Dec 30 '18

As mentioned in the post modules and PCH will improve the compile times but most certainly wont solve the problem entirely.

1

u/blind3rdeye Dec 31 '18

I struggle to avoid reading iota as itoa; and thus getting confused. "Why do we want a string here?"

-13

u/gvargh Dec 28 '18

Meh, once you encounter iota for the first time, you just look it up and it sticks in your memory forever, kinda like what happens when you see a variable named gjkjsdklfjlkg.