News for hackers. Stuff that matters.
Re:I learnt C++ in 2018 and have no regrets by lmm on Monday January 07, 2019 @10:58AM (#18846194)
Examples? As a maven advocate I've commonly seen this claimed ("we have to have an ant build because we need to do x/y/z custom thing") but I've never seen an example that held up under scrutiny. E.g. there's no reason any project would ever need a custom source directory layout. No project needs to run tests before compile (and if you really need build step x to happen before build step y, you can always separate them into separate modules and use the normal "module z depends on module w" functionality that any decent build system will have). I've never seen a case for a custom version-numbering scheme that holds up. I've never seen a case for custom VCS release tags where the benefits actually outweighed the costs. All the custom hacks that make for incomprehensible builds turn out to be replaceable with at most a few lines of code or, in very rare cases, a plugin that follows the normal rules of plugins in that build system.
Re:I learnt C++ in 2018 and have no regrets by phab on Monday January 07, 2019 @11:39AM (#18846689)
Because legacy.

Maybe one can't reorganise the source tree layout because to do so would break our custom tooling / integration systems / interface with proprietary vendor tools. We can't change version numbering schemes because our packages already exist 'in the wild' and can't be changed mid-sequence without causing both technical and user pain.

Fundamentally: the codebase has worked perfectly well this way for the last 20 years; what's the business case for changing it (at potentially significant cost) just to be compatible with XYZ new tool that everyone is rallying behind?

Re:I learnt C++ in 2018 and have no regrets by gpderetta on Monday January 07, 2019 @01:08PM (#18847993)
> Because legacy

Yes. And there are codebases that are going to outlive thee shiny tool of the month (or the decade, even).

Re:I learnt C++ in 2018 and have no regrets by lmm on Monday January 07, 2019 @04:32PM (#18850357)
> Maybe one can't reorganise the source tree layout because to do so would break our custom tooling / integration systems / interface with proprietary vendor tools.

That hardcodes the source layout? I don't buy that a tool that's being sold for money would do that (precisely because there's no standardization in the C++ world; any tool that wants to have more than 1 customer will have to support more than 1 directory layout), and if the tools are internal then by definition you have the ability to make changes to them.

> Fundamentally: the codebase has worked perfectly well this way for the last 20 years; what's the business case for changing it (at potentially significant cost) just to be compatible with XYZ new tool that everyone is rallying behind?

Well, if you make adopting good tooling in C++ harder than switching to a language that already has good tooling, don't be surprised when developers do that.

Re:I learnt C++ in 2018 and have no regrets by delusional on Monday January 07, 2019 @05:36PM (#18850976)
> and if the tools are internal then by definition you have the ability to make changes to them.

I happen to work in a shop with problems that look somewhat like this. We have a non-trivial amount of legacy code, that we just don't have the resources or motivation to fix. In those cases, we've found that the cohesion of doing it the same (wrong) way everywhere is easier to work with than doing it the new way in some places.

Re:I learnt C++ in 2018 and have no regrets by phab on Tuesday January 08, 2019 @06:09AM (#18854736)
> I don't buy that a tool that's being sold for money would do that

If you work with proprietory hardware (think FPGAs), if you want to use the hardware, you have to use proprietory vendor tools, whether you want to or not.

> if the tools are internal then by definition you have the ability to make changes to them.

This misses the point. Having the technical ability to modify the tool does not equal having the real-world-practicability, business-case-defendable ability to change the tool.

> Well, if you make adopting good tooling in C++ harder than switching to a language that already has good tooling

The point is that in a 20 year, n-million line codebase, neither is "easy", and the pragmatic solution is to do neither.

Re:I learnt C++ in 2018 and have no regrets by bdamm on Monday January 07, 2019 @12:00PM (#18846990)
Usually this kind of refactor is something done as the very first task following the last release in a minor series and as the first step in a major new release. Going from version 7.4.32 to 8.0.0? Refactor that source tree, reformat all the code, and start over on the build toolchain! Best of all, make sure some junior dev does the actual checkin for the reformat.

In all seriousness, I think this is the only way. Yeah you may have forever to deal with it cross patching but let's face it, for big lumbering code bases, perfect backwards compatibility in the source tree is usually the smallest of issues, and the benefit of using standard tools far outweighs the cost of occasionally reinterpreting back-patches (if they are even possible.)

Re:I learnt C++ in 2018 and have no regrets by gpderetta on Monday January 07, 2019 @01:11PM (#18848039)
Some of these codebases have 10s of millions of lines if not more. Such a refactoring could take years.
Re:I learnt C++ in 2018 and have no regrets by bdamm on Monday January 07, 2019 @02:15PM (#18848877)
The benefit of using widely supported tooling is even greater for large codebases. Automated reformatting is easy, and moving code around isn't that hard if it's going hand in hand with a build system that supports it.

Staying in the cooking pot of ever larger proprietary and exotic hacks is how organizations grind to a halt.

Re:I learnt C++ in 2018 and have no regrets by geezerjay on Monday January 07, 2019 @05:39PM (#18850999)
> The benefit of using widely supported tooling is even greater for large codebases.

Your assertion really depends on your definition of "widely supported". Jumping from fad to fad, however, is only effective as a way to waste time.

>Staying in the cooking pot of ever larger proprietary and exotic hacks is how organizations grind to a halt.

Using established build systems for C++, whether autotools or even plain makefiles, ensures that the project doesn't suffer from bit rot and developers can focus om developing code instead of wasting their time trying out every flavor of the month. And do note that the main reason C++ hasn't adopted any official build system is that each and every flavour of the month ends up being very horrible and very hard to maintain.

Yes, including CMake. If a build system is known for telling essentially all users that they are doing it wrong, that means the build system is the problem.

Re:I learnt C++ in 2018 and have no regrets by unclewaltr on Monday January 07, 2019 @01:35PM (#18848375)
As one (slightly abnormal) example that I've worked on. We would build the meat of the solution, then run our tests. Upon success, we'd generate language bindings (think swig), compile them and run API tests against those. The languages included C++, C#, Java and Excel 12 bindings (which required their own .cpp files). I can easily see this type of special case worm its way in to larger projects and be valid, yes.
Re:I learnt C++ in 2018 and have no regrets by lmm on Monday January 07, 2019 @03:54PM (#18849948)
> Upon success, we'd generate language bindings (think swig), compile them and run API tests against those. The languages included C++, C#, Java and Excel 12 bindings (which required their own .cpp files).

Sure, so you need support for a multi-module project. Any serious build tool will have that.

Re:I learnt C++ in 2018 and have no regrets by groestl on Monday January 07, 2019 @01:06PM (#18847979)
Back in the days when we used Maven, we had an involved asset building system. It was very hard to shoehorn this into Maven's fixed lifecycle phases (they might be customizable now, I don't know) to the point where we had a Maven plugin so powerful, it eventually made Maven redundant.
Re:I learnt C++ in 2018 and have no regrets by lmm on Monday January 07, 2019 @03:56PM (#18849972)
> we had an involved asset building system. It was very hard to shoehorn this into Maven's fixed lifecycle phases (they might be customizable now, I don't know)

They're not customizable, by design. I find people with this problem tend to be missing the option of using a multi-module project: if you need to build A, B that depends on A, C that depends on B and so on, the right way to model that in maven is to have those things in separate modules with dependencies between them. That way your dependency graph lives in the normal maven representation that anyone working on it can understand, and the within-module phase ordering continues to be what anyone working on will expect (compile before test before package, etc.)

Re:I learnt C++ in 2018 and have no regrets by w4tson on Monday January 07, 2019 @12:41PM (#18847606)
On the JVM you have the luxury of a third way which is Gradle. Convention over configuration, standardized builds but with flexibility if needed.
Re:I learnt C++ in 2018 and have no regrets by thomascgalvin on Monday January 07, 2019 @12:42PM (#18847628)
> As a maven advocate I've commonly seen this claimed ("we have to have an ant build because we need to do x/y/z custom thing") but I've never seen an example that held up under scrutiny.

In my experience, this just means they don't know how to do custom thing in Maven. Maven is very configurable; it can do pretty much anything you want, as long as you're willing to throw enough XML at it.

And if you are throwing a ton of XML at it, and your pom file starts to look like a nuclear disaster, that's a good sign that the custom thing you're doing isn't such a good idea after all.