Live data from Hacker News

Building GitHub with Ruby on Rails

github.blog

251–260 of 332 posts

Re: Building GitHub with Ruby on Rails

#251
post #227

I must be the only person on Hacker News who dislike Ruby. It simply has too much magic and doesn't offer enough abilities (unlike Elixir or any Scheme variant) to justify the dynamic type nature. Go and Rust are perfect for me (and maybe Zig?). They covered everything I need.

None of the languages you listed/prefer existed when GitHub was launched, lol.

Re: Building GitHub with Ruby on Rails

#252
post #227

I must be the only person on Hacker News who dislike Ruby. It simply has too much magic and doesn't offer enough abilities (unlike Elixir or any Scheme variant) to justify the dynamic type nature. Go and Rust are perfect for me (and maybe Zig?). They covered everything I need.

I love Go but Rails is just unmatched in terms of development velocity. You're right that Go eschews magic and embraces verbosity but in doing so it makes common tasks, like web development, take 10x longer than languages that do the opposite.

Re: Building GitHub with Ruby on Rails

#253
This is a very interesting cautionary tail for those who recommend Rails because Github uses it. It's hard to imagine another core framework where the "best" way to use it is to dedicate an entire department to continuously working off the bleeding edge. And if you read between the lines, changes that Github needs to make are within Rails itself, and as we know there are core Ruby and Rails maintainers working at Github. This is a cautionary tale because of how much overhead Github needs to make this work. If your company has the klout to hire core Rails maintainers and the staff to be able to focus on working off the main branch of one of your framework dependencies, then go for it!

You should also read about Github's history with "Rails" and how challenging it was for them to make it fast enough for them and upgrade it. It's pretty interesting they got around that "challenge" by throwing a LOT more resources at it. It's interesting because this isn't usually a challenge with other major framework upgrades. It makes sense you would need this much investment given the hyper-dynamic dangers of Ruby (not just the language, but the ecosystem), making it difficult and risky to upgrade.

TL;DR the advice in this blog post does not seem applicable to most companies.

Re: Building GitHub with Ruby on Rails

#254

Even as a much smaller team, building Heii On-Call [0] as a lightweight alerting/monitoring/on-call rotations SaaS based on Ruby on Rails has basically been a pleasure! And as the article highlights, perhaps the key reason for smooth deployments and upgrades is that the CI testing story is so, so good: RSpec [1] plus Capybara [2] for us. That means we have decently extensive tests of just about all behavior. The few…

My startup is using minitest (mainly for running tests in parallel I believe) and capybara. Crystal looks great, are you using it mainly for type checking? If so why not Sorbet?

We're using Crystal for "premature optimization" for the parts of the system that need to scale, specifically:

(1) the API server at https://api.heiioncall.com/ which gets hit frequently for check-ins, e.g. cron job monitoring

(2) the outbound probe processes that do website monitoring, polling your desired URL every minute and making sure it's up!

Re: Building GitHub with Ruby on Rails

#255
post #19

Earlier quoted context omitted.

I imagine it wouldn't be too hard, since Django only has one dependency - Django itself (NodeJS developers weep). Is rails the same way dependency wise?

Wait is this true? Doesn’t it also use SQLAlchemy at least? Which then likely has its own dependencies? I’d be really surprised if Django had no dependencies at all.

Django had zero external dependencies for a long time, which was a factor of its history.

The first release of Django was in 2005. Back then, the Python Package Index didn't exist yet. Installing Python dependencies was really hard - you pretty much had to grab a copy of the code for each one and put it on your "sys.path" somehow.

So Django avoided the issue entirely by bundling everything you needed to build a web application in a single package.

That's why Django has "django.contrib" - in a time before pip dependencies, it was a way to separate out things like GeoDjango which weren't exactly part of the "core" framework but could be distributed along with it.

Re: Building GitHub with Ruby on Rails

#256

I'm curious what their data access layer looks like underneath that monolith. Is the Rails piece mostly now just a frontend for dozens of other services, properly owned and maintained by other teams? I don't mean to trivialize something that's obviously huge and complex as "just a frontend", but IME one of the biggest things that breaks down in a Rails monolith as it scales is heavy, direct usage of ActiveRecord. Eit…

I've heard this several times over the last few months. Like what makes several devs working in the same area of the code "hard"? In my experience whomever is lucky enough to commit first gets the easiest of it, everyone else just rebases and resolves their conflicts. Maybe if you don't rebase and merge instead? I've seen some screwed up stuff happen from bad merges... like entire lines of code vanish. But generally,…

Well, I gave a specific example in Rails, using DB migrations against a shared DB. It’s not an unsolvable problem, and of course each dev can have their own DB, but if this is poorly managed it’s easy to become unwieldy. Outside of that, if many devs are constantly making dependency changes such that every time you “git pull” you have to rebuild environments, etc. Maybe devs are adding features but not prepopulating dev environments with sensible test data so your dev environment gets horked. Etc etc. Its not usually about merging the code itself.

Re: Building GitHub with Ruby on Rails

#257
post #183

Earlier quoted context omitted.

I guess my implied question should be stated more explicitly: is GitHub's front end code entirely separate fro the Rails code? That's not how Rails apps usually work, I thought. Admittedly, it's been a long time since I looked at Rails code, and I don't have the slightest idea how GitHub is actually architected. But I don't remember the "front end code" in Rails being a separate thing from the server code, typically:…

Rails can just serve JSON or GraphQL from an API to an SPA frontend, or you can do full server-rendered, or Hotwire to do HTML fragment updates, or any combination thereof. IIRC Github used something like Hotwire but home-grown. I've not done Rails development for a while so not sure what the state of things is for web sockets, but I would think that's not a problem for the framework. Point is, there's nothing about…

Order as I remember it: Github initially used pjax, https://github.com/defunkt/jquery-pjax, (maybe "invented" by defunkt?) which I believe was the precursor to turbolinks, https://github.com/turbolinks/turbolinks, which was the precursor to Hotwire.

Re: Building GitHub with Ruby on Rails

#258
post #41

Earlier quoted context omitted.

I have yet to see a tech stack that's not locked up into a framework version. That's more because of our engineering culture. The cost of NOT upgrading outweighs by a huge margin than keeping building on top. And yes, have seen Django shops locked into 0.9x release patched right into the core and running for a very long time, impossible to upgrade and all the horror stories. EDIT: Added Django

I think this is mostly a consequence of using dynamic typed languages.

We recently upgraded our pretty large enterprise Scala codebase from Cats v1 to Cats v2. Static typing does help, but there are tons of other problems. One of them is lack of conventions like in Ruby on Rails, which can easily be much worse than dynamic typing in the presence of conventions (provided that conventions are followed -- rarely the case).

Re: Building GitHub with Ruby on Rails

#259
post #241

Earlier quoted context omitted.

You MUST have an insane amount of test coverage to trust something like this to Ruby. I'm new to Ruby, with 13 yoe as a SW engineer. Personally, I find it a very hard language to master. Writing tests often feels like I'm settings variables left and right without seeing them being used in the current context. But that then happens to be part of the let() way in rspec. Now you might say: why use rspec? I inherited thi…

You don't have to use `let` in specs. I prefer setting instance variables inside a `before :each` block.

Instance variables, you mean those beloved things in Ruby that cannot be distinguished between not having been defined versus having being assigned the value `nil`? :p

Re: Building GitHub with Ruby on Rails

#260
post #227

I must be the only person on Hacker News who dislike Ruby. It simply has too much magic and doesn't offer enough abilities (unlike Elixir or any Scheme variant) to justify the dynamic type nature. Go and Rust are perfect for me (and maybe Zig?). They covered everything I need.

It's only magic if you don't know what's going on under the hood. I felt this way for the first couple of years until I figured it out (experience matters as with every other language/platform). Then there was no magic, just conventions. You can do crazy things with Ruby and people tend to do them thinking it's "cool". Just don't. Rails doesn't have many and they are pretty well documented.
Post reply on HN