Hacker News new | ask | show | jobs
by bayesian_horse 1541 days ago
Whoever says things like that probably means "appropriate" in the sense that you can get your stuff done with another language using a fraction of the implementation time.

And whoever wishes to use C++ on websites... who is stopping you since Webassembly? Speaking about ecosystems... I also don't think the package management ecosystem in C++ is that much better, right? And there are enough horror stories about illegibility and foot-guns even in modern C++ code, rivaling the worst YOLO frontend style...

C++ requires you to be a lot more verbose and precise for almost everything. That translates to more work, and the benefit isn't automatically worth anything.

1 comments

Wasm is bleeding edge. AFAIK the only compatible UI library is Qt and support is not production ready. I have never needed package management in C++. There are gotchas with all languages, Lisp is not a panacea. Language verbosity is not bad it's a tradeoff, functional languages are usually hard to read. The language requiring you to be precise is a good thing. There's a reason the web industry has moved to TypeScript.
Wasm is not just bleeding edge, it is supported by all major browsers and being used in all sorts of real-world websites. No, "Qt" is not the only way to do UI in C++/wasm. This is a basic misunderstanding of the technology. Wasm lives inside the Javascript vm and can manipulate DOM objects all day long. It's just not very practical to do so. There are plenty of Rust projects going in that direction, though...

C++ doesn't only require you to be precise, it requires you to be verbose. JS is quite precise, and a lot more expressive because of the runtime. TypeScript is all of this and also allows you to be more explicit in order for the compiler to check your work, much like a proof checker.

The C++ type system is relatively stupid compared to that of TypeScript and F#, for example. In TS and F#, you can use types to help you, in C++ you already need the types because otherwise the compiler doesn't have a clue what to do.