8 ms·
I don't know. I switched to go a year ago after 10+ years of C++ and, if anything, I realized that C++ was not so bad. Not bad at all. It's old and overly compl
by usrnm 3y ago
I don't know. I switched to go a year ago after 10+ years of C++ and, if anything, I realized that C++ was not so bad. Not bad at all. It's old and overly complicated, but it's also very powerful and even beautiful at times. Go is just bad, the runtime is great, but it's attached to a slightly upgraded version of C. It's not even much safer, I've seen more leaks in this year than probably 5 years of C++ before that.
I know, the post is about C++ and Rust, but I'm tired of this "C++ is abandonware, just switch to a modern language" narrative.
- pjmlp 3y agoYeah, Go is a better C alternative in terms of language space. If one cares about language design beyond the ideas explored in Oberon and Limbo, not so much.
- zare_st 3y agoIf you mean Go is closer to C than Rust is to C, I guess that's correct. But neither are alternatives to C.
- pjmlp 3y agoThey certainly are, outside the religious UNIX and embedded groups that cannot grasp anything beyond C.
- lelanthran 3y agoYou keep going on as if C programmers only use it because they are not as smart as you, who punts C++ all the time. I wonder if you are unable to understand that for some people and some problems, having fewer footguns is a benefit.
- pjmlp 3y agoLots of experience meeting such folks for several decades, since 1993, to be more precisely. Lots of Usenet discussions on the matter, and other places.
- Gibbon1 3y agoYou ever wrote firmware for a wireless sensor that fits in 16k of flash?
- pjmlp 3y agoMy first computer developing software was a Timex 2068. Have you ever produced commercial software for 8 bit machines?
- Gibbon1 3y ago8 bits yes. But can't actually care about the register size of the uP I use. Currently it's ARM. What's important is the RAM and ROM limitations. Plus meeting latency deadlines. Power requirements. That the program never gets shut down for years. That there will be no one to intervene when something goes wrong. Current product I work on has shipped a few million units. If someone needs to replace one that's failed it costs more than the unit itself. It'd been nice not to use C. Be nice if C had a few improvements to make it more ergonomic and safer.
- lelanthran 3y agoIt sounds like a very long winded way of agreeing that you are, indeed, unable to understand why fewer footguns is seen as a benefit.
- pjmlp 3y agoOnly by those that never bothered to understand ISO C legalese, and actual implementations.
- zare_st 3y agoThen those outside groups should make a software foundation that's attractive enough to replace UNIX. I see Debian today tinkering with two additional kernels - FreeBSD and Hurd, and both are written in C. Until some kernel 100% written in Rust/Go/modern C++ starts being attractive for OS integration there is absolutely no point in claiming it's possible and even a better choice. C has lost a lot of ground since 30 years ago, rightfully. User applications with GUI used to be written in something like C89. Games too. It's some people that just cannot grasp that it and its ecosystem have a huge merit over 'alternatives' when it comes to the ground it retained and still holds today.
- BlarfMcFlarf 3y agoDoing a top down rewrite of an OS is an absurd task, so regrardless of merit, C is going to retain its place there by momentum. If it’s going to be replaced at all, it will be incrementally, and until recently, the powers that be have kept other languages out of that space (and for good reason, since multiple languages interacting have complexity costs, again regardless of individual language merits). But we have started seeing just a bit of Rust support in Linux now…
- uxp8u61q 3y agoCan I use Go to program my STM32 MCU?
- pjmlp 3y agoVia TinyGo.
- fsloth 3y ago'"C++ is abandonware, just switch to a modern language" narrative.' I think this narrative is still valid. For the love of god, if you don't need to use C++ for a greenfield project, don't. I say this as a person who needs to write C++ daily. Otoh, if you do need to use C++, it's likely there are no good alternatives, so unless you are Microsoft, Google or Facebook ready to invest few billions to a new language ecosystem, the most pragmatic approach is to, indeed, just use C++.
- GoblinSlayer 3y agoHow much of C++ ecosystem Qt uses compared to the size of Qt itself? Or Chrome?
- Night_Thastus 3y agoAs a C++ dev, I definitely disagree. C++ has a lot of advantages, like an enormous pile of easily-usable existing C and C++ code that you can hook in easily into any project. Chances are if there's a problem to be solved, someone has solved it in C or C++ and the code is out there already. It also has a lot of great support in terms of toolchains. Almost everything everywhere supports it out of the box, and you have your pick of any tools you want. It also works on fairly simple principles, so anyone with experience in programming can work in it without learning a completely new way of thinking. [Even if their code won't be amazing at first]
- fsloth 3y agoI must apologize if the below sounds acerbic. I've used C++ professionally close to two decades and developed a keen feeling of everything that is bad in it. (Still need to use it though). In general I agree with Mark Russinovich. Use a garbage colleted language, and if you really want a non-gc language choose Rust (which I really should learn). https://twitter.com/markrussinovich/status/1571995117233504257?s=20 https://twitter.com/markrussinovich/status/15719951172335042... There are cases when one should choose C++, but those are the exceptions. Graphics, computational geometry and so on are strong reasons to use C++ still. But not everyone needs that stuff. For moving strings and numbers around in a stereotypical business domain there are much better languages. C#. Python. Etc. "an enormous pile of easily-usable existing C and C++ code that you can hook in easily into any project." A lot of it is to help with the fact that the standard library in C++ is anemic. This is one of the reasons though why one would want to use C++. Some libraries exist only in C++, and yes, it's a good reason to use the language. "It also has a lot of great support in terms of toolchains." CMake? VCPKG? Conan? MSBuild? Meson? Scons? Bazel? Make? Xcode? The-android-thingy? How do you mix and match those? All of those are bloody horrible. And their combinations to the second power so. The only good thing in modern times is that most open source projects have picked up CMake with a fairly standard way of project configuration, which enables actually to reuse other's people code with surprising ease. The toolchains make a horrible language a doubly terrible. "It also works on fairly simple principles, so anyone with experience in programming can work in it without learning a completely new way of thinking. [Even if their code won't be amazing at first]" 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. As an example of the complexity choosing C++ over something like C# gives you - To what extent is a C++ codebase cross compilable and runnable in say MacOS after you develop it in Visual Studio on Windows? That's right, you can't tell, the only way to verify your standard C++ has the same runtime behaviour is to run it on the said platform. And fix all the bugs. So to actually write cross platform code, you need to have some proficiency in all of the platforms to have any level of guarantee that the code actually works in it's intended runtime. Thus, a C++ codebase needs to come with a warning label telling every OS and processor it has been tested in. Most popular libraries are tested and run in all of the relevant platforms so this is not an issue for users. But I'm pretty sure the number of platform specific fixes per codebase is not trivial to make something work even remotely similarly.
- jprete 3y agoI think this is a fair view, but C++ has a lot of flaws. It's good enough that it's very hard to justify switching away from it, and it will be a good resume language for quite a long time, but I would hesitate to start any new project in it.
- stackedinserter 3y agoInteresting, it's quite the opposite to me. I've been in C++ programming since TurboVision times (don't miss them), built many projects in C++, but Golang feels like fresh air to me, at least for server applications. Probably it's mostly about runtime/libraries than language itself. Aside of embedded applications and hardcore number crunching (core part of it) I can't find a single use for C++ in 2023.
- linhns 3y agoGames come to mind and anything that needs performance.
- BlarfMcFlarf 3y agoStarting from scratch, Rust is a fine option there, but it lacks publicly available platform integrations, or any engines as powerful as Unreal. It’s to be seen if that momentum advantage can be overcome anytime soon.
- stackedinserter 3y agoOn the core levels – yes.
- thecodedmessage 3y agoI never recommended Go :-) I'd personally rather program C++ than Go, so I can see where you're coming from! That said, C++ is abandonware, switch to a modern language :-) :-)