News for hackers. Stuff that matters.
Re:Ask HN: What projects are you working on now? by fishooter on Saturday March 21, 2020 @11:28PM (#22652472)
Love the idea! Maybe a suggestion with the "bit rot" problem (getting out of sync with code). Code tours will likely cover the most important parts of the codebase, which should be well tested in large projects (and large projects are the ones that need the tours). You could link the comments to those tests, and if any of those tests are changed, you will be advised to take a look at the tour comment. These tests can be also discovered automatically, as there exist code coverage tools.
Re:Ask HN: What projects are you working on now? by lostintangent on Saturday March 21, 2020 @11:36PM (#22652513)
Ah I really like this idea! Currently, a tour can be associated with a specific commit or tag, to enable it to be resilient to code changes over time (e.g. minor refactorings that don’t fundamentally change the value of the tour).

That said, there isn’t a way to automatically know when a tour should be updated, after a significant enough code has changed. Being able to bind a tour to one or more tests is a really interesting idea, and something that I’ll try to explore this upcoming week. Thanks so much for the feedback here!

Re:Ask HN: What projects are you working on now? by o-__-o on Sunday March 22, 2020 @12:48PM (#22656342)
How would you associate with ruby tests vs go tests vs my random test library that doesn’t have a great framework?
Re:Ask HN: What projects are you working on now? by lostintangent on Sunday March 22, 2020 @01:04PM (#22656500)
Great question! I’m not currently sure :) I’ve been fairly deliberate about building CodeTour in a language agnostic way, in order to ensure it could be applied to any file type within a codebase. This is partly why I haven’t based the tour definition experience on code comments: https://github.com/vsls-contrib/codetour/issues/38.

That said, I’m trying to keep an open-mind when it comes to increasing tour resiliency, since it may require language/platform-specific solutions. I’m not sure. If you had any thoughts, I’d love to hear them!

Another potential solution is to have a CI task, that could check to see how far the code has deviated from the original commit that the tour was recorded on, and notify you when the deviation crosses some threshold. Maybe that’s a terrible idea, but something like that would have the benefit of being language-agnostic.

Lots of exploration to do here!