Tag: github

  • Git is eating the world

    The inception of Git (2005) is more or less the halfway point between the inception of Linux (1991) and today (2019). A lot has happened since. One thing is clear however: software is eating the world and Git is the fork with which it is being eaten. (Yes, pun intended).

    Linux and Git

    In 2005, as far as Linus Torvalds’ legacy was concerned, he didn’t need to worry. His pet project Linux — “won’t be big and professional” — was well on its way to dominating the server and supercomputer market. And with the arrival of Linux powered Android smartphones this usage would even be eclipsed a few years later. Linux was also already a full-blown day job for many developers and the biggest distributed software project in the world.

    However, with the creation of Git in 2005, Linus Torvalds can stake the claim that he is responsible for not one, but two of the most important software revolutions ever. Both projects grew out of a personal itch, with the latter being needed for the other. The story of both inceptions are of course very well documented in the annals of internet history i.e. mailinglist archives. (Side note: one of Git’s most impressive feats was at the very early beginning, when Torvalds was able to get Git self-hosted within a matter of days 🤯).

    Today

    Fast forward to today and Git is everywhere. It has become the de facto distributed versioning control system (DVCS). However, it was of course not the first DVCS and may not even be the best i.e. most suitable for some use cases.

    The Linux project using Git is of course the biggest confirmation of Git’s powerful qualities. Because no other open source projects are bigger than Linux. So if it’s good enough for Linux it sure should be good enough for all other projects. Right?

    However Git is also notorious for being the perfect tool to shoot yourself in the foot with. It demands a different way of thinking. And things can quickly go wrong if you’re not completely comfortable with what you’re doing.

    Web-based DVCS

    Part of these problems were solved by GitHub. Which gave the ideas of Git and distributed software collaboration a web interface and made it social (follow developers, star projects etc.). It was the right timing and in an increasingly interconnected world distributed version control seemed like the only way to go. This left classic client-server version control systems like CVS and SVN in the dust (though some large projects are still developed using these models e.g. OpenBSD uses CVS).

    GitHub helped popularize Git itself. And legions of young developers grew up using GitHub and therefore Git. And yet, the world was still hungry for more. This was proven by the arrival of GitLab, initially envisioned as as SaaS Git service, most GitLab revenue now comes from self-hosted installations with premium features.

    But of course GitHub wasn’t the only web-based version control system. BitBucket started around the same time and offered not only Git support but also Mercurial support. And even in 2019 new web-based software development platforms (using Git) are born: i.e. sourcehut.

    Too late?

    However the fast adoption of tools like GitHub had already left other distributed version control systems behind in popularity: systems like Fossil, Bazaar and Mercurial and many others. Even though some of these systems on a certain level might be better suited for most projects. The relative simplicity of Fossil does a lot of things right. And a lot of people seem to agree Mercurial is the more intuitive DVCS.

    BitKeeper was also too late to realize that they had lost the war, when they open-sourced their software in 2016. Remember: BitKeeper being proprietary was one of the main reasons Git was born initially.

    Yesterday BitBucket announced they would sunset their Mercurial support. Effectively giving almost nothing short of a deathblow to Mercurial, as BitBucket was one of the largest promoters of Mercurial. This set off quite a few discussions around the internet. Partly because of how they plan to sunset their support. But partly also because Mercurial seems to have a lot of sentimental support — the argument being that it is the saner and more intuitive DVCS. Which is surprising because, as stated by BitBucket; over 90% of their users use Git. So there is a clear winner. Still the idea of a winner-takes-all does not sit well with some developers. Which is probably a good thing.

    Future?

    Right now Git is the clear winner, there is no denying that. Git is everywhere, and for many IDEs/workflow/collaboration software it is the default choice for a DVCS. But things are never static, especially in the world of software. So I am curious to see where we’ll be in another 14 years!

  • Advent of Code

    Advent of Code is a yearly programming contest created by Eric Wastl and it is currently being held at adventofcode.com. That means that this site spawns two daily programming challenges — until Christmas — to see who can solve them the fastest. But it is not just about being fast, Advent of Code is also a great way to improve your programming skills with daily puzzles or learn a new language. Because everyone gets the same daily puzzles it is also a great way to share and discuss results, and above all, learn.

    Though I knew of Advent of Code, I hadn’t participated before, but it seems two days, and four puzzles later, I am sort of in. Or at least, after only two days I am already fascinated by what I have seen, so I thought I’d share!

    Fascinating findings

    • Python seems to be the most popular language, by far. At least judging by Github repo names, which is of course not an exact measure, but it is more or less an indicator, as a lot of people tend to share their solutions there. Python is the most popular language, and it isn’t even close:
    • Browsing through the code, it — once again — becomes apparent that even with the exact same tools (e.g. Python) we all bring different experiences and education to the table which results in a colorful variation of solutions for the exact same puzzles. I’ve seen 100+ lines of Python code generate the exact same result as 10 lines. Advent of Code emphasizes that we are all unique individuals, and there is not a specific right way, just as long as you get there.
    • If I had to guess, I would have picked JavaScript to be the most popular language. But as you can see it only comes in second. Ruby, Go and C# are also unsurprising entries on this list, but Haskell and Elixir are — to me at least. These two functional languages seem to have quite a bit of buzz around them and people passionately seem to pick these languages as their language of choice, which is interesting as I know very little about either. Fun side note: even the creator of Elixir participates in AoC! 
    • Very few people seem to pick PHP. Which I also find surprising, because gigantic parts of the web run PHP. But PHP seems to have little appeal when it comes to coding challenges?
    • Some people are fast, I mean really fast! Just look at the times on the leader board. Judging from these times, this means some people are able to read around 1000 words explaining a puzzle, and then coding up not one, but two solutions and submitting the correct answer in under four minutes!  I kid you not. This next person live-streamed it, and clocks in around 5 minutes (even without using the command-line shortcuts like CTRL-R), and — here’s the kicker — it didn’t even put him in the top 20 for that day!
    • Of course you can use any language you like or even pen and paper, it is a puzzle after all. And people use some really crazy stuff, I love it! Anything goes, even Excel, and I think that is one of the goals of AoC: try to learn new things! There is one person who deliberately tried a new language for each challenge.

    Notable entries

    So it’s not all about speed, it’s also about trying new things. Here are some other unexpected examples.

    • Minecraft: This one takes the cake for me. See if you can wrap your head around what is happening here:

    Personal learnings so far

    So apart from these fascinating findings, I also got involved myself. I think because I solved the very first challenge with a simple AWK one-liner. But solving the followup challenge seemed trickier in AWK, though people seem to have done so (of course).

    Being completely new to Python, and seeing how popular it is, I decided to give it a go, and I must say I think I understand a bit better now why and how Python is so popular. Yes, it is well known that it forces deliberately clean code but it also provides ways for incredibly succinct code. And so far I have learned about map(), collections.counter, zip(), and cycle() Very handy, built-in functions and datatypes that I was unaware of, but which are incredibly powerful.

    Some people tend to disagree (probably very few), as I found this comment on StackOverflow when researching the Counter dict.

    I don’t think that’s fair, because in a sense every higher level programming language is an abstraction of differently expressed machine code. So unless you’re typing in machine code directly you are also using general purpose tools, and how narrow or general something is, who’s to say? And as long as it helps people do things faster — programming languages are tools after all — I’m all for it. Just let the computer worry about the zeros and ones.

    I was very surprised and pleased with the mentioned Python functions. For example, I brute-forced a solution in Bash which took probably more than 10 minutes to run, but ran in 0.07 seconds in only a couple of lines of Python. So, of course, the knowledge of the right functions and data structures once again proved to be the difference between 100 lines or 10, which reminded me of this quote of Linus Torvalds:

    So that’s it and if you want to learn something new, go give it a try!