
Ten years of V8 - stablemap
https://v8project.blogspot.com/2018/09/10-years.html
======
codeulike
I remember when Chrome launched, it came out of nowhere. And it was launched
with a comic. The comic was pretty good, the chapter on V8 starts at page 12:

[https://www.google.com/googlebooks/chrome/small_00.html](https://www.google.com/googlebooks/chrome/small_00.html)

~~~
addicted
That was a pretty fun/interesting read. Nowadays something like that would be
done with an animated video instead.

What I found most amazing about it is that most of the ideas mentioned in
there have persisted and many have made their way into other browsers. Which
kind of indicates how many good choices they made at its inception.

------
Scarbutt
Interesting note about code comments in V8:
[https://www.openhub.net/p/v8-js/factoids#FactoidCommentsVery...](https://www.openhub.net/p/v8-js/factoids#FactoidCommentsVeryLow)

Spidermonkey is one third of the size(LoC) of V8 and has three times more
comments.

~~~
magicalist
> _Spidermonkey is one third of the size(LoC) of V8 and has three times more
> comments_

Is that based on
[https://www.openhub.net/p/spidermonkey](https://www.openhub.net/p/spidermonkey)?

It says last analyzed two years ago, but the last commit it includes looks
like it was in April 2011.

LoC is a silly measure for complexity anyways :) Does it include tests and
test runners? Generated files? v8 is in its own repo while spidermonkey is in
the main mozilla repo, so it's going to be difficult to compare well.

~~~
asdfasgasdgasdg
I also think in many cases comments serve as a stand-in for poor design. These
days, when I catch myself writing a comment, I try to think of whether I could
choose a better name for a variable or method instead, or if I could add an
assertion to clarify that an invariant holds in a particular location. Comment
rot also makes ordinary code rot look like a walk in the park. Since comments
aren't tested, they rot incredibly quickly without meticulous double-checking
every time you modify the code. In a heavily-commented, older codebase this
become super annoying, since every other line is a comment that, ten percent
of the time, doesn't hold any more.

~~~
skybrian
I think the problem of stuff going out of date can be avoided by giving
background (why it was originally written) rather than making a commitment you
can't keep about keeping it up to date.

Knowing why code was originally written can be more important than knowing
what it currently does.

~~~
asdfasgasdgasdg
Great advice, and it does resonate. FWIW I'm certainly not a "no comments"
guy. I just like to check myself to see if there is a better way to accomplish
what I was going to do with a comment.

------
kwijibob
This kind of effort toward optimisation is so pleasing.

To think that this in effect means that web browsing on phones and laptops
uses much less battery, and that web apps run smoothly and promptly, is very
cool.

~~~
asendra
And I've yet to experience a smooth web experience in an Android phone (using
Chrome), or at least as smooth as on iOs..

------
haywirez
Now only if audio.preservesPitch = false was implemented... ;)

~~~
mathias
That would be a Chromium feature. V8 only implements ECMAScript and
WebAssembly.

