Live data from Hacker News

Chrome Is The New C Runtime

mobilespan.com

101–110 of 149 posts

Re: Chrome Is The New C Runtime

#101

As someone not at Google, but who's re-used multiple parts of Chromium (as described in the article), the code (especially the stuff under base/) is possibly the best documented large-scale, open-source C++ codebase I've seen.

I haven't worked with Chromium, but the main C++ code-base at Google is like this for the most part too (especially the core stuff). The C++ culture at Google is amazing, and proof that large-scale C++ can actually be really nice if you stay within best practices. It takes a lot of effort and experience from a lot of knowledgeable people to craft these practices, but thankfully Google publishes its C++ style guide (…

> The C++ culture at Google is amazing, and proof that large-scale C++ can actually be really nice if you stay within best practices.

It's real-world C++, not 'Modern' or Boost- or 0x-C++ (not even C++98). There is a huge gap between C++ development in the trenches and what is published on the internet about C++.

Re: Chrome Is The New C Runtime

#102

XULRunner is almost 8 years old now, it was invented for the same purpose TFA uses Chromium but it's actually documented: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/XU...

Correct. Chrome is breaking no new group here. XULRunner aside, you can also use Mozilla's NSPR library for cross-platform basic services and NSS for TLS.

you can also use Mozilla's NSPR library for cross-platform basic services and NSS for TLS.

Which coincidentally, Chrome & Chromium are based on, making the cross-library usage full circle.

Re: Chrome Is The New C Runtime

#103
Recommending Chrome is a bit like recommending bionic when everyone else is enjoying (e)glibc?

The Chrome runtime has some good libraries but using that over say Qt really only makes sense if you're a (former) Chrome developer. For everyone else it's just needless pain.

Re: Chrome Is The New C Runtime

#106

Earlier quoted context omitted.

Avoiding exceptions is a worst practice. The guide even admits they're only doing it because they're so far beyond a critical mass of exception-unsafe code that they've lost hope of solving the problem. If the profession ever wants to produce anything reliable in C++, one of the first things that needs to happen is to start treating all unsafe legacy code like toxic waste, marking it clearly, handling it carefully in…

> Avoiding exceptions is a worst practice You say this very matter-of-factly. Many (myself included) do not believe in exceptions, and in C++ where they are poorly implemented, think not using them is best practice. I would summarize, but this 10 year old article I've seen on HN a dozen times does a much better job than I: http://www.joelonsoftware.com/items/2003/10/13.html Error handling is essential, but exceptions…

> The Linux kernel is an impressively complicated, and robust piece of software and they get along just fine without exceptions.

The amount of error-unwinding goto spaghetti, ERR_CAST/IS_ERR/PTR_ERR/... and all the bugs coming from it is not "just fine".

Re: Chrome Is The New C Runtime

#108
post #102

Earlier quoted context omitted.

Correct. Chrome is breaking no new group here. XULRunner aside, you can also use Mozilla's NSPR library for cross-platform basic services and NSS for TLS.

you can also use Mozilla's NSPR library for cross-platform basic services and NSS for TLS. Which coincidentally, Chrome & Chromium are based on, making the cross-library usage full circle.

Huh. When i read that article, i immediately thought of NSPR - as in, this is the Chrome alternative to NSPR. But it's built on top of NSPR? I suppose Chrome-as-a-platform provides more abstraction and richer services than NSPR.

Re: Chrome Is The New C Runtime

#109

Earlier quoted context omitted.

Avoiding exceptions is a worst practice. The guide even admits they're only doing it because they're so far beyond a critical mass of exception-unsafe code that they've lost hope of solving the problem. If the profession ever wants to produce anything reliable in C++, one of the first things that needs to happen is to start treating all unsafe legacy code like toxic waste, marking it clearly, handling it carefully in…

>If the profession ever wants to produce anything reliable in C++ This has already been done, so you are obviously wrong. Exceptions are cute for small amounts of code. But as soon as you get a sizeable codebase, you have zillions of functions just waiting to explode your call stack in ways you could never expect. Documentation doesn't fix it either. Even if you could somehow guarantee that every single function has…

> Exceptions are cute for small amounts of code. But as soon as you get a sizeable codebase, you have zillions of functions just waiting to explode your call stack in ways you could never expect.

Exceptions do not "explode your call stack", and any function can fail in ways both documented and undocumented. Consistent use of exceptions that derive from a small and well-chosen set of base classes means that callers can choose where and how to respond to categories of errors, instead of being forced to litter all code with error handling conditionals. I have worked on large applications that made the transition to using exceptions, and when combined with strict RAII and other best practices, the effect is absolutely to make code easier to understand and much more robust.

Re: Chrome Is The New C Runtime

#110
post #103

Recommending Chrome is a bit like recommending bionic when everyone else is enjoying (e)glibc? The Chrome runtime has some good libraries but using that over say Qt really only makes sense if you're a (former) Chrome developer. For everyone else it's just needless pain.

agreed. It sounds good but I can't imagine using it over some other x-platform lib which probably has fewer headaches. It's just way too big for what the author of the original post had in mind.
Post reply on HN