►
Description
A Beginner’s Guide To Reading Node.js Core Source - Rich Trott, UC San Francisco
An account of how one JavaScript developer (that’s me, hi!) figured out what the heck was going on in Node.js core code.
A
Okay,
success,
let's
see
so
welcome
to
a
beginner's
guide
to
reading
nodejs
course
source.
If
you
came
here
expecting
to
see,
oh
god,
she's
talk.
Sorry,
you
got
me
instead,
see
I,
see
some
people
who
already
know
how
to
read
node
course
source.
So
I
can
definitely
recommend
if
you
get
bored
to
go
to
what
Cadiz
talk
about
the
dark
web.
That
should
be
really
interesting
and
there's
also
a
workshop
going
on
right
now
about
building
apps
and
electrons.
A
So
there's
that
too
I'm
rich
trot
and
it's
customary
to
talk
about
yourself
a
little
bit
at
the
start
of
a
talk.
So
I
work
at
the
University
of
California
in
San,
Francisco
I
work
in
the
library,
but
I'm,
not
a
librarian,
but
I
am
also
a
member
of
the
node.js
core
Technical
Committee.
For
what
that's
worth
and
no
less
than
authority
that
miles
Boren's
has
called
me.
A
A
And
but
there
were
also
a
bunch
of
people
who
were
really
excited
for
the
reasons
william
described,
namely
that
a
main
component
of
the
main
message
of
the
of
the
iOS
project
was
come
and
help
us.
We
want
your
help.
We
need
your
help,
there's
not
enough
of
us,
and
that
was
really
exciting
to
me,
and
so
why
am
I
talking
about
this
well
we're
here
to
talk
about
reading
no
J's
core,
and
why
would
you
want
to
do
that?
There's
you
know,
there's
there's
a
bunch
of
potential
reasons.
A
A
We
can
do
so.
A
couple
of
caveats
about
this
talk,
first
of
all,
assuming
that
you're
coming
at
this
from
a
JavaScript
perspective.
If
C++
is
your
jam
and
you
want
to
approach
this
from
v8
or
libuv,
this
talk
may
not
be
the
way
to
do
it.
The
other
thing
is
what
I'm
describing
worked
for
me,
might
not
work
for
everybody.
I,
don't
know
just
pointing
that
out.
Step
0
write
a
HelloWorld
program
in
no
GS
or
something
just
get
familiar
with.
A
Pick
some
documentation
and
read
it
in
particular:
go
to
the
API
documentation
and
don't
try
to
read
it.
You
know
front
to
back,
but
pick
an
API.
You
know
any
API
will
do,
but
preferably
one
you're
interested
in
or
one
you're
using
there's
a
you
know
if
you,
if
you're
interested
in
scaling,
maybe
check
out
the
cluster
API
if
you're
interested
if
you've
been
writing
web
apps,
maybe
look
at
the
HTTP
or
HTTPS
API
if
you're
into
cryptography
or
something
you
know,
look
at
TLS,
etc,
etc,
etc.
A
So,
there's
some
obvious
reasons
why
this
is
a
good
approach
and
then
maybe
one
or
two
less
obvious
reasons
for
one
thing:
if
you
understand
how
the
API
is
used-
and
you
know
even
if
you've
used
an
API
a
lot-
you
probably
don't
you
know,
there's
an
excellent
chance.
You
don't
know
all
the
little
bits
and
pieces
of
it.
A
If
you
understand
how
an
API
is
used,
then
that
provides
clues
to
its
implementation,
but
there's
a
there's,
a
potentially
less
obvious
benefit
to
starting
started
with
documentation
and
starting
with
a
really
really
modular
and
little
piece
of
documentation.
That
forces
you
to
focus
because
no
core
is
sprawling
and
if
you
decide
I'm
interested
in
X,
you
X
can
be
in
18
different
files,
and
you
know
it's
it's
good
to
just
have
one
one
thing:
to
look
at
just
to
sort
of
wrap
your
head
around
how
something
might
work.
A
Additionally,
if
you're
looking
at
the
documentation,
you
might
find
something
that's
broken
in
the
documentation,
because
there
you
know
a
lot
of
this
stuff
was
not
written
by
people
who
are
professional,
technical
writers
or
anything
like
that.
So
there's
going
to
be
omissions,
there's
going
to
be
errors,
there's
going
to
be
all
sorts
of
problems,
and
this
is
an
opportunity
for
you
to
fix
it.
A
I
feel
that
it's
really
helpful
to
understand
I
feel
that
it
that
understanding
that
process
is
really
helpful
in
understanding
the
code
and
how
it's
put
together
and
why
certain
decisions
were
made,
and
if
that
sounds
mysterious
and
interesting,
we
can
talk
about
that
more
later.
But
I
only
have
20
minutes
here.
So
there's
a
caveat
with
the
whole:
hey
you're,
reading
documentation,
you
found
something
missing
fix
it.
It's
that
documentation
is
not
easy.
It's
a
it's
a
real
pet
peeve
of
mine,
actually
that
a
lot
of
projects
will
take
documentation.
A
In
fact,
I
just
did
this
this
morning,
but
a
lot
of
projects
will
take
open,
have
open
issues
around
documentation
and,
let's
mark
them
good
first
contribution
that
meeting
documentation
is
not
hard.
Writing.
Good
documentation
is
incredibly
hard
and
documentation.
Skills
are
a
super
power.
If
you
have
the
superpower,
please
use
it
for
good
and
help
out,
but
so
step.
Two
after
you've
read
some
documentation
is
to
look
at
some
code.
Fortunately,
our
code
is
not
minified
like
this.
A
This
is
just
a
metaphor
or
something
I
guess,
but
if
you
were
looking,
if
you're
reading
about
the
cluster
module
going
to
live
and
look
at
Lib
cluster
j/s,
if
you're
looking
at
HTTP
look
at
Lib,
HTTP
is
etcetera.
Some
of
these
module
files
are
pretty
short
and
digestible.
Some
of
them
are
kind
of
long
and
you're.
A
So
when
you
find
stuff
like
that,
this
is
you
know.
This
sort
of
these
are
the
sorts
of
pieces
that
that
will
help.
You
understand
how
the
code
actually
works
and
how
it
all
fits
together.
You
you
can
look
in
the
documentation
for
things
or
for
things
that
aren't
in
the
documentation.
You
can
go
to
the
node
dev
channel
on
the
on
freenode
IRC
and
ask
their
so
on
and
so
forth.
A
A
So
if
you
were
looking
at
HTTP,
you
might
look
in
tests
parallel
tests,
HTTP
whatever
yes
and
for
HTTP,
there's
going
to
be
way
too
many
test
files
to
just
sit
and
read
through
you'll
you'll
want
to.
You
know,
poke
your
eye
out
or
something.
But
but
you
can
just
look
at
test.
Sacc,
pjs
and
sort
of
just
get
a
feel
for
the
test.
Also
how
the
tests
are
written
is
super
important
if
you're
gonna
contribute,
especially
chances
are
you're
going
to
need
to
write
a
test.
A
So
there's
the
readme
file
and
the
test
directory
has
some
information
about
how
tests
work
and
are
put
together,
but
the
real
goldmine
is
probably
the
the
writing
underbar
test
MD
file.
That's
in
doc,
slash
guides,
it's
really
short,
really
understandable,
really
well-written
and
it's
a
good
good
resource,
so
bait-and-switch
we're
moving
right
into
contributions.
A
It
says
why
don't
you
send
an
email
to
us
or
tweet
at
us
and
we'll
give
you
a
really
easy,
or
at
least
maybe
not
easy,
but
certainly
manageable,
and
good
first
contribution
to
provide
to
know
to
improve,
to
improve
the
the
codebase
and
sort
of
you
know,
hopefully
get
you
hooked,
and
then
you
start
finding
your
own
issues
and
stuff.
If
this
sounds
an
awful
lot
like
code
and
learn
which
is
happening
on
Thursday
morning,
which
I
recommend
you
come
to
as
well.
A
That's
because
it's
basic
the
same
thing
that
wasn't
on
purpose
code
and
learn
was
originally
conceived
as
a
way
to
get
people
interested
in
the
darker
corners
of
the
code
base
that
nobody
understands,
or
only
one
or
two
people
understand
and
we'd,
have
those
one
or
two
experts
there
and
they
would
sort
of
train
people
and
help
them
out
and
I.
Don't
I
haven't
been
to
you
know.
You
know
there
was
code
and
learned
event
in
London
and
one
in
Amsterdam
and
so
and
so
forth.
A
Yeah
I
haven't
been
to
you
know
most
of
them
any
of
them,
but
my
impression
is
that
it
never
really.
Quite
worked
out
that
way
and
that
it
kind
of
sort
of
evolved
into
a
good
first
contribution.
The
kind
of
experience
like
I
just
described
so
sort
of
two
things
that
just
sort
of
happened
independently.
The
main
difference
is
code
and
learn
is
you
know,
is
affiliated
with
the
foundation
foundation
and
know
to
do
is
just
something
that
me
and
two
other
people
do
hopefully,
hopefully
more
by
the
way
for
those
of
you.
A
People
who
are
like
you
know
already
have
contributions
in
and
want
to
help
other
people
get
started.
I
do
I,
could
use
some
help,
answering
emails
and
tweets
so
yeah.
So
that's
me,
that's
no
dude!
That's
the
URL
and
I
thought.
I
was
gonna,
have
way
less
time
at
the
end
and
avoid
the
dreaded
Q&A
I
still
might
do
that
by
saying
I'm
not
doing
Q&A
and
I'll
just
be
kind
of
like
hanging
out
over
here
so
yeah.
That's
it
thanks
a
lot.