Live data from Hacker News

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

news.ycombinator.com

131–140 of 199 posts

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

#131

All our infrastructure technology, services, and almost all “applications” we have built are written in C++. That’s millions of lines of code and span everything from IR, distributed storage and computation, ads serving, relational and columnar datastores, caching and much more. It’s about velocity and experience. Language rarely matters ( and when it does, you can use what’s appropriate ). For us, C++ checks all the…

Above, you wrote >. Most people would say that C++ has lower velocity than other higher order languages, like C#, Java, Python, Ruby, etc. You also include the term > which is a curious combination. In my professional experience, language "experience" dominates most discussions about what langauge to use for a new project. After all, programmers are humans who have biases from their (programming) langauge experience.…

Velocity is about familiarity, about expressiveness, about being able to quickly translating what you want to accomplish to code. It’s also about, for me anyway, not being constrained by inherent limits of the language or runtimes. Like I said, checks all the boxes.

As for experience, I have been writing C since the very early nineties and moved on to c++ soon thereafter.

Again, all that is, for the most part anyway, not specific to this language.

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

#133
I am a developer who has never worked on C++ but want to get into it full time, I did C in college, Java for the first few years in my career then Python and now exclusively Go.

When I pick up new languages and I did that for a bit with Rust, I read a bit then code a bit and found https://github.com/rust-lang/rustlings very helpful. Is there an equivalent for C++? What would be the top resource to get started on modern C++? Thanks in advance.

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

#134

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…

Your last paragraph: I agree with C++ w/ GUIs if you need crazy performance -- oil and gas exploration, medical imaging, etc. If your user is internal / big-corpo, then Java Swing or C#/XAML is totally underrated and boosts developer productivity by many-X. Ugly UI is fine in these cases. I know this from experience. Have you used any of these and what is your experience?

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

#135

I am using C++ for sioyek which is a PDF reader designed for reading research papers and textbooks: https://sioyek.info/ Other libraries used: * MuPDF for PDF rendering * Qt5 for UI * sqlite for database I also recently added a plugin system which is language neutral, but I wrote a python wrapper around it (see and example here: https://sioyek.info/#extensible ).

Wow, this is really great! Just installed it. It is just what I had in mind as an ideal PDF reader. Thank you.

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

#136

I am not using it, but I ran a C++ shop for 25 years. We used it for image pipeline implementation. I can't see using any other language for that (except, maybe C). We did try some other languages, over the years, but nothing could hold a candle to C++. Glad I'm not using it for UI stuff, though. I consider it to be an "advanced engine" tool. Not something that should be used in everyday stuff.

Hi Chris,

Can you remind me: Was your end target platform embedded or desktop? If embedded, I cannot see any other way except C/C++.

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

#137

C++ is still often the best or only way to write performant code on embedded platforms, while having a rich library ecosystem available. Hence, my first choice for a new embedded project is almost always C++. I would love to be able to use something like Rust, but the RTOS options and library support are not quite there yet. With more powerful embedded processors becoming available, Micropython is an option for some…

Real question: You specifically wrote >. To be clear, I am not an embedded systems programmer (nor an HN troll!): Does C also qualify? I heard that sometimes embedded engineers are forced to choose C where the C++ compiler is poor or does not exist. Can you please also share your platform(s) and compiler(s)? I am curious to learn more from an industry insider!

Maybe 10-15 years ago, C was the best option for some microprocessors. These days, good C++ support is pretty universal.

There is always a compiler available from the manufacturer, and often a gcc target.

The AVR family of processors, for example, are supported by the manufacturer's IAR compiler, the ImageCraft ICCAVR compiler, AVR-GCC and several others. IAR produces the fastest / most compact code in many scenarios, but costs $thousands. The ICCAVR compiler and IDE is much cheaper and preferred by many developers. Personally, I tend to avoid pushing the limits of a processor, so the GCC toolchain is most often good enough.

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

#138

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.

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

#139
post #103

C++ is still often the best or only way to write performant code on embedded platforms, while having a rich library ecosystem available. Hence, my first choice for a new embedded project is almost always C++. I would love to be able to use something like Rust, but the RTOS options and library support are not quite there yet. With more powerful embedded processors becoming available, Micropython is an option for some…

I think the RTOS side is being addressed pretty well for rust, which libraries do you feel are missing now?

Last time I looked, RTIC was the most complete RTOS implementation, but it lacked some functionality related to timeout actions in the network stack that I needed (and was provided by FreeRTOS).

Functionality appears to be increasing fairly rapidly though, so I might take another look soon.

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

#140

I am not using it, but I ran a C++ shop for 25 years. We used it for image pipeline implementation. I can't see using any other language for that (except, maybe C). We did try some other languages, over the years, but nothing could hold a candle to C++. Glad I'm not using it for UI stuff, though. I consider it to be an "advanced engine" tool. Not something that should be used in everyday stuff.

Hi Chris, Can you remind me: Was your end target platform embedded or desktop? If embedded, I cannot see any other way except C/C++.

It was mostly desktop (Mac/Win). Towards the end, we did some embedded stuff.

Our code could have been used for embedded, in some cases, though.

The deal was that C++ is fast. Optimization was a big deal. We had some fairly hairy algorithms. Even our deBayering (demosaic) stuff was crazy complex. C++ helped us to abstract the complexity, while enjoying some serious performance.

Post reply on HN