5 ms·
>Make? VCPKG? Conan? MSBuild? Meson? Scons? Bazel? Make? Xcode? The-android-thingy? How do you mix and match those? Almost everything I've seen is in Cmake, or
by Night_Thastus 3y ago
>Make? VCPKG? Conan? MSBuild? Meson? Scons? Bazel? Make? Xcode? The-android-thingy? How do you mix and match those?
Almost everything I've seen is in Cmake, or can be easily interacted with it.
But in general, just pick something you like and stick with it. Sure, they're not perfect, but this list is actually a point I was making - you have a huge array of mature solutions out there already.
>Calling C++ simple is a new one to me. It's an industrial language that is not a total failure. Yes, people can write programs with it. The problem is there are much safer and better languages to write general programs, thus selecting C++ is giving yourself an intentional handicap in term of value created.
C++ is a simple language with complex things you can choose to use. If you understand the basic principles of loops, variables, functions, arrays, etc, you can write in C++ right away. You can layer on greater complexity with libraries and the STL, better patterns etc as you go, but you can start simple. That's a great benefit to someone learning, IMO.
C++ is as complex as you make it. I prefer to write fairly simple C++ personally and only break out the harder parts when absolutely needed. For example, I really don't like lambdas, so I just don't use them. And I can still solve anything I need to without them.
- wiseowise 3y ago> Almost everything I've seen is in Cmake, or can be easily interacted with it. But in general, just pick something you like and stick with it. Sure, they're not perfect, but this list is actually a point I was making - you have a huge array of mature solutions out there already. Installing library is cargo add X npm install X implementation(“X”) Show me how to import library in CMake. And then also show me how to import library that doesn’t have CMakeLists.txt file. > C++ is a simple language with complex things you can choose to use. If you understand the basic principles of loops, variables, functions, arrays, etc, you can write in C++ right away. You can layer on greater complexity with libraries and the STL, better patterns etc as you go, but you can start simple. That's a great benefit to someone learning, IMO. C++ is as complex as you make it. I prefer to write fairly simple C++ personally and only break out the harder parts when absolutely needed. For example, I really don't like lambdas, so I just don't use them. And I can still solve anything I need to without them. Good luck explaining to team that they can only use subset of C++. Also good luck when advanced C++ dev advocates for feature X and now whole org has to learn about X and its drawbacks. Or when the dev leaves and rest of team doesn’t know how the hell it works. Sounds to me like you’re writing all of this from hobby or hobby OSS project perspective. Which is completely fine, but doesn’t apply to orgs.
- Night_Thastus 3y agoI'm writing this from the experiencing of maintaining large legacy C++ projects as well as developing new ones. I only do this for work, not as a hobby, nor anything OS. >Show me how to import library in CMake. And then also show me how to import library that doesn’t have CMakeLists.txt file. I'm not sure how this is a gotcha. I'm not that familiar with Cargo, but I think the equivalent would just be something like: TARGET_LINK_LIBRARIES(myProgramName Eigen3::Eigen) in cmake. Not very hard. Also...why does it matter if there's a cmakelists.txt file? How is that a bad thing? >Good luck explaining to team that they can only use subset of C++ You learn as you go, like literally any other language. You don't need to understand every single line and function call in a program to make changes or add things to it. As you come across something you need to modify, you learn a bit about the features being used. Now, if you have a real go-getter on the team who has covered the entire project in the most advanced features used in the most obscure ways, sure, it's going to suck for anyone just starting. But that's a problem again, in literally any language. And not a fault of C++, frankly.
- wiseowise 3y ago> I'm not sure how this is a gotcha. I'm not that familiar with Cargo, but I think the equivalent would just be something like: > TARGET_LINK_LIBRARIES(myProgramName Eigen3::Eigen) Include how the library gets in your build, not how you link it. > Also...why does it matter if there's a cmakelists.txt file? How is that a bad thing? Maybe because it gets dramatically harder than having `cargo install x`? Or did they solve it recently where any autotools/meson/whatever gets pulled into project without any blood sacrifices to pass all compiler flags properly? > You learn as you go, like literally any other language. You don't need to understand every single line and function call in a program to make changes or add things to it. As you come across something you need to modify, you learn a bit about the features being used. How can you make you changes to something you don't understand and make sure that it still works? Also, this is absolute nightmare from perspective of team and org cohesion. > But that's a problem again, in literally any language. And not a fault of C++, frankly. No, it's not. Aside from maybe Scala, I can't think of any mainstream modern programming language where you have to actively create your own sublanguage to make it bearable.