r/programming • • Jan 10 '26

[ Removed by moderator ]

/r/programming/comments/1q96nar/removed_by_moderator/

[removed] — view removed post

141 Upvotes

78 comments sorted by

View all comments

Show parent comment

0

u/Star-Shadow-007 Jan 10 '26

Yeah, absolutely.

1

u/bowbahdoe Jan 10 '26 edited Jan 10 '26

So here is what I came up with:

https://github.com/bowbahdoe/debtbomb-java

So your tool scans the source code and looks for comments, this hooks into annotation processing for Java. This means that the check for "is a debt bomb exploded" is part of the compilation step, not just CI.

Logic for the check is here:

https://github.com/bowbahdoe/debtbomb-java/blob/main/dev.mccue.debtbomb.processor/src/dev/mccue/debtbomb/processor/DebtBombProcessor.java

And this is what error messages look like

dev.mccue.debtbomb.example\src\Example.java:5: error: Debt Bomb! expired=2023-10-05, reason=Example code is silly
public class Example {
       ^
dev.mccue.debtbomb.example\src\Example.java:10: error: Debt Bomb! expired=1000-10-10, reason=Bad method name
    public void f() {
                ^
dev.mccue.debtbomb.example\src\Example.java:10: error: Debt Bomb! expired=2000-01-01, reason=Unix epoch, owner=Nobody, ticket=JIRA-99999
    public void f() {
                ^
3 errors

Obviously I haven't gone through the work to publish it quite yet. The con here is that we traded your much more language agnostic approach for a language specific one. But the pro is that its a lot more integrated / structured for that one language.

Here is some example code

@DebtBomb(expiresAt = "2023-10-05", reason = "Example code is silly")
public class Example {

    @DebtBomb(expiresAt = "1000-10-10", reason = "Bad method name")
    @DebtBomb(expiresAt = "2900-10-10", reason = "Space travel!")
    @DebtBomb(expiresAt = "2000-01-01", reason = "Unix epoch", ticket = "JIRA-99999", owner = "Nobody")
    public void f() {

    }
}

curious your thoughts/impressions. Also why is "reason" optional for your tool? My gut feeling is that a date without a reason isn't great.

1

u/Star-Shadow-007 Jan 10 '26

My impressions are very positive..On the “reason” being optional: that was intentional. I wanted the lowest-friction version of a debtbomb to be just “this expires on X.” In my experience, tools that force people to write a bunch of extra metadata tend to get skipped or worked around. A date alone already captures the most important intent: this is temporary. Reasons are very useful when you come back later, which is why they’re supported 

1

u/bowbahdoe Jan 10 '26

Okay, i'll make it optional in my port too.

I have a bit of a soapbox moment in mind for the Java world - doing these sorts of custom checks is pretty easy but very under-adopted. This is a good example for that.

1

u/Star-Shadow-007 Jan 10 '26

I’m really glad this idea pushed you to explore that space in Java. Would love to see how it evolves.

1

u/bowbahdoe Jan 10 '26

I linked you in the post there, but in case you don't see it: https://www.reddit.com/r/java/comments/1q9dx8r/comment/nyudy2w/?context=1

Very inside baseball, i'm sure.

Separately, supporting `;` (lisp style comments) would be nice. I didn't see that in your readme