Live data from Hacker News

Ask HN: Who is using C++ as the main language for new project?

news.ycombinator.com

141–150 of 199 posts

Re: Ask HN: Who is using C++ as the main language for new project?

#141

I'm doing a (free) backup system (just a hobby, won't be big and professional like dropbox) for PC, Mac and Linux. This has been brewing since april, and is starting to get ready. To me the choice was between C# or C++, but I ultimately chose C++, because while C# is much faster to code in, when there is a problem, coding directly against the OS, I have much more control in what actually happens and in what dependenc…

I assume this is a command-line application? c++ does have a cross-platform GUI problem, unless you pay for the Qt license that is, which is itself a heavy ecosystem to master.

Qt is LGPL, no need to pay for a license.

Re: Ask HN: Who is using C++ as the main language for new project?

#142
post #47

I'm using C++ for everything because this is all I know.

If C++ is all you know you really should diversify a bit, learn something very different, like a lisp or Haskell. You probably won't come away doing everything in that new language, but it will certainly expand your way of looking at things.

I love programming languages. But there's no reason everyone "should diversify".

If you're fine with your language, that's fine. OP didn't start a flame war. They just said they know C++.

Re: Ask HN: Who is using C++ as the main language for new project?

#143

In the last year: Salt spreader. Micros running C++ and a UI on an RPI with Qt/C++ for the controller. Heat gun. Micros running C++. Afib detector. Micro running C++. Flavor dispenser for a large coffee company. Micos running C++, UI on custom Linux SOM with UI in C++ / Qt Medical imaging device Qt / C++

What's it like using C++ for something like an afib detector? I imagine you can't use much of the STL, _or_ you toss in your own custom allocators to everything.

There is nothing wrong with using the STL in a medical device. Its certainly preferable to worrying about malloc and free. If you can get away with it stick with std::array for buffers. If you need resizable buffers you can create std::vectors with reserved capacity.

All the algorithm stuff in the STL is nice to use. You have do thorough testing anyhow, its better to use something that has a lot of eyes on it like the STL vs rolling your own.

Re: Ask HN: Who is using C++ as the main language for new project?

#144
post #100

I'm using C++ for most of my projects, because I like it. It's also what I do for a living. The latest new open source project I initiated is a dns server, nsblast, using rocksdb for storage. https://github.com/jgaa/nsblast The (side) project I have put most effort into in the last year is k8deployer, a helm like utility that can deploy simple and complex applications in kubernetes with minimal effort. https://github…

Nitpick: it's "authoritative", not "authorative" ;)

Re: Ask HN: Who is using C++ as the main language for new project?

#145

I almost exclusively use C++ for my projects. Especially modern C++. When it makes sense(especially for dev tools), I use Python since for those I'm not so worried about distribution and long-term robustness. Anyway here they are: Qt desktop app written in C++: https://github.com/thebigG/Tasker Simple GPIO front-end for linux GPIO driver(could definitely use some improvement) written in C++ and uses boost: https://gi…

What’s your preferred dependency management strategy?

Re: Ask HN: Who is using C++ as the main language for new project?

#146
post #74

Scientific simulations. Meson as the build system, vcpkg as package manager. Also using it for hobby projects like a custom shell. Modern C++ is a great language and while I'm also using other languages like Rust for hobby projects I still feel the most comfortable writing C++.

I'll second this.

If your memories of C++ are mostly wrangling null-terminated (you hope) char** or writing impenetrable iterator types, things have gotten a lot better!

Re: Ask HN: Who is using C++ as the main language for new project?

#147
I'm building https://codeperfect95.com in C++, but it's more like C with C++ conveniences. I use instance methods, some weird template/con/destructor magic macros, auto, lambdas. Besides that it's pretty much all C. I use normal structs with all public fields, I never use the class keyword. Basically the Handmade Hero/Jonathan Blow style of programming. I'm pretty convinced that a more ergonomic C (which I use the C++ conveniences for) would pretty much be the perfect language.

Re: Ask HN: Who is using C++ as the main language for new project?

#148
Working on robotics apps in C++ at work (with some .py glue)

At home: I work either on personal embedded-focused C++ lib, or on various embedded projects in C++, used to have some .py scripts but getting rid of them, and moving all to C++

In the end, everything is in C++ :)

Re: Ask HN: Who is using C++ as the main language for new project?

#149

Context: I write rust professionally I have no plan of coming back to cpp. Cpp still has the (huge) advantage of maturity. Rust is great but still half-backed. Things like thread-local-storage, custom allocators and async are either unstable or incredibly rough around the edges. Finally, my experience has been that third-party libraries in cpp are fewer but of greater quality than the ones in rust. There are many man…

> There are many many libraries available in rust due to the amazing dependency system. But the average quality is quite poor. The main problem with Rust is that it is thread safe, and that makes code and libraries very hard to write. Thread safety is a lot stricter than memory safety, and since it is easy to write single threaded memory safe modern C++ it gets hard to shift to Rust. But if you want thread safety or…

This is a common misconception. Not all rust code is thread safe. You can use and implement types like Rc which are !sync. What rust enforces by default is concurrency safety. For instance iterator invalidation is something which can occur on a single thread, but rust prevents it from occurring. Of course rust can enforce thread safety as well, but you're allowed to write code which is not thread safe. Contrast this with c++ where it's hard to know the context in which your code will be run so you may end up preemptively making it thread safe, like in the case of std::shared_ptr.

Re: Ask HN: Who is using C++ as the main language for new project?

#150
post #145

I almost exclusively use C++ for my projects. Especially modern C++. When it makes sense(especially for dev tools), I use Python since for those I'm not so worried about distribution and long-term robustness. Anyway here they are: Qt desktop app written in C++: https://github.com/thebigG/Tasker Simple GPIO front-end for linux GPIO driver(could definitely use some improvement) written in C++ and uses boost: https://gi…

What’s your preferred dependency management strategy?

vcpkg is fantastic if all your dependencies are already in there, and still good if you need to add your own ports overlay.
Post reply on HN