Live data from Hacker News

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

news.ycombinator.com

81–90 of 199 posts

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

#82

Started a new job which requires me to know c++ so I’m learning that. Half c# and half c++. Bought some books. - Effective Modern C++: 42 Specific Ways to Improve Your Use of C++11 and C++14 - C++ Concurrency in Action - C++ High Performance: Master the art of optimizing the functioning of your C++ code If anyone has any recommendations would love to hear them.

effective c++ is a bit out of date but still very good. i read it while learning c++ 'properly' last year and found it very helpful, but it helps to have some knowledge of modern c++ to know what is still relevant. there isn't much overlap with effective modern c++.

I don’t think he’s talking about the old effective C++ book, but rather the “effective modern C++” book as stated in the post.

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

#83
post #49

Earlier quoted context omitted.

AIX... you're bringing back bad memories of running xlc on a AIX 4.3.3 system, back in the early 2000's.

Somehow I had more fun coding on Aix than HP-UX, even though I used HP-UX longer.

AIX is a pretty decent Unix, all things considered. It had a ton of proprietary configuration, but "smit" made it super easy to administer. I was briefly a sysadmin of an HP-UX environment, and it was not fun.

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

#84
post #50

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…

> The standard library is definitely painful to use in places (streams, chrono, etc) but all things considered, I still prefer it to Rust. Is that because you’re already into C++, or because Rust is hard to learn, or because Rust’s standard library is somehow painful, too?

Should have been clearer - Rust wins when it comes to the standard library, but I dislike the syntax and prefer C++ the language.

I think the relative ubiquity of C makes transitioning to C++ a lot easier. If you wiped my memory of the last 20 years of programming and forced me to learn both C++ and Rust from scratch, maybe I'd think differently.

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

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

Oh, I definitely don't avoid them entirely (I'm very liberal when it comes to unique_ptr in particular). It's more about not jumping headfirst into new features that I don't fully grok (or more importantly, when I don't really understand why you might prefer new feature X over old feature Y).

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

#86

I've started using C++ for the REST backend for a mobile app recently. I'm using restinio for the REST layer (sadly deprecated a couple of months ago, but it still seemed like the best option in terms of clean interface) and sqlite for the DB layer. I've architected it all so I have a purely insert-only and order-independent DB on the write-side, so litestream was seeming like a good fit for single-writer, multiple r…

Don't know your use case, but C++ for a REST api seems extreme overkill. Any performance benefits would most likely be nullified by network latency

> "Don't know your use case, but C++ for a REST api seems extreme overkill"

It used to be the other way around: spinning up a VM for handling a simple HTTP request, wasting many megabytes of storage, memory and burning needless CPU cycles on bloated abstractions along the way? That used to be the very definition of "overkill".

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

#87

Almost every game ever. A good deal of stuff where I need complicated algorithms and want performance but don’t care too much about integrating with web stacks (which is always a chore in C++).

>don’t care too much about integrating with web stacks (which is always a chore in C++) Why so? Using Emscripten You can always compile C++/C to WebAssembly (for execution in web browsers).

An arbitrary C++ project cannot most likely be compiled to WebAssembly out of the box. Emscripten needs to be a supported compile target from day one, not an afterthought. Talking from experience.

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

#88
post #63

Yeah, it's one of my two main languages for new projects. I mostly write system tools and cloud-focused tools. For the former I use C++, for the latter it's Go. The portability of C++ just can't be beat. At worst you have to restrict yourself to a certain earlier C++ version (e.g. C++14), but the pure "access" you get to the system is unbeatable. E.g. you need to call exactly these low level functions in exactly this…

Learn Rust. Ignore the foamers who claim Rust is a gift from the divine. Rust is a harsh mistress, however, as it really forces you think about how your program uses memory. That's the "learning curve" everyone talks about, but if you're already steeped in C/C++ and understand how to use memory in those languages, the curve isn't so bad.

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

#89
I'm working on loop modeling and optimization software in C++: https://github.com/JuliaSIMD/LoopModels/ This project was started in November of last year, and is still undergoing rapid development.

C++ is currently the only language, but there will be a Julia frontend. I'm using C++ because I am working with LLVM.

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

#90
99% of my new projects are in C++20, with Qt if they need a GUI.

Here's a couple recent ones:

- https://github.com/celtera/avendish

- https://www.youtube.com/watch?v=fMQvsqTDm3k

- most of the stuff in https://github.com/ossia and https://github.com/jcelerier/

Post reply on HN