Git was not designed as much as evolved.
Take a look by yourself. Clone the official git repository, open it in gitk
(or your favorite graphical git log viewer), and look at its earliest revisions.
You will see it originally had only the very core functionality (the object database and the index). Everything else was done by hand. However, this small core was designed to be easily automated via shell scripting. The early users of git wrote their own shell scripts to automate common tasks; little by little, these scripts were incorporated into the git distribution (see for an early example 839a7a0). Every time there was a new need, the scripts were adapted to allow for it. Much later, several of these scripts would be rewritten in C.
This combination of a clean, orthogonal core (which you can still use directly if you have the need), with an upper layer which grew organically over it, is what gives git its power. Of course, it is also what gives it the large amount of oddly-named commands and options.
The compression, the graphs, getting rid of revision numbers, emphasizing branching, stashing, remotes... Where did it all come from?
A lot of that was not there in the beginning.
While each object was individually compressed, and duplicates were avoided by their naming, the "pack" files which are responsible for the high compression we are used to seeing in git did not exist. The philosophy in the beginning was "disk space is cheap".
If by "the graphs" you mean graphical viewers like gitk
, they appeared later (AFAIK, the first one was gitk
). AFAIK, BitKeeper also had a graphical history viewer.
Getting rid of the version numbers, in fact git's core concept of using a content-addressed filesystem to store the objects, mostly came from monotone. At that time, monotone was slow; if this were not the case, it is possible Linus would have used it instead of creating git.
Emphasizing branching is somewhat unavoidable on a distributed version control system, since each clone acts as a separate branch.
Stashing (git stash
) is, IIRC, quite recent. The reflogs, which it uses, were not there in the beginning.
Even remotes were not there initially. Originally, you copied the objects by hand using rsync
.
One by one, each of these features was added by someone. Not all of them — perhaps not even most of them — were written by Linus. Every time anyone feels a need which git does not fulfill, one can create a new feature over git's core "plumbing" layer, and propose it for inclusion. If it is good, it probably will be accepted, enhancing git's utility (and its command line complexity) even further.
This article sheds some light on the situation. The most pertinent link within that article is this. So you've got a massive install base with lots of programmers who know the language and it's widely taught at universities. C++ was dropped from my school's curriculum, Java is still here. Java has Java ME which has a massive install base on other cellphones. The Pantec Ease I have in my pocket right now has a little coffee cup in the corner of the screen. Anyone care to guess what that is?
This answer on Stack Overflow covers it pretty well too.
Summary of SO answer:
java is a known language, developers know it and don't have to learn it
its harder to shoot yourself with java than with c, c++ code since it has no pointer arithmetic
it runs in a vm, so no need to recompile it for every phone out there and easy to secure
large number of developement tools for java (see first)
several mobile phones already used java me, so java was known in the industry
the speed difference is not an issue for most applications, if it were you should code in assembly
Best Answer
It is above all a way of insulating data consumers and data providers. You develop your own content provider or extend an existing one if you want to make some of your data public or at least available to other application.
True this can server to control accesses from a security point of view but it also allows you to rework the physical implementation of your data whenever you want. All you need to do is to adapt the back-end of your content provider in that case. The data consumer applications will not have to be rewritten. They will carry on accessing your data through their content resolver unaware of any change in the actual underlying implementation.
Also, Android will instantiate only one instance of your content provider even if the data is accessed by several clients so it will take care of concurrent accesses without you having to care about it.
Finally, I believe it will also handle the drudgery of clean start up and shut down.