• 0 Posts
  • 45 Comments
Joined 7 months ago
cake
Cake day: December 9th, 2023

help-circle
  • Something that definitely separates me from some of my less experienced coworkers is that, when I sit down and start to implement a plan I came up with in my head, if it turns out that things start exploding in complexity then I reevaluate my plan and see if I can find a simpler approach. By contrast, my less experienced coworkers buckle down and do whatever it takes to follow through on their plan, as if it has now become a test of their programming skills. This makes life not only more difficult for them but also for everyone who has to read their code later because their code is so hard to follow.

    I try to push back against this when I can, but I do not have the time and energy to be constantly fighting against this tendency so I have to pick my battles. Part of the problem is that often when the code comes to me in a merge request it is essentially too late because it would have to be essentially completely rewritten with a different design in order to make it simpler. Worse, the “less experienced” coworker is often someone who is both about a decade older than me and has also been on the project longer than me, so even though I technically at this point have seniority over them in the hierarchy I find it really awkward to actually exercise this power. In practice what has happened is that they have been confined to working on a corner of the project where they can still do a lot of good without others having to understand the code that they produce. It helps that, as critical as I am being of this coworker, they are a huge believer in testing, so I am actually very confident that the code they are producing has the correct behavior, even when I cannot follow the details of how it works that well.












  • Yes. My rule of thumb is that generally rebasing is the better approach, in part because if your commit history is relatively clean then it is easier to merge in changes one commit at a time than all at once. However, sometimes so much has changed that replaying your commits puts you in the position of having to solve so many problems that it is more trouble than it is worth, in which case you should feel no qualms about aborting the rebase (git rebase --abort) and using a merge instead.


  • The way I structure my commits, it is usually (but not always) easier and more reliable for me to replay my commits one at a time on top of the main branch and see how each relatively small change needs to be adapted in isolation–running the full test suite at each step to verify that my changes were correct–than to be presented with a slew of changes all at once that result from marrying all of my changes with all of the changes made to the main branch at once. So I generally start by attempting a rebase and fall back to a merge if that ends up creating more problems than it solves.




  • The root of the problem is that you think of momentum as being defined to be the product of something’s mass and its velocity, but this is actually only an approximation that just so happens to work extremely well at our everyday scales; the actual definition of momentum is the spatial frequency of the wave function (which is like a special kind of distribution). Thus, because photons can have a spatial frequency, it follows simply that they therefore can have momentum.

    Something else that likely contributes to your confusion is that you probably think that where something is and how fast it is going are two completely independent things, but again this is actually only an approximation; in actuality there is only one thing, the wave function, which is essentially overloaded to contain information both about position and momentum. Because you cannot pack two independent pieces of information into a single degree of freedom, it is not possible for position and momentum to be perfectly well defined at the same time, which is where the Heisenberg uncertainty principle comes from.