Which will probably be never.

39 points
*

I mean, all cmake does is run some commands for you. You not understanding cmake errors (mostly) means you don’t understand the errors given to you by the C/C++ compiler.

permalink
report
reply
25 points

CMake can also emit its own errors during the configure step though, particularly if you have complicated build logic and/or lots of external packages.

permalink
report
parent
reply
43 points

Partly, yes. But I also think their documentation is a bit hard do read. Maybe this will get better with time.

permalink
report
parent
reply
44 points

I use rust btw.

permalink
report
parent
reply
5 points

I use distcc, and do not have to take vacation for my programs to finish compiling.

permalink
report
parent
reply
10 points

Maybe this will get better with time.

Yes, just give it a few more decades.

permalink
report
parent
reply
29 points

Life is and will always be better writing your own Makefiles. It’s literally so easy. I do not get the distaste. Cmake is arcane magic. Bazel is practically written in runes. Makefile is a just a glorified build script, but where you don’t have to use a bunch of if statements to avoid building everything each time.

permalink
report
reply
16 points
*

really anyone worth their salt should write perl code to generate makefiles depending on the phase of the moon and if you sacrificed a $chicken, a @chicken, or a %chicken at runtime.

permalink
report
parent
reply
3 points

this is fine until you need autotools which is worse than cmake

permalink
report
parent
reply
6 points
*

It’s one of those massively elegant concepts of the past that’s become unfashionable to learn pretty much just do to time and ubiquity.

permalink
report
parent
reply
4 points

Manual makefiles don’t scale though and you end up needing some other bootstrap framework pretty quick.

permalink
report
parent
reply
1 point

How the heck does a Makefile not scale??? That’s all it does!

permalink
report
parent
reply
6 points

That works until you need to support Visual Studio or Xcode. Then you either maintain their stuff manually too, or you get CMake to generate all three. I don’t love it but it solves the problem it’s meant to solve. The issue is people using it when they don’t need to.

permalink
report
parent
reply
3 points

Xcode implies MacOS, you can use make there too, just beware that some commandline tools take different arguments on BSDs.

permalink
report
parent
reply
1 point

You can build with mingw64 built with msvc and use more or less the same Makefile. As for Xcode… well, there’s not really a good reason to support Mac. On principle I wouldn’t even try

permalink
report
parent
reply
3 points

I’m not familiar with either why can’t you use Make with VS or Xcode? Can you not set them up to have whatever build bind call Make ?

permalink
report
parent
reply
1 point

Tbh I’m not sure if you can. That’s proprietary IDEs for you.

permalink
report
parent
reply
2 points

That’s like one thing ML can actually help with XD cute cat

permalink
report
reply
2 points

I forgot to assign a variable, now it crashes %5 of the time. It’s wild how c doesn’t default variables to null or something.

permalink
report
reply
9 points
*

C does exactly what you tell it, no more. Why waste cycles setting a variable to a zero state when a correct program will set it to whatever initial state it expects? It is not user friendly, but it is performant.

permalink
report
parent
reply
1 point

It wouldn’t be that much processing compared to the rest of the app. It would lot more efficient than running an effectively infinite loop or arithmetic on an arbitrarily large number as a result of an unsigned variables.

permalink
report
parent
reply
7 points

Except that this is wrong. C is free to do all kinds of things you didn’t ask it to, and will often initialize your variables without you writing it.

permalink
report
parent
reply
1 point

Machine code would be a better example of what he’s talking about imo. Not an expert or anything of course.

permalink
report
parent
reply
13 points
*

default variables to null or something

That is such a bad idea. Better to have the compiler warn you about it like in Rust, or have the linter / IDE highlight it.

permalink
report
parent
reply
1 point

If it’s going to compile without any warnings I’d rather the app crash rather than continue execution with rogue values as it does now.

There is so much room for things like corrupted files or undocumented behavior until it crashes. Without the compiler babysitting you it’s a lot easier to find broken variables when they don’t point to garbage.

permalink
report
parent
reply
3 points

Just enable all compiler warnings (and disable the ones you don’t care about), a good C compiler can tell you about using unassigned variables.

permalink
report
parent
reply
6 points

This was solved by moving to bazel. It’s a bit more verbose and resource heavy, but the language is sane and how you structure your build code makes a lot of sense

permalink
report
reply
2 points

I have legitimately never met a single person in real life who has anything positive to say about bazel, and I assume it it because they have all killed themselves.

permalink
report
parent
reply
-1 points

That’s not a nice thing to say. When you grow up perhaps we can continue this discussion

permalink
report
parent
reply
5 points
*

Based on this comment*, I’ll migrate a large project to bazel now. I’ll report how it goes.

  • disclaimer: the comment just pushed me over the edge
permalink
report
parent
reply
1 point

Good luck, from my experience with bazel it may go smooth if you have someone who can into bazel to help you, and you create the project from scratch to then maintain small changes. Then there was my attempt to migrate an existing Java project to bazel without external help that failed hard (maybe the situation improved from 2021).

permalink
report
parent
reply
3 points
*

Not sure about java, but I migrated a fairly big c++ project knowing only the basics of Bazel. Disclaimer: I know the codebase extremely well and we don’t have any third party dependencies and the code is c++ and some python generators, validators, etc (which fits the bill for Bazel perfectly)

What I found super hard were toolchains. It’s very verbose to define a toolchain

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 3.4K

    Monthly active users

  • 809

    Posts

  • 12K

    Comments