6 ms·
I have returned to using C++ over the last six-months after not using it really since university 20+ years ago. I mostly write Python these days, Java in the pa
by avidphantasm 4y ago
I have returned to using C++ over the last six-months after not using it really since university 20+ years ago. I mostly write Python these days, Java in the past, but have also recently written some moderately complex and unsafe C (e.g., making a parser using flex and bison; doing lots of void* pointer arithmetic to get around not having runtime reflection). I am astonished at the complexity of modern C++. I’ve studied Rust and used some Swift (on an iOS app for a client a couple of years back), and I struggle to “correctly” write code in C++. I feel as if C++ is collapsing under its own weight.
- TremendousJudge 4y agoSimilar story here. I'm constantly wrestling with the tool more than the actual problem I should be solving
- curtis3389 4y agoI programmed in C++ all through college, and I get the same feeling watching its development. TR1 brought the language to a pretty good place with smart pointers, and at first C++11 looked awesome with its type inference features and range-based for loops. But, also in C++11 were tons of weird gotchas with new and old features. The one that comes to mind is the uniform initialization. It was supposed to fix the issues with calling regular constructors, so you could just use the new syntax and not worry. But, they also added initializer lists, and those have issues with uniform initialization, so now you not only need to know all the pre-existing issues with the old syntax, you need to know the new syntax and its issues. This all comes back to C++ refusing to break backwards compatibility, which is great and all, but at this point they've made a language that is only good for job security.
- synergy20 4y agowhat exactly are them? I'm also back to modern c++ but I plan to only use a subset of the super set to make life easier. for example I don't need write a c++ library so many of the new (meta-template-programming) feature I don't need to pay attention to at least for now. what I really need are RAII, smart pointer, the STL library and algorithms basically, plus simple OOP use cases, those combined are not very complicated to me.
- intelVISA 4y ago> what I really need are RAII, smart pointer, the STL library and algorithms basically, plus simple OOP use cases, those combined are not very complicated to me. That's just about what anyone needs, I fear most people are simply too deep in their cargo cults these days to reason about a complex lang appropriately.
- gpderetta 4y agoExactly. In fact these days you need less metaprogramming, not more.
- pjmlp 4y agoAgreed, I like to watch metaprogramming talks in a similar vein like solving chess match puzzles, but I hardly use any of that in my own C++ code, and tend to stay away from clever libraries. Best part of latest improvements is that most common mortals don't have to deal with SFINAE, enable_if or tag dispatching.
- qwertox 4y agoI started programming with C and C++ in the 90s and I absolutely loved it. Then big projects with multithreading started to blow up because it became to complex to manage. 2010 I started with Python and absolutely fell in love. Since then I've been using it and never regretted it, until I had to upgrade servers and with it migrate from 2.7 to 3.8, now again to 3.10. There are issues with these migrations which aren't negletible if you're running over 50 different servers, doing different things, where suddenly for no reason at all a function parameter gets removed from some asyncio function, or all the virtualenvs are no longer usable because they were set up with 3.8, which got replaced by 3.10. This makes upgrading an OS very painful as it requires many weeks of preparation, which is something you first need to become aware if. I now have tooling which monitors every running Python process and prints out which modules are used an other things, because there was so much to look after. Basically each Python script has to register it's execution at a central server, but because it can be down, they have to use a local caching proxy server for this. Then again, two weeks ago I started learning Rust and I'm absolutely blown away. I'm completely absorbed by it. I'm now thinking of migrating some of the Python projects to Rust so that I can have a single executable which I can then copy around without having to care about virtual environments. I mean, I loved C and C++ for its precision, and love Python for it's liveliness (I use `reload` a lot so all the projects are living things which support hot reloading), but Rust seems to hit the sweet spot between C++ and Python. Between performance and little dependencies due to the lack of an interpreter, and a somewhat easy to use threading and async / await with Tokio, with all the safety guarantees Rust offers. I'm currently in heaven for this and I hope it lasts.
- eru 4y agoIt's probably best not to run Python bare-metal on your operating system. Or at least not to rely on your operating system's Python. Use a Python package manager, and/or run your Python processes in containers. That way you can upgrade your OS without having to upgrade all Python programs at the same time.
- qwertox 4y agoThank you for bringing this approach onto my radar. It sounds very promising for solving the OS upgrade issue but also let's me finally use the latest version for my projects. I will read up on this. Are there some recommended keywords or things to avoid which I could use to orient myself? Like "use deadsnakes" or "avoid deadsnakes"?
- lloydatkinson 4y agoAll of these sorts of reasons are why I skipped learning C++ and don’t intend to use it. I learned C and then C#. I can’t imagine using C++ after using C# - modern C# and .NET have loads of performance and native related functionality including pointers, Span, AOT, etc. From my outside perspective it seems absolutely chaotic and simply unmaintainable.
- pjmlp 4y agoKind of, except for the small detail that WinDev loves their C++, and leaves to the .NET community the burden to create libraries, or even Windows Runtime components for their APIs, and also has Windows integrations that don't allow for COM implementations in .NET, forcing some of us to keep our C++ skills up to date.