Skip Navigation
git bisect and the importance of a clean history
  • I agree that some stuff is easier when not squashing commits, but for the teams I've been working with I've felt that the pros of squashing outweigh the cons, but of course YMMV.

    But I didn't know about git bisect skip, thanks for the tip! But sincere question: What happens if there are e.g. three adjacent broken commits? If I have skip all three of those and the error was introduced in one of them, then git cannot tell me which commit introduced the error, right?

  • danielrotter.at git bisect and the importance of a clean history

    The value of a clean git history is often underestimated. I will explain one of the advantages based on the git bisect command.

    4
    danielrotter.at Avoid mocking repositories by using in-memory implementations

    Mocking libraries come with disadvantages, but fortunately they can be replaced by in-memory implementations, at least for repositories.

    0
    github.blog Upgrading GitHub.com to MySQL 8.0

    GitHub uses MySQL to store vast amounts of relational data. This is the story of how we seamlessly upgraded our production fleet to MySQL 8.0.

    Upgrading GitHub.com to MySQL 8.0
    0
    danielrotter.at Making the shell history more useful by using shell variables

    The shell history is cluttered with useless commands if stuff like tokens are included. Shell variables allow to exclude such content from the history.

    0
    danielrotter.at Some reasons for disliking react hooks

    React has introduced hooks to replace classes. Some people are huge fans, while I am a bit more skeptical. An explanation.

    0
    Code comments are (mostly) a violation of DRY
  • I think this is one of the most common misconceptions about DRY. Just because you have two times the same line in your code base it is not automatically a violation of DRY. If you compare if a number is bigger than 18 it is definitely not a good idea to extract that part if you are comparing the hour of the day once and the age the other time. In that case it would even be bad to create an abstration, and it would not be a violation of DRY. And I agree that something like this leads to code that is hard to maintain.

  • Code comments are (mostly) a violation of DRY
  • I think this is also in line with my article, since not being able to put yourself into somebody else's shoes (or even in yourself future's ones) is the reason for so much bad comments. But adding a comment to every single line cannot be the solution either, at least not in a higher programming language.

  • Code comments are (mostly) a violation of DRY
  • I agree with almost all of what you say, but the thing IME is that in most cases people learn to comment a lot, which results in comments that feel like they've been done just for the sake of it, which is one of the main problems IMO. It's not like "just add a comment, it won't hurt", since comments can be immensely misleading and literally take a lot of time until figuring out that the comment was wrong if you trust the wrong ones.

    I also agree that this tends to be worse with bad code, which also is not surprising. Sometimes it feels to me like people think they can fix bad code with some comments, and I think that is far from being true.

    I also admit that especially the title of the article might be a bit provocative, but giving the general positive sentiment of comments I think this is called for. Sometimes you have to exaggerate a bit to get some attention. I don't like click-baiting either, but unfortunately it works ;-)

  • Code comments are (mostly) a violation of DRY
  • Totally agree, that's why I also mentioned this in the article.

    Very often good code that is self-explanatory does not need any comments at all and if it does, the comment should describe why it has been implemented this way instead of just repeating what the code already says.

  • danielrotter.at Code comments are (mostly) a violation of DRY

    Comments in code are quite often a code smell. Let’s see what is suboptimal about comments and talk about some strategies to avoid them.

    17
    Automatic command execution on file changes with entr
  • Ah, you are talking about systemd, wasn't aware of that... I imagine that to be much more complicated for many use cases. E.g. running a unit test (as I describe in the article) isn't something I would use systemd for. Setting up a path and a service seems more complicated than using entr, and it is probably also harder to get to the output as well.

  • Automatic command execution on file changes with entr
  • I am not exactly sure what you mean by that... But the main advantage is that the command does not have to be executed manually everytime you change something. Instead entr recognizes when something changes and re-executes the command for you.

  • danielrotter.at Automatic command execution on file changes with entr

    Sometimes you want a command to be automatically executed as soon as a certain file changes. There is a small tool called entr, which helps with that.

    4
    danielrotter.at Execute commands for multiple files using fish

    Quite often I want to execute the same command for multiple files. It is quite easy to achieve that using the fish shell, once you get the hang of it.

    6
    kellysutton.com Keep All Commits Green

    The practice of keeping all commits green can help create better software faster. Let’s explore why.

    Keep All Commits Green
    0
    Demystifying Containers - Part I: Kernel Space

    This series of blog posts and corresponding talks aims to provide you with a pragmatic view on containers from a historic perspective. Together we will discover modern cloud architectures layer by…

    0
    danielrotter.at Finding used values of XML attributes using the command line

    I was refactoring a feature and wanted to know which options were used for a certain attribute in a XML file. I decided to level up my CLI skills for that.

    0
    InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)DA
    danrot @kbin.social
    Posts 11
    Comments 12