At what time of day do famous programmers work?
ivan.bessarabov.com
ivan.bessarabov.com
For at least 15 years I’ve had a policy - and so have the people on my teams - to avoid merging or committing to public branches at night or just before & during weekends so that you don’t accidentally hose other people on the team, who rely on automated builds & testing. We write code at all hours, but wait to commit/push/merge to master until the morning when everyone’s there.
I realize that not everyone has policies like that, but these are high profile programmers who are likely to have their own complicating factors. Linus, for example, commits a lot of merges that other people depend on; his code reviews and code writing might be on separate schedules.
I still think this a very cool back-of-the-envelope estimate though.
That's not the case with git. By default it preserves the original commit time.
That is what I’m saying. The policy is avoid pushes to master. My policy does apply to branches too once there are more than a few people in the branch.
Lots of people do work in branches, but everywhere I’ve worked, plenty of people skip branching when they’re making what they think are “small” changes. And some places I’ve been, the team has decided on a policy to skip branches & merges for single commit changes due to the history noise it causes.
The policy is to avoid breaking changes being committed to master when people aren’t around to notice & fix it.
One can commit and push to branches all day.
Merging them to master without a heads up is a bad idea, except where teams have implemented a process that can handle it
It seems fairly likely to me that the average time of day that someone makes the initial commit on a new branch would be quite different from the average time of day that they make commits generally. Am I misunderstanding?
There's a reason frequent small commits are generally thought to be the way to go.
and there's no way I'm going to write more than one nice commit message for a branch.
You can still get the fine-grained commits if you keep your merges focused on one thing.
Right. This is what Git Flow does. Best of both worlds.
The biggest WTF programmer I work with squashes all of his commits. So every commit is 100-400 lines of Rube Goldbergian majesty.
Both merges and commits can be pushed. I’m not exactly sure what distinction you’re trying to make.
Also, btw, I’m using git terminology, but not everyone uses git. I’m including my experience on teams that use Perforce, for example.
> One can commit and push to branches all day. Merging them to master without a heads up is a bad idea.
Yeah, right, exactly. You agree with me. My policy is about putting anything new in the master branch during off hours, because breaking changes that evade the tests may not get fixed until work hours, and prevent other people from working at night or over the weekend.
This means that your original top-level comment is completely irrelevant to the article you are commenting on, which is unfortunate, since it's the top-voted comment on the article. You should edit the top-level comment to reflect that fact, or, if that's not possible, add a second-level comment retracting it.
If you look at the code from the article, you’ll see that the author did not filter out merge commits. The word merge doesn’t even appear in the article. The OPs data includes merge commits.
You’re trying to draw a hard and idealized line that doesn’t exist in real companies. Squashes often happen right before push. Stashing for the weekend rather than committing is common. People unsafely leaving uncommitted changes in their workspace over the weekend is common. Most devs in my experience are not git experts, and they don’t always use git in best practices kinds of ways. That is made evident every time there’s a git thread on HN.
I am talking about commit time, my push policy affects my commit times. You can’t count on commit times to demonstrate anything.
Very extreme stance! Especially for so deep in thread. Sometimes it’s nice to make your ideas more specific as you go deeper in conversation, not just radicalize and double down.
git commit --amend --reset-author changes both author time and commit time.
git rebase changes commit time.
All three commands can be used just before a merge and push to clean things up. So there is no guarantee that the author time or commit time we see in the final commit history accurately represents the actual time at which the work was done.
Whether that correlation models reality closely enough to be useful depends.
My understanding of your “commit time demonstrates nothing” assertion is that you are saying there is no useful information there, which seemed like a radical position for so deep in the thread.
Edited to add: apparently something in my phrasing is leading you to believe that I'm angry with you and wanting to attack you. I'm not sure what that is, but that isn't my intention. I just think what you're saying isn't true, or rather is presumably true of your company but not of this article, and I was trying to explain why. I'm sorry for writing in what is apparently an aggressive tone.
Maybe you missed that I pointed out above that Linus makes a lot of merge commits, and you’ve just ignored my previous point about merge commits which is completely and directly relevant to my comments. The article included Linus’ merge commits in their histogram of his commit times. If Linus is waiting to merge like I do, then the data is skewed. If Linus is code reviewing and emailing in the morning, and writing code at night, then the data is misleading.
Merge commits are really the same as non-merge commits. The only difference is the number of parent commits, which is irrelevant for this discussion.
I absolutely did no such thing. You may wish to consider taking that untrue statement back, for the sake of your integrity. Nothing I said is attacking you personally in any way.
You called for a retraction of my top comment, implying it is flip-flopping and hypocritical, but you misunderstood my argument and made a rebuttal point that didn't address mine. That's a straw man, and since you appear to believe "straw man" is judgemental, it is not. It simply means you're arguing against a different point than the one I made.
It's a fact that you haven't yet responded to the merge commit point I made, and that merge commits in the OPs data are relevant to my original comment.
> I regret having given you so much time
You make it sound like I'm supposed to appreciate you calling my words untrue and "completely irrelevant". How does arguing with me and saying I'm attempting to defend an irrelevant position amount to you extending good faith?
Obviously the methodology is limited but it does seem to work well in practice. If you have evidence that the statistics are wrong for one of the listed programmers, please do share it.
> Is this advice for small 1 person repos?
I’ve never used a wait to push policy on my own repos, I’d say my policy doesn’t make any sense in that scenario. The goal of the policy is to prevent breaking other people, not to prevent breaking myself.
I found the phrasing abstruse relative to my daily way of thinking of these things
> Letting devs commit to master directly? Horrible idea.
I’ve never been on a team that disallows commits to master. I can see the thinking, and maybe I should be doing that, but for whatever reason, the places I’ve been are less formal than that and they might be concerned about slowing down turnaround times during the day when people need to share things more quickly.
FWIW, I am including git and also VCSs other than git. It’s harder to wall off the master branch in Perforce as a policy decision. And maybe I just haven’t been on a large enough team to warrant having someone with full time merge duties...
I'd be more concerned about code being committed to master without code review.
The question asked is valid, and we do commit often, we only avoid pushes to shared spaces at night, so some commits may have representative time stamps. As others have mentioned, squashing might compromise that, and commits made Friday but pushed Monday are, in my experience, more likely to be modified Monday right before pushing. For me, it’s pretty rare that the first commit time survives until push, I’m almost always squashing code, multiple times, before it’s ever pushed.
Unfortunately, TFA doesn't discuss which timestamp is being looked at, though that leads me to suspect that it's looking at the author timestamp because that's the default.
You're only talking about the first commit in a squash, and assuming that there aren't multiple squashes, right? There isn't only one timestamp in a squash, so you lose all but one of them.
> I've had commits where the author timestamp was many months older than my last modification to the commit before finally pushing it upstream.
Right, exactly, this illustrates why looking at timestamps isn't a good proxy for work time.
> TFA doesn't discuss which timestamp is being looked at
Here's the relevant portion of the script from the article:
git log --author="Linus Torvalds" --date=isoOur process is:
- create a branch for every change - make commits relatively small, but complete; each commit shouldn't break the build our the tests - request peer review when the code is ready to merge - when reviewed, rebase onto team's development branch and merge
In a way a lot of this CI/CD stuff was easier when you ran it on your CI system.
Because, obviously, it's pushing commits that's problematic, not committing per se (in git vocabulary).
But that all being said, we only have a handful of people worth of data points and who's to say that Linus isn't someone who writes his code the previous day and commits it the next. Or that Guido isn't someone who makes lots of small commits as he's working. Hell, maybe they all squash multiple days worth of commits leaving it with a timestamp for a totally different time.
tl;dr: Yeah, I don't know that we can glean that much super reliably from this data set.
We instituted a policy of NO CHANGE FRIDAYS! To avoid fucking up peoples weekends.
But then I read further and realized that this isn't a research study, it is just a clever script to output some data from github. So I'm going to go run it on a couple of my projects, see what it says, and enjoy that someone put it together.
> I often worked nights and slept during the day, but I almost always got 8 hours of sleep. There are still 112 hours left in the week!
I found that when hacking for a several months on a solo prototype project, my hours drifted later and later so that I ended up going to bed around 4 a.m., and rising at 11. It's really hard to correct! In terms of productivity, though, the wee small hours are hard to beat.
git stash push -m "my stuff"
> Then, when I return to the branch, I'll check if the previous commit was WIP (`git log -1`), and if so will reset it (`git reset HEAD~1`).
This is a single commit.
It is ridiculous how many nice features git has accumulated through the years, but their discoverability is... not excellent -- partially because of how many options we now have. It's a vicious circle.
But yes, --autosquash looks nice.
> The script uses the time the author saw on his wall clock when doing the commit. I can't imagine better time to use for such graphs
[1] https://gist.github.com/bessarabov/674ea13c77fc8128f24b5e3f5...
>> The timestamp is the number of seconds since 1st January 1970. If we convert 1563188141 to more human date we'll get "2019-07-15 10:55:41" — that is the time in UTC timezone. Then we add "03" hours and "00" minutes to that time and get "2019-07-15 13:55:41" — that is the time the commit author can see on his wall clock when he did commit.
Usually the +0300 indicates that the times tamp is at +3 hours from UTC. Eg. the timestamp is already in local wall time. The offset can be used to convert it to UTC.
So if the author did what they wrote. Then I reckon all the data is actually in UTC and not local wall time.
Generally I take a small light laptop when traveling, and then just connect to the desktop back home for doing real work such as committing code.
I know that at a lot of Big Cos do not let their engineers to have source code on laptops anyway (so easily lost and stolen).
Unix Timestamps are always expressed as UTC/TUC which remain constant regardless of device offsets.
The origianl comment's assertion that users don't typically adjust their offsets is moot since commits are stored in UTC anyways. I was just pointing out that many devices automatically adjust offsets.
A more detailed analysis could also take in account the number of changes. How many files per commit? How many lines, maybe?
The day of week is also a very interesting metric, that is very visible e.g. on github's timeline. I know my busiest days in terms of commits are in the middle of the week, a marked decrease on Friday afternoons, and if there are commits in the weekend, they most likely contain swearing in the message.
Edit: I'm betting Brad Fitzpatrick's pattern in Go (current job?) and memchached (not current job?) would vary in terms of day of week, not just hour.
Another useful graph would be commit volume versus time (where volume is e.g. number of lines modified)
So, my graph isn't exactly going to tell you at what hours I code but at what time I sent pull requests to my coworkers for example.
The brain churns on the problem at hand most of the time even when we are away from the computer. I would even be bold to say, more so when we are away from the computer and not distracted by typing.
Just throw it on the "subconscious pile" and let my brain chew away on it in the background.
That's a pretty useless way of seeing things. You might as well define eating or going on the toilet as 'writing' since hey, they might be thinking about it while they're doing it. If you look at actual writers talking about when they write (https://www.gwern.net/Morning-writing) many of them are quite explicit about taking breaks to do other work like correspondence or family/friends in order to not think about writing.
According to this study I would be working 5 to 11pm
Do companies like Google not care as much about work hours? I can't imagine anyone showing up at 2pm at any of the places I've worked, regardless of how productive they were.
Now that I'm a remote contractor, I can finally live according to my natural schedule and wake up around 5pm.
Thankfully my boss has seen that I'm much more productive with my abnormal schedule so I'm inclined that this type of freedom probably comes on a case by case basis.
Also, at google I’ve known people to work part of the day from home or have moderately shifted schedules to avoid traffic. Though there are often team-wide “core hours” where you are expected to be available for a meeting.
For example, some of my teammates do 8 to 4, some noon to 8, and others do 9 to 1 then go to gym/do chores/whatever, and then 4 to 8. As long as you deliver and communicate well within your schedule, no one cares.
I personally like it, because some days I might not feel good at all in the morning, so I get in late, but then I get a weird burst of energy around 7pm when I get home, so I sit down and end up writing some code.
Keep in mind, this is a double-edged sword, because you might end up working late at night to get some burning feature done or fix a nasty bug blocking the rest of the team.
After 6-12mo getting shit done, probably including a 12-20 hour working until "oh shit loading money" issue. And discussion with my boss. I have freedom to time shift my work. I'm consistently present for meetings. But if I'm blocked by external factors ill take Monday off so I can work on Sat (unblocked on weds) to meet following Monday deadline. Often work late at night where I can get solid block of 3-4 hour uninterupterd. I mostly work 10 to 7 to avoid traffic. I vaguely track hours and I average 36-40 or less. But they are so much more productive. Many people spend 8+ hours at work but get little done. My 6 hours are solid work. It also helps me manage burn out.
Im slightly manic depressive and partner/childless. Works great for me. YMMV.
Two striking findings emerged (and FYI I'm a "frequently commit small logical changes" person):
1. My work patterns seemed surprisingly self-consistent, with a notable gap 2am-10am for sleep and around 1pm for lunch and exercise. (Plus a markedly lower average in the evenings after 7pm for seeing friends, just relaxing, etc.)
2. The intersection between my curve and the window of 9:00am-6:00pm is only 53%. If a "conventional" employer were to constrain my productivity to that window, that's at least some first-order measure of how much inefficiency that constraint would likely produce for me personally -- 47% reduction.
Programmers and engineers have family and hobbies too.
Stop making the myth of the endurance programmer more and more inflated. It's proven and true that shorter working Hours have major bursts of productivity against longer ones.
> to filter only the commits by one person get the local time of that commit and aggregate it by hour when the commit was make
So these are all in local time of the computer doing the commit, if I am not mistaken.
I used to write lots of code at all hours of the day, 8 hours at work, 6+ hours at home. Then i had kids, and while i still write code 8 hours a day at work, i rarely find the time to write anything in my spare time anymore.
Every now and then i have "some project" that i'm working on, but it's mostly in bursts of 2-3 days, followed by 3-5 days of "doing nothing". The 2-3 days are _not_ weekends, and i usually end up losing sleep over it.
Kids are relentless, and no matter how late you stayed up, they still get up at 6 AM, and needs to be taken to kindergarten/school, and requires you to be (mentally) present in the afternoon/evening.
I guess you could talk about a "soft burnout" happening from the 2-3 days burst.
I'm trying to change the burst periods into more frequent, shorter periods of 1-2 hours, hoping the increased frequency will reduce the "ramp up" time while getting "into the zone".
Does Bellard think the whole project through for days and then simply hacks it down in a few hours?
Does one of them use TLA+?
Do they use iterative approaches, where the first few versions are really buggy?
Edit: Also if you want to learn about how famous programmers work, then there's no better source than the book Coders at Work by Peter Seibel. http://www.codersatwork.com/
If it's more than a day of work I might commit and push unfinished stuff before i stop for the day, but otherwise no.
Edit: although the latter happens very rarely. IMO if a unit is a whole day of work, maybe it needs splitting.
That is probably becouse we use Perforce where you don't do local branches by default.
Sometimes it's possible to meet these criteria after writing just 30 lines of code, but more commonly it will take 100-300 lines of code and several hours to get to that state.
All this to say, there's too many unknowns for me to trust this "study"
https://gist.github.com/davidalbertonogueira/dfc1b114285523c...
Hmmmm... Not quite. Albeit I am a massive fan of the Linux kernel, though Torvalds is _not_ the author of the Linux operating system (if we assume that Linux is the equivalent of GNU utilities + the Linux kernel).
It does not even remotely matter. What matters is who is going to maintain all of this after the years to come. (Or they could be even obseleted or superseeded anyway.)
Jess Frazelle is pretty famous for her work on dockerization as well.
I knew about half of the list (mainly the authors of software I use). I could probably name a few who are equally famous, but not many who are more famous.
edit: I went back and counted. I recognized 4 of 7 names.