4 ms·
I've never actually had a problem with c++ grammar or syntax or logic What I do have a problem with is trying to interface with more complex apis and functions
by ackbar03 6y ago
I've never actually had a problem with c++ grammar or syntax or logic
What I do have a problem with is trying to interface with more complex apis and functions. For example a while back I had to implement a https get and post request and it was a total nightmare. Something that takes only a few lines in python took a few days to figure out. Maybe it's lack fo experience but I tried wrestling with libraries like pocco which I couldn't figure out for the life of me but in the end ended up writing a monster of a program implementing the winhttp api directly.
I made a similar comment earlier and someone suggested I should have just used libcurl. How to people normally wrestle with these things without going crazy?
- fxtentacle 6y agoBy using libcurl. I run a distributed c++ database and it's one of the most stable components of our stack. Java and Ruby tend to break much more often. Also, you wouldn't want to use Python without any packages, so why insist on the same with c++?
- ackbar03 6y agoIs there some sort of standard / commonly accepted way to manage packages for c++? In python its as simple as pip install + import, and the community is generally in agreement with the best library to use with good documentation. Is there some sort of similar tools I can use for c++?
- reanimus 6y agoYour system package manager, usually, along with something to detect/configure dependencies (autotools, CMake, etc). CMake can be set up to automatically download missing dependencies in some cases, too, and I think there are some other build systems that provide this sort of functionality. But there's not some standard packaging system a la pip or cargo or the like.
- barumi 6y ago> Is there some sort of standard / commonly accepted way to manage packages for c++? As others have pointed out, CMake is the de facto standard in C++. However, a combination of CMake with Conan seems to take care of most of anyone's needs. The downside is that the availability of C++ packages in Conan tends to be very limited.
- boris 6y agoThere is build2[1] and libcurl is available[2] from cppget.org, its package repository. [1] https://build2.org https://build2.org [2] https://cppget.org/libcurl https://cppget.org/libcurl
- srikz 6y agoThere are many. But none of them are considered the ‘default’ way to do it. vcpkg[1] by Microsoft is the newest kid on the block which is gaining some traction. Apart from that Conan[2] seems to be the (relatively) popular one. There’s also Hunter[3] which builds on top of CMake. [1]: https://github.com/microsoft/vcpkg https://github.com/microsoft/vcpkg [2]: https://conan.io https://conan.io [3]: https://github.com/cpp-pm/hunter https://github.com/cpp-pm/hunter
- reducesuffering 6y agoModern C++ with libcurl API’s still isn’t great. I’ve found the Python and Go http API’s much more intuitive.
- saurik 6y agoThis is just a bad library. The library I use in C++ (which I wrote) is pretty much the same as Python requests2 library (or whichever the good one is now... I forget the names as I honestly also rewrite the Python HTTP API layer myself over httplib as the ones that used to come with Python sucked also).
- srikz 6y agoI am piggy-backing on this to ask if there is a good networking library to handle OAuth2 (client side). I came across cpprestsdk[0] but it was a pain to setup with some OpenSSL conflicts unless I use vcpkg. But I need to edit some code in the httpclient class which won’t be straightforward if I use a package manager. [0]: https://github.com/microsoft/cpprestsdk https://github.com/microsoft/cpprestsdk