Hacker News new | past | comments | ask | show | jobs | submit login

"Ideas that diverged too much from the existing successful tech had a huge obstacle in their way: they had to recreate all of the existing solutions in their new model.”

You’re so right! There are great examples of companies that preserved the existing ecosystem of solutions (Facebook with PHP, Microsoft with C++, Google with Java and C++, maybe also Amazon with Perl 5 and C++).

There are also great examples of successful companies that in a certain sense did or had to do things in an entirely new model (WhatsApp with the Open Telecom Platform, F5 Networks with their data center FPGA-powered hardware load balancers, Tesla and SpaceX, and so on).

There are also great examples of companies that did both, where they preserved an existing ecosystem but also added another ecosystem on top to fix flaws (NeXT Computer with Smalltalk and C, Stripe with the modern version of that as Ruby and Go, Twitter with Ruby and Java, so on).

Microsoft is the best example of a company that can succeed even with what seems like a crazy choice. Almost everything being written in C++ sounds insane to the point of being business suicidal, but they worked hard enough to make it work. If Microsoft can succeed in the ways that they have with C++, and if Facebook could succeed for as long as they did with PHP, and Instagram can allegedly succeed with Django[1], then anyone can succeed with anything as long as you can endure the stress that a seemingly peculiar decision might cause you. And those standard ecosystems that they chose all had immense benefits, they just also had some pretty immense weaknesses as well (Powering 500 million daily users primarily with Python scripts?? That just seems pretty crazy to me, if it’s true).

[1]Still very unclear about how much Python actually powers the web services behind Instagram. <https://instagram-engineering.com/tagged/python>.

I don't see why writing an operating system and surounding tools in C++ is a crazy decision (I'm assuming you meant windows & desktop apps by saying microsoft). Certainly not in the early 90's, but if you have a big codebase of that already, sticking with it doesn't seem crazy to me.

People make too much of a fuss over the differences between programming language. There are some important differences (whether or not memory safe is a big one, but it is hardly critical to a succful bussiness) but by and large the difference between using say php, python, etc for your program is superficial in the extreme.

The fact that many large and lucrative code bases are written in c++ should disabuse you of the idea that c++ is suicidal.

“Many” is almost underselling it. It’s literally EVERY web browser that anyone uses. I don’t know where people get these ideas. OP has a shallow understanding of programming languages, software development, and their history.

> It’s literally EVERY web browser that anyone uses.

And is a fine example of path dependence.

No one can write a browser in any other language not because C++ is necessarily better but because the activation energy to bootstrap to a useful browser is so large (for example, one must provide a smoking fast Javascript engine before one even considers the web page rendering pipeline).

It will be interesting to see how much of the Firefox codebase gets taken over by Rust as time passes.

Basically, C++ developers (like me) are stupid. We're like primitive species, stuck with C++ because we can't understand superior languages. The Lisp developers tried to bring us the light, but we chased them away by throwing rocks at them. Now the Rust evangelists are doing the same thing, but I'm afraid we might take a break from writing video games, stock exchange software, safety-critical software, CAD packages, web browsers, video codecs and the like, to throw rocks at them.

My point is: maybe C++ actually _is_ the superior language. It can't be a coincidence that all the best software projects tend to be written in C++, and not in Haskell or whatever.

> My point is: maybe C++ actually _is_ the superior language. It can't be a coincidence that all the best software projects tend to be written in C++, and not in Haskell or whatever.

If we're going by best software written, I suspect that means C is the better language than C++ by a wide margin. It would be interesting as to whether Visual Basic would be superior on that axis as well.

C++ is the better language--except that we always have to expose a C FFI because nobody seems to have enough critical mass to stabilize the library ABI. C++ is the better language--except that Apple wrote another language because they don't believe that and that Mozilla wrote Rust because C++ wasn't good enough. C++ is the better language--as long as you have a new codebase that only uses the latest features and Satan help you if you have stuff from pre-2005 because God won't be enough. C++ is the better language--as long as compile time isn't an issue.

I can go on if you wish...

I don't think C++ developers are stupid and those choosing to start new projects in it generally have really good reasons for doing so. I also think that many older projects are in C or C++ via path dependence because C++ was the superior choice when the project started and now they have far too much code to switch.

I also believe this will be why Rust eventually becomes a very important language--Rust allows you to modernize that old codebase in a piecemeal fashion.

Dunno. As a mainly C++ developer I think Rust is a real alternative because it tries to solve the same problems better. Lisp and Haskell do not solve the same problems. Huge Lisp codebases probably become hard to understand quickly, and both Lisp and Haskell don't produce very efficient code (or make it hard to produce efficient code).

Time will tell. At the moment I'm not convinced. Rust is a marginal improvement which is not worth the trade-offs in terms of immaturity, lack of libraries, books, standardization, etc. It might end up just like D. Or it might actually find itself a viable niche.

AFAICS D screwed up with its "optional" but really not optional if you want to use the standard library garbage collection. Rust contains no such mistakes, and seems to contain fewers mistakes than C++. Any experienced C++ programmer should know that C++ contains plenty of mistakes. Exceptions are very awkward, the string class is useless, hash maps are much slower than they could be (the std API enforces that), modules should have appeared 20 years ago, non-const references as stealth pointers are bad for readability, [...]

Why C++ string class is useless?

It's basically no better than vector<my_char_type> - i.e. it has no Unicode support whatsoever and very few string-specific convenience methods. Using algorithms is possible, but tedious.

Because I often work with Qt, I'm comparing it with QString, which is much more than a vector of chars. https://doc.qt.io/qt-5/qstring.html

Well, you just kinda answered your question. There is STL, Qt and Boost. Like all other languages. They do the same thing but in different capacities, you should select based on your needs. I think std::string can be supplemented for Unicode support, I am gonna say the fmt library was the supplement but I feel like I am wrong.

I used std::string and QString extensively for 4-5 years and find QString inexplicably bloated and un-intuitive for my use cases.

I don't understand your problem with QString, but anyway, AFAIK the common way to get Unicode support with std::string is ICU. ICU is quite large (~15-20 MB binary) and it breaks binary compatibility with every release.

I don't do C++ anymore professionally, but from I remember, std::locale was very useful: https://en.cppreference.com/w/cpp/locale

And QString had no magic to it other than wrapping its underlying data in ytf-16 which std::u16string does too.

It's not perfect but it gets the job done, IIRC.

> "[Lisp and] Haskell don't produce very efficient code (or make it hard to produce efficient code)."

Curious here. Are you speaking from experience -- i.e. you tried and failed -- or is this simply something you guess must be true? People write high-performance software in Haskell, and it's their tool of choice.

> People write high-performance software in Haskell, and it's their tool of choice.

I've heard of those but have never managed to see one. Do you have some examples ? (to give you my "baseline" - handling >500k messages/second on a desktop cpu for instance as this is something quite easily achievable in C++)

Modern c++ is pretty good, honestly. With the power of STL, you can so many neat things, and make beautiful code. Example: https://www.youtube.com/watch?v=pUEnO6SvAMo

It's almost like language choice doesn't matter at all...

Language choice is an implementation detail. As long as the language isn't technically unable to do the job (ie you can't write a device driver in Python), it doesn't matter much. It may be intensely interesting to practitioners, but it's not a make or break decision. Use what makes the team comfortable.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact