Live data from Hacker News

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

news.ycombinator.com

151–160 of 199 posts

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

#151

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…

How much additional dev overhead is there in using cpp for the web?

How difficult is it to manage updates etc?

What are the benefits in your opinion?

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

#152

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…

Came here to write pretty much exactly what you said.

I'm using ESP32-S3 chips in a project. Rust support is really nascent and I can't afford to burn too much time on fixing tooling & recreating libraries. Though it does sound kinda fun.

But I imagine there's a chicken/egg challenge where it's hard to see Rust on embedded platforms get more mature unless it gets more adoption and it's hard to imagine a significant uptick in adoption unless it gets more mature.

Modern C++ is getting a little better all the time. And perhaps someday Carbon could be a smoother path to modernity because of its focus on migrating existing c++ codebases.

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

#154

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.

if you are into videos, there's the back to basics from cppcon which is an absolute god send when you are just starting out.

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

#155

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…

Came here to write pretty much exactly what you said. I'm using ESP32-S3 chips in a project. Rust support is really nascent and I can't afford to burn too much time on fixing tooling & recreating libraries. Though it does sound kinda fun. But I imagine there's a chicken/egg challenge where it's hard to see Rust on embedded platforms get more mature unless it gets more adoption and it's hard to imagine a significant u…

> Modern C++ is getting a little better all the time.

Honestly, this is the reason I haven't moved anything to Rust, despite seriously considering it in the past. I would ditch C++03 in a heartbeat, but C++14 and beyond are very usable.

C++ could certainly be better - I'm hopeful about Carbon - but it's good enough and improving fast enough that if you're already a C++ expert, I think you're pretty happy.

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

#156

Earlier quoted context omitted.

Which languages did you try out?

Swift/XCode (guess I had unrealistically high expectations, the whole experience was just downright infuriating), Seed 7 (somewhat exotic, I liked it but had some build problems on Mac), Groovy, FreePascal/Lazarus, D+VScode (almost), Python+VSCode. Embarrassing perhaps, but I ended up doing my prototype in PHP, debugging on my Mac was not fun but its awesome documentation kept on saving the day.

There's nothing embarrassing about modern PHP.

Laravel DB migrations are very convenient, and very DB agnostic.

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

#157

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. Any performance benefits would most likely be nullified by network latency

It seems you're mistakenly confusing the time a request takes to be fulfilled with performance.

In the server, performance means throughput. If means nothing if a task handler stays ages waiting for IO. What matters is that once a task is ready to run, the code that needs to run is as lean as you'd like.

This means you can handle more requests with less hardware.

I have no idea how we reached a time when people think it's a good idea to download over 100MB worth of dependencies just to have a service that can handle a HTTP request, and multicore computers packed to the rim with RAM just to be able to handle a few tens of HTTP requests per second.

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

#158

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?

I've been at it for 20 years and I've tried a TON of stuff.

.NET is a perfectly reasonable -- dare I say enjoyable -- way to go if your systems are already configured to support it and you control the hardware you are running on.

The .NET toolchain for compiling and installing .NET apps if you're not already in the Windows ecosystem was -- last time I tried, which admittedly was a while ago -- very clunky compared to C/C++ tooling.

Qt is very good (but VERY expensive if you're not Open Source) for C/C++ and I've used GTK for Linux.

Java is pretty good at GUI but then you're taking on Java's other quircks / bloat. similar to .NET but worse.

I've also tried Flutter and Electron. Both have their pros and cons. But writing the low-level code in something like Go, compiling to a shared library, and linking it with Flutter is a workflow I somewhat like for desktop. That's what I'm doing for some of my newer apps.

But the reason I left that comment is my experience with C/C++ in GUI development has been the most positive so far (usually using Qt). C/C++ have just been around so ridiculously long and had so many tools written for them. But take it with a huge grain of salt since I'm in an industry where more times than not the primary GUI is in a web browser so I don't deal with non-browser GUIs every day.

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

#159

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 ).

This is the exact kind of tool I would have loved to have had during my math undergrad. And as a fellow developer, I applaud you for taking on the challenge of working with PDFs, especially in non-trivial ways, on arbitrary PDFs no-less. Anytime a client/employer mentions anything involving programmatic PDF manipulation/access, I try my best to convince them it's probably not a good idea, but if I have to, I do a little prayer that I can find a straightforward solution with an existing library - otherwise, lower level PDF munging quickly ventures into a flavor of tech-cowboy hell.

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

#160

Earlier quoted context omitted.

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.

Not that simple, I think it's more than LGPL, IANAL however, its license always confuses me.
Post reply on HN