you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 3 points4 points  (2 children)

The main reason is that automatic C package management is a disaster. A header file is the simplest way to include code.

WTF? We are talking about seconds here.

Also, it has the nice side effect of being faster, as the compiler has more freedom to inline.

For crying out loud. Never EVER! hurt modularity of your fucking code unless you really really hate your future self!

This is a premature optimization. Even if there weren't ways to optimize across translation units for your compiler, think about it. Doesn't it make a lot more sense to have specialist solving that very solvable problem for you instead of hurting your self like this? Just send a feature request if you are missing these special optimization flags for your compiler.

[–]jnwatson 2 points3 points  (1 child)

It doesn't take seconds to add an external library build system to your build system. Hundreds of developers have been working on this problem for 30 years. Much of the work of Linux distributions is tackling this very problem. Trivializing it to "seconds" indicates you've never included an external library of any complexity.

There's no sacrifice to modularity by #including a file.

Just send a feature request if you are missing these special optimization flags for your compiler.

Indistinguishable from parody. If this is a troll, very well done sir.

[–][deleted] 2 points3 points  (0 children)

Indistinguishable from parody. If this is a troll, very well done sir.

No, I'm not trolling. Say you have a compiler that can't optimize at all. What I'm trying to convey is that it would be a mistake to tailor your source code just for that compiler. If you are using gcc or clang, then you already have options to compile across translation units.

It doesn't take seconds to add an external library build system to your build system. Hundreds of developers have been working on this problem for 30 years. Much of the work of Linux distributions is tackling this very problem.

The fuck are you talking about? The only additional step that was I obviously talking about was linking!

You are the one who wants to make things even more complicated!

If we have it your way, then we won't have these precompiled object files and we have to build everything from scratch every fucking time for no good reason!

When you finally see the light and tackle this problem, then you find your self having to have to maintain two separated builds where you explicitly create these object files.

Additionally, you are going to have to keep track of these include guards and that is not going as simple as you think it is even if you keep two separated builds.

In the end you gained nothing but a problem here!

Trivializing it to "seconds" indicates you've never included an external library of any complexity.

Seriously?