Live data from Hacker News

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

news.ycombinator.com

71–80 of 199 posts

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

#71
This doesn't answer your question. I don't have an answer to your question. But I thought some people may find it interesting why I don't have an answer:

I used to use C for some performance critical backend projects a while back but I explicitly avoid C++ because I don't think it is constrained enough and tends to lead to writing code that has side effects. I prefer the "simplicity" of C if I'm going to have a lower level language where I need to memory manage myself.

With that said, the projects I used to use C in are now mostly Go. It has acceptable performance for my use cases and has better memory management and easier concurrency.

One thing I struggle with is I think C++ still has some of the best libraries for certain tasks, especially around GUIs and games. But neither of those are things I work in regularly.

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

#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++.

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

#75
post #65

In terms of LoC, I'm probably at 25% C++, 65% Dart (Flutter) and 10% Kotlin/Swift. Probably not enough to qualify as "main language", but enough that I'm writing it multiple times a week. C++ for the low-level machine learning (Kaldi/ONNX) & rendering (Filament) components, Dart for the service/model/view layers and Kotlin/Swift for hooking things up to native APIs. I can't claim to be a C++ expert but I've found tha…

IMO the C++11 and later features can make it easier to use, less error-prone, and slightly more like Rust. Avoiding them entirely is probably a mistake.

I would concur, having used c++ as my daily driver since before the 98 standard, I prefer the new way to the old on mostly everything. Clang-tidy has modernization checks to help with stuff like that. I don't go trying to use the new features on purpose, but when I do something that has a new way, I do it. Pass by value, move don't copy. Auto wherever I can, but decorate the type on the rhs.

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

#77
I primarily use C, but C++ when the platform/compiler supports it.

I do mostly games and graphical demos on a wide range of exotic and retro hardware, which always has a C compiler, but not always a compiler that supports C++. Also, i feel like i have more control over every bit and clock cycle in C than in C++, although i know it’s technically possible to use C++11 on a Commodore 64.

On projects where i can use C++ i use the following tools: CMake, Clion (IDE), Catch2 testing framework. Often ImGUI for quick debugging UIs.

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

#79
post #65

In terms of LoC, I'm probably at 25% C++, 65% Dart (Flutter) and 10% Kotlin/Swift. Probably not enough to qualify as "main language", but enough that I'm writing it multiple times a week. C++ for the low-level machine learning (Kaldi/ONNX) & rendering (Filament) components, Dart for the service/model/view layers and Kotlin/Swift for hooking things up to native APIs. I can't claim to be a C++ expert but I've found tha…

IMO the C++11 and later features can make it easier to use, less error-prone, and slightly more like Rust. Avoiding them entirely is probably a mistake.

strongly agree. c++ without shared_ptr and unique_ptr is not a language i want to use. although the primary reason i like c++ is templates, so the grandparent poster and i would probably have nearly opposite ideas of what the good subset of c++ is.

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

#80
I created a new programming language and platform for live coding with C++. This demo video https://vimeo.com/manage/videos/732098541 and some details https://news.ycombinator.com/item?id=32181251

Where is C++:

- the programming language

- core library

- media layer with ffmpeg

Then use new lang to build UI layer, IDE, tools and games

Post reply on HN