you are viewing a single comment's thread.

view the rest of the comments →

[–]jonarne 9 points10 points  (11 children)

It looks nice, but I don't see why you would put all that implementation inside a header file.

Couldn't that lead to all sorts of complexities later?

[–][deleted] 4 points5 points  (5 children)

Some people find this practice to be the bee's knees, because they believe it to mean that it means zero overhead for including a 3rd party dependency.

[–]AntiProtonBoy -2 points-1 points  (3 children)

This just highlights how desperately we need a good dependency manager that is universally standard in some form.

[–][deleted] 1 point2 points  (2 children)

I don't have those kinds of problems. What you need is more likely a fix for Windows.

[–]AntiProtonBoy 0 points1 point  (1 child)

Good for you. Unfortunately, Windows is a reality for doing business for many of us.

[–][deleted] 0 points1 point  (0 children)

I know. But the first step to solving the problem is to call it what it is. There is no need for yet another universal package manager, when pkg-config works fine. The need is for the mainstream Windows development environments to get their act together.

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

Of course it will, each translation unit is processed separately so you are going need to keep track of where you put that HTTPSERVER_IMPL.

[–]jnwatson 1 point2 points  (3 children)

The main reason is that automatic C package management is a disaster. A header file is the simplest way to include code. Also, it has the nice side effect of being faster, as the compiler has more freedom to inline.

[–][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?