frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

In Defense of C++

https://dayvster.com/blog/in-defense-of-cpp/
37•todsacerdoti•1h ago

Comments

lordleft•33m ago
Great article. Modern C++ has come a really long way. I think lots of people have no idea about the newer features of the standard library and how much they minimize footguns.
sunshowers•16m ago
Lambdas, a modern C++ feature, can borrow from the stack and escape the stack. (This led to one of the more memorable bugs I've been part of debugging.) It's hard to take any claims about modern C++ seriously when the WG thought this was an acceptable feature to ship.

Of course, the article doesn't mention lambdas.

im3w1l•4m ago
[delayed]
franky47•16m ago
What’s a good (ie: opinionated) code formatter and unit test framework for C++ these days?

I just had a PR on an old C++ project, and spending 8 years in the web ecosystem have raised the bar around tooling expectations.

Rust is particularly sweet to work with in that regard.

jonstewart•4m ago
Catch2 is great as a unit test framework.

Running unit tests with the address sanitizer and UB sanitizer enabled go a long way towards addressing most memory safety bugs. The kind of C++ you write then is a far cry from what the haters complain about with bad old VC6 era C++.

fithisux•15m ago
"Rust shines in new projects where safety is the priority, while C++ continues to dominate legacy systems and performance-critical domains."

the truth

AHTERIX5000•15m ago
I write C++ daily and I really can't take seriously arguments how C++ is safe if you know what you're doing like come on. Any sufficiently large and complex codebases tend to have bugs and footguns and using tools like memory safe languages limit blast radius considerably.

Smart pointers are neat but they are not a solution for memory safety. Just using standard containers and iterators can lead to lots of footguns, or utils like string_view.

fouronnes3•15m ago
This is a good article but it only scratches the surface, as is always the case when it comes to C++.

When I made a meme about C++ [1] I was purposeful in choosing the iceberg format. To me it's not quite satisfying to say that C++ is merely complex or vast. A more fitting word would be "arcane", "monumental" or "titanic" (get it?). There's a specific feeling you get when you're trying to understand what the hell is an xvalue, why std::move doesn't move or why std::remove doesn't remove.

The Forest Gump C++ is another meme that captures this feeling very well (not by me) [2].

What it comes down to is developer experience (DX), and C++ has a terrible one. Down to syntax and all the way up to package management a C++ developper feels stuck to a time before they were born. But that might just be the price for all the power it gives you.

[1] https://victorpoughon.github.io/cppiceberg/

[2] https://mikelui.io/img/c++_init_forest.gif

jandrese•5m ago
In Linuxland you at least have pkg-config to help with package management. It's not perfect but neither is any other package management solution.

If I'm writing a small utility or something the Makefile typically looks something like this:

    CC=clang
    PACKAGES=libcurl libturbojpeg
    CFLAGS=-Wall -pedantic --std=gnu17 -g $(shell pkg-config --cflags $(PACKAGES))
    LDLIBS=$(shell pkg-config --libs $(PACKAGES))

    ALL: imagerunner

    imagerunner: imagerunner.o image_decoder.o downloader.o
EGreg•10m ago
Python’s “there should be one obvious way to do it” slogan often collides with reality these days too, since the language sprawled into multiple idioms just like C++: for printing you can use print("hi"), f-strings like f"hi {x}", .format(), % formatting, or concatenation with +; for loops you can iterate with for i in range(n), list comprehensions [f(i) for i in seq], generator expressions (f(i) for i in seq), or map/filter/lambda; unpacking can be done with a,b=pair, tuple() casting, slicing, *args capture, or dictionary unpacking with *; conditionals can be written with if/else blocks, one-line ternary x if cond else y, and/or short-circuit hacks, or pattern matching match/case; default values can come from dict.get(k,default), x or default, try/except, or setdefault; swapping variables can be done with a,b=b,a, with a temp var, with tuple packing/unpacking, or with simultaneous assignment; joining strings can be done with "".join(list), concatenation in a loop, reduce(operator.add, seq), or f-strings; reading files can be open().read(), iterating line by line with for line in f, using pathlib.Path.read_text(), or with open(...) as f; building lists can be done with append in a loop, comprehensions, list(map(...)), or unpacking with [*a,*b]; dictionaries can be merged with {*a,*b}, a|b (Python 3.9+), dict(a,*b), update(), or comprehensions; equality and membership checks can be ==, is, in, any(...), all(...), or chained comparisons; function arguments can be passed positionally, by name, unpacked with * and \*, or using functools.partial; iteration with indexes can be for i in range(len(seq)), for i,x in enumerate(seq), zip(range(n),seq), or itertools; multiple return values can be tuples, lists, dicts, namedtuples, dataclasses, or objects; even truthiness tests can be if x:, if bool(x):, if len(x):, or if x != []:. Whew!
jasperry•10m ago
The author argues that if rewriting a C++ codebase in Rust makes it more memory-safe, that's not because Rust is memory-safe. What?
nzeid•7m ago
> Just using Rust will not magically make your application safe; it will just make it a lot harder to have memory leaks or safety issues.

You know, not sure I even agree with the memory leaks part. If you define a memory leak very narrowly as forgetting to free a pointer, this is correct. But in my experience working with many languages including C/C++, forgotten pointers are almost never the problem. You're gonna be dealing with issues involving "peaky" memory usage e.g. erroneously persistent references to objects or bursty memory allocation patterns. And these occur in all languages.

scj•5m ago
"you can write perfectly fine code without ever needing to worry about the more complex features of the language. You can write simple, readable, and maintainable code in C++ without ever needing to use templates, operator overloading, or any of the other more advanced features of the language."

You could also inherit a massive codebase old enough to need a prostate exam that was written by many people who wanted to prove just how much of the language spec they could use.

If selecting a job mostly under the Veil of Ignorance, I'll take a large legacy C project over C++ any day.

whobre•4m ago
> C++ is very old, in fact, it came out in 1985, to put it into perspective, that’s 4 years before the first version of Windows was released

Nitpick, I guess, but Windows 1.0 was released in November 1985:

https://en.m.wikipedia.org/wiki/Windows_1.0

Show HN: I built a tool to visually manage my LLM prompt templates and save them

https://promptcanvas.ml4den.com/
1•ml4den•2m ago•0 comments

Frying Eggs and Air Quality Tests

https://chillphysicsenjoyer.substack.com/p/frying-eggs-and-air-quality-tests
1•crescit_eundo•2m ago•0 comments

Glixir: A safe(ish) OTP library for gleam

https://github.com/rjpruitt16/glixir
1•rjpruitt16•4m ago•1 comments

Doom crash after 2.5 years of real-world runtime confirmed on real hardware

https://lenowo.org/viewtopic.php?t=31
2•minki_the_avali•4m ago•0 comments

Jan in Moscow: The secret Russian life of Europe's notorious fugitive-spy

https://theins.press/en/inv/284980
1•cwwc•5m ago•0 comments

Show HN: Should v0.2.0 – debugging Go tests made easier

https://github.com/Kairum-Labs/should
1•andrey-1201•8m ago•0 comments

The Symbiosis of Rust and Arm

https://filtra.io/rust/interviews/arm-sep-25
1•weinzierl•11m ago•0 comments

You Are Doomed to Fail as a Team Lead

https://kwakubiney.github.io/posts/You-re-Doomed-To-Fail-As-A-Team-Lead/
1•kwakubiney•11m ago•1 comments

Virtual Agent Economies

https://arxiv.org/abs/2509.10147
1•handfuloflight•14m ago•0 comments

Equations for the Placement of Tone Holes on Concert Flutes and Simple Flutes

https://www.chrysalis-foundation.org/musical-mathematics-pages/flute-tone-holes/
1•dmbche•14m ago•0 comments

A geothermal network in Colorado could help a rural town diversify its economy

https://insideclimatenews.org/news/20082025/colorado-rural-geothermal-energy-network/
2•PaulHoule•15m ago•0 comments

A Third Path for AI Beyond the US-China Binary

https://www.noemamag.com/a-third-path-for-ai-beyond-the-us-china-binary/
1•kawera•16m ago•0 comments

Israel has committed genocide in the Gaza Strip, UN Commission finds

https://www.ohchr.org/en/press-releases/2025/09/israel-has-committed-genocide-gaza-strip-un-commi...
12•aabdelhafez•17m ago•3 comments

Deep Blue – Down the Rabbit Hole [video]

https://www.youtube.com/watch?v=HwF229U2ba8
1•znpy•18m ago•0 comments

PyPI Blog: Token Exfiltration Campaign via GitHub Actions Workflows

https://blog.pypi.org/posts/2025-09-16-github-actions-token-exfiltration/
1•miketheman•19m ago•1 comments

Why Firsts Matter

https://tratt.net/laurie/blog/2025/why_firsts_matter.html
1•ltratt•23m ago•0 comments

Ontario Canada Study Shows Wind, Solar, Batteries Competing with Gas and Nuclear

https://www.theenergymix.com/ontario-study-shows-wind-solar-batteries-competing-with-gas-and-nucl...
7•toomuchtodo•25m ago•1 comments

Fiverr is sitting on an AI goldmine

https://twitter.com/balabuilds/status/1968046190387458428
1•swatkat7•26m ago•1 comments

Python 3.14.0rc2 and 3.13.7 are go

https://blog.python.org/2025/08/python-3140rc2-and-3137-are-go.html
1•andrewstetsenko•27m ago•0 comments

Threads is the gas-leak social network

https://maxread.substack.com/p/threads-is-the-gas-leak-social-network
3•tontonius•27m ago•1 comments

Norton, XTree, PC Tools and Popular MS-DOS File Managers [video]

https://www.youtube.com/watch?v=Yz9jzMM1vTQ
2•ibobev•28m ago•0 comments

iOS 26 buggy with fixed positioning elements

https://meta.discourse.org/t/ios-26-bugs-with-fixed-position-elements-in-discourse/382831
1•sams99•31m ago•0 comments

Show HN: Visual Ansible EE Builder

https://ansible-ee-builder.lovable.app/
1•tolarewaju3•32m ago•0 comments

The Topological Unified Field Theory on the Complex Hopf Fibration [pdf]

https://philpapers.org/archive/NIETTU.pdf
1•gahikr•34m ago•1 comments

Nokia Joins Deutsche Bahn to Launch First 5G Rail Test Network in Europe

https://finance.yahoo.com/news/nokia-joins-deutsche-bahn-launch-094214035.html
1•doener•34m ago•0 comments

Lake Peigneur

https://en.wikipedia.org/wiki/Lake_Peigneur
2•vinnyglennon•35m ago•0 comments

No one but America has the leverage to get AI labor policy right

https://writing.antonleicht.me/p/ai-jobs-and-the-rest-of-the-world
2•cubefox•36m ago•0 comments

Intercepting and modifying Linux system calls with ptrace

https://notes.eatonphil.com/2023-10-01-intercepting-and-modifying-linux-system-calls-with-ptrace....
2•ibobev•40m ago•0 comments

Easier Postgres fine-tuning with online_advisor

https://neon.com/blog/easier-postgres-fine-tuning-with-online_advisor
2•emschwartz•41m ago•0 comments

Insider Trading Is Not About Fairness

https://www.bloomberg.com/opinion/articles/2025-09-16/insider-trading-is-not-about-fairness-mfmwitk6
4•ioblomov•43m ago•1 comments