News for hackers. Stuff that matters.
Re:On Comments in Code by adonnjohn on Tuesday June 15, 2021 @05:41PM (#27521863)
Should my 'why' comment go further than a Jira number?
Re:On Comments in Code by Normal_gaussian on Tuesday June 15, 2021 @05:54PM (#27522014)
Absolutely. I worked a codebase that was littered with ticket numbers for a few years; many members of the team religiously added them but never read them. How do we know? Self hosted issue system and access logs. New starts would read a couple and that was it.

A ticket is a really opaque way of showing something. If you click the issue you're now going through several tangentially related comments and a few MR back and forths just to work out if its even useful to you. People will stop bothering to even open the link unless they are really stuck.

Whack a summary comment and then by all means include the link, but the comment is what most people will use.

Re:On Comments in Code by bostonsre on Tuesday June 15, 2021 @06:34PM (#27522458)
I wonder if there are jira integrations that would bring ticket info into the ide. Although, I hate jira and would definitely prefer good git commits.
Re:On Comments in Code by austinsharp on Tuesday June 15, 2021 @07:42PM (#27523061)
IntelliJ lets you expand links from patterns, so if in our codebase there's a BUGREPORT-12345 link, it's blue and clickable and goes to jira.
Re:On Comments in Code by cmckn on Tuesday June 15, 2021 @08:28PM (#27523417)
Yes. Unless your explanation is thousands of words (which it probably shouldn't be), just inline it. I only speak for me, but if I had to look up (potentially multiple) Jira tickets just to understand what was happening in a source file, I wouldn't be at that job very long.
Re:On Comments in Code by nonameiguess on Tuesday June 15, 2021 @06:24PM (#27522342)
Absolutely. All that information dies when your organization migrates off of Jira years down the line and the issue ids no longer exist.
Re:On Comments in Code by onion2k on Wednesday June 16, 2021 @05:37AM (#27526613)
That depends on whether or not you think the Jira ticket will outlast your code or not. If the company will definitely never replace Jira then no. If there is a chance that they will, and for your sake I really hope there is, then you'll need a better comment.