
Announcing Building Git - griffinmb
https://blog.jcoglan.com/2019/04/08/announcing-building-git/
======
henry_bone
"There’s a huge section of the tech ecosystem that’s constantly told they’re
not smart enough to be here and that their work doesn’t matter. I spent a
decade hearing C was beyond mere mortals, that you must be a genius to go
anyway near low-level code, or algorithms, or distributed systems. The
inventor of Git is notorious for pushing this narrative! But the truth is,
anyone with enough brains and patience to learn how to do any kind of
computing is “smart enough” to learn things like this."

As someone who spent the first decade or so as an embedded software developer,
I wanted to move into web based systems because its a "bigger world". I'm a
couple of jobs into this bigger world now, and it just keeps getting bigger. I
feel the need to keep my finger on the pulse of new tools and technologies,
but I try to hold that in tension with the advice we get here to keep things
simple, be pragmatic, don't adopt technologies or techniques just because
google does. I've always fancied myself as a generalist, but this bigger world
makes me feel a bit like Bilbo Baggins, "like butter spread over too much
bread."

My point: I've been in both worlds and I feel more at sea working on internet
based systems. I had more mastery over the embedded systems I worked on, than
over the web based systems I work on now. So my experience is in support of
the author's point that ...

"anyone with enough brains and patience to learn how to do any kind of
computing is “smart enough” to learn things like this."

Moreover, I would suggest that the average full-stack web developer is
probably over-qualified.

~~~
jaabe
The thing with web-development is that you don’t actually have to follow the
trends to be productive.

A few years ago I read an article on LinkedIn, about how a local development
company he helped our neighbouring municipality switch from ASP Web-Forms to
the first version of AngularJS and Web-API because it was a more modern tech
that would make them future proof, especially in regards of hiring.

I laughed at it at the time, and sure enough, they’re in trouble now because
AngularJS didn’t actually stick around for long enough for anyone to really
learn it. Where as the newest versions of ASP .Net Core are actually being
build in a format that is extremely similar to ASP web-forms.

I’d like to say that I don’t think you should actually use ASP web-forms if
you can avoid it, because it is dated, but it still runs half the internet in
my region of the world and it’ll probably continue to outlive a lot of trendy
techs for the foreseeable future.

Our goal is that if something changes radically every few years, then it’s not
really worth adopting to our generalist stack, because we can’t afford to
waste resources re-learning React or Angular or X every two years.

------
gvand
Since it seems that he used Ruby throughout the book, I wonder if that's the
right choice or it will limit the book's audience.

I'm contemplating writing a long "from scratch" style book on another topic
and I'm still not sure which language I should use. Using more than one (Java,
Python,...) and generating multiple flavours of the book could be a good idea
I think.

~~~
layoutIfNeeded
Just write it in pseudocode.

Real programming languages introduce too much accidental complexity (memory
management, type declarations, etc.) that usually have nothing to do with the
subject matter. (Unless you’re writing a book about that particular language
of course)

It will also look bad if you happen to choose a language/framework that will
be dead 10 years from now, even if the core concepts of your book would stay
relevant.

~~~
jrochkind1
> too much accidental complexity (memory management, type declarations, etc.)

I know those were just examples, but that might hint at why ruby is a fine
choice here. It has neither explicit memory management nor type declarations.
It's pretty close to pseudocode already.

------
danso
This likely will be just another book on the long list of books I've owned but
don't get through, but hard to ignore a 700-page book with a topic both
esoteric and pragmatic (I use git daily but have very little knowledge of it
beyond what commands to Google). And one in Ruby -- a language I almost never
use today, or really see, but definitely grew up with.

~~~
vs2
The desire to buy more books than you can ever read is so universal, there's a
Japanese word for it: Tsundoku

~~~
wrycoder
I wonder what the Japanese is for endless scrolling of a Kindle directory?

~~~
grenoire
Tsundokindle

------
hyperpallium
There's a post on HN of Linus's first version of git (that I can't find). It's
short.

There's another reason git is a great choice as a large project to build: you
can get _something_ that works very quickly, and then just add to it. Because
that is how git was developed. It's like Gall's Law, but evolving only
additively. And although Linus was inspired by BitKeeper, it was stripped down
to its nakednes, til no longer anything to take away (like Exupery).

Also why git's UI design is so terrible.

~~~
jacobolus
St.-Exupéry’s quotation is about a plane that is perfect and streamlined, so
precisely suited to its purpose that it feels like an extension of the pilot’s
body.

That is not at all the same thing as a hacky prototype just starting out on
its journey towards accreting random code detritus.

~~~
hyperpallium
You're right that git isn't an extension of anyone's body - but few
engineering projects, where this quote is often applied, are.

But you're wrong to describe his prototype code as "hacky" \- especially when
I'm referring to the design - which really is pared down to the essentials.
Even "streamlined" and "precisely suited to its purpose". It's also not "just
starting out", in the sense that the design was informed by BitKeeper, just
much simpler.

When you get your data structures right, the code is obvious (Brooks).

You're right to say "accreting". I'm not sure about "random", but you're wrong
to call the code "detritus". The engineering on git is really top-notch,
extremely performant, but only where needed; and with the most helpful error
messages I've ever seen. It has many great aside features, like _git diff
--color-words_. I'm not an git expert; I expect there's much more.

PS you're also right it's Saint-Exupéry, not Exupery.

------
rrishi
This book looks really awesome and I want to follow along with it in Java. I
don't have the money to buy the book currently being a university student. In
the style of r/RandomActsOfPizza, would it be possible for someone to do a
RandomActsofBook and buy this book for me? I could pay the money back to them
in a couple of months or pay it forward...whichever they would prefer.

~~~
panda88888
I can get a copy for you. Let me know what email to send you the ebook. I only
ask for 2 things. 1) try to complete as much of the book as you can (it’s 700
pages!), and 2) pay it forward when you have the means. Cheers!

~~~
rrishi
Thank you so much. I am about to start working in july so will be sure to pay
it forward once I get a little financially stable. I have some time to kill
before that in which I plan to dive into this book. My email is:
f"rishi25m{chr(64)}gmail{chr(46)}com" (This is the python3 fstring)

~~~
panda88888
Sent you the download link. Let me know if you have any problems with
downloading.

~~~
paulriddle
Hey can I buy the book through you? My card gets rejected, but I know my card
is fine, it's the payment service issue. Yesterday I sent an email and a
tweet[0] to the author, but he didn't reply. Basically, I want to pay you £36,
you send me the pdf and buy it again. If you want to help me out, then send me
an email. My address is in the profile.

[0]:
[https://twitter.com/pau1riddle/status/1116205409780600833](https://twitter.com/pau1riddle/status/1116205409780600833)

------
royjacobs
This looks extremely interesting. It's also one of those things I'd love to
read as a physical book, but I can't seem to find that option.

Oh well, e-readers are okay too I suppose.

------
the_duke
Hopefully this being on the front page will bump up that 320 books sold number
a bit!

Looks very interesting.

~~~
patrickmcnamara
Was it definitely 320 when you wrote this comment? It says 350 now. Hopefully
because people bought it.

~~~
the_duke
Yup, it's 380 now, so it's either a interactive counter or the author just
keeps updating it.

------
localhostdotdev
the linked repository is amazing, I don't think I ever saw such nice code and
such neat organization:
[https://github.com/jcoglan/jit](https://github.com/jcoglan/jit) (everything
uses standard ruby libraries or default gems like minitest)

I'm trying it out and doesn't work very well on macOS (git add has issue with
the lockfile, but all tests pass).

I might use it as it's a very easily customizable implementation of git.

------
sidcool
Sounds pretty cool, a 708 page book detailing how to build Git from scratch in
all its glory. I just wish I had time to go over the entire book.

------
mschaef
This looks really nice, both because it covers Git in a new way, and that it
approaches solving a large problem with an eye towards explaining how to do
it. It really reminds me of Donald Knuth's work on literate programming, in
both senses.

------
oldpatricka
I have been working through this book in rust, and I have to say, the book is
a real joy. Extremely clear writing, very good pacing, and excellent
explanations of technical topics.

If you're at all interested you should buy this.

------
black-tea
There is an article showing how to write git using python called "Write
yourself a Git" [0] (HN post here: [1]).

This one shows the fundamentals of git in far less than 700 pages. In fact you
can go through it and understand git in an hour or two. For me this seems much
more worthwhile than seeing in depth how all the git porcelain commands are
done.

[0] [https://wyag.thb.lt/](https://wyag.thb.lt/) [1]
[https://news.ycombinator.com/item?id=19386141](https://news.ycombinator.com/item?id=19386141)

------
markmm
Git written in Ruby, it's a no from me.

~~~
wwarner
My understanding is that Github implemented git in ruby to make their rails
site work better.

~~~
localhostdotdev
github uses libgit2
[https://github.com/libgit2/libgit2](https://github.com/libgit2/libgit2) (in
C) but I'm pretty sure they have a lot of wrappers around it (maybe a ruby gem
with native extensions, maybe using ffi)

edit: ruby gem:
[https://github.com/libgit2/rugged](https://github.com/libgit2/rugged) which
has a native extension written in C to bind libgit2 functions to ruby methods.

