Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

Wouldn't that be against C++ philosophy? I mean fast by default, you need to explicitly enable anything that costs cycles.


sort by: page size:

No. C++ is very fast. It has generics.

To be charitable, I'm gonna interpret this as hyperbole. If you meant this as its written, it'd be an immensly ignorant statement.

Almost by definition, there CAN always be a faster implementation in C++ but there are also more ways to shoot yourself in the foot (or as they saying with C++ goes, shoot your leg off).


A properly coded C++ app should run as fast as C; it can be faster...

I wish C++ compilers written in C++ were blazing fast too.

Yep, C++ where performance matters.

Most languages don't let you reason about such things. You just copy things around with no clue or care if it is fast or slow.

Most problems don't need that level of reasoning, but when it matters C++ gives you a lot of power to ensure you can control when it happens.


Every C++ programmer wishes that their software is blazing fast. That's why they code C++.

Using C++ is a premature optimization, which we should eliminate entirely.


c++ is faster if you code it right

C++ actually has pretty competitive compilation speeds, barring metaprogramming, up to a point.

I think this is pretty much exactly right with the caveat that "fast implementations" is probably "the overwhelming majority of implementations". `libpthread` on GNU has been doing this since smart phones were quite the novelty. I'm sure it exists, but I'm having a hard time imagining who wrote a C++11 compliant standard library and didn't do this optimization.

I think the point is that machines are fast enough that being as fast as C++ doesn't matter anymore.

C++ has done a pretty good job of maintaining the ideal that "you don't pay for what you don't use". Your C++ is too slow? Think carefully about which features you're using.

If you choose features appropriately (given that speed is your top concern), and you still find that another language is faster, I'd be quite surprised.


It's futile battle though to achieve both performance and safety in C++: as an example, safety requires avoiding moves, using reference counting, while achieving performance means avoiding copies and passing occasional references around, among other things. That's why advertising C++ solution as fast does not work well with "but C++ can be safe too!".

C++ is known to be fast, so what advantage could a more complex solution provide?

Only if you write unidiomatic (Read crap) C++.

In modern C++ it is very much possible to write fast and safe code, but the tradeoff is now put into the amount of stuff the developer needs to know to be productive (Which in my experience isn't as bad as people like to go on about on here/reddit, even if it still pretty shoddy)


Not quite to the degree that C++ does, but it's pretty good. There are several places in the standard that specifically allow for making a dynamism/performance tradeoff.

Yup, there's nothing keeping you from having a few RCs around that create a cycle.

That said the language does guide you away from things like that much more than C/C++.


C++ still seems to be the fastest.

C++ is designed to be as fast as C even when you use the advanced features like templates, at the expense of compilation speed, so I think it must be equally suitable.
next

Legal | privacy