Remove "TODO" comments from Developer Modules

As a developer, it is currently too hard to use personal “TODO” comments alongside Roblox Developer Modules.

When using the “Find All / Replace All” widget with “TODO”, Developer Module TODO comments often clutter it:
image

I use “TODO” to remind myself of things that I myself need to change. I don’t fork Developer Modules in order to keep them up to date, meaning manually removing Roblox TODO comments ruins that functionality.

If Roblox is able to address this issue, it would improve my development experience because I can easily continue using Developer Modules and “TODO” comments. Otherwise, this added friction slows down my workflow and deters me from continuing to use Developer Modules.

8 Likes

Roblox’s pipeline of work is very important. Consider using a different keyword if roblox’s modules are interfering with your scripts…?

2 Likes

Roblox Studio specifically has semantic highlighting for TODO for developers:
image

It’s a common word that both developers and engineers use. Lot of ways Roblox could opt to solve this (different internal word, hiding engineer comments on publish, filtering TODO to only stuff you’ve written, etc.).

Changing my officially-supported workflow just to use these modules is not a desirable solution.

8 Likes

Roblox uses the same pipelines that a lot of us developers do, they aren’t tricks specific to Roblox but rather industry standard. Comments like this are meant to mark specific parts of code for developers to address, another example you might come across in the wild is FIXME.

For developers working via Visual Studio Code, we have entire extensions dedicated towards indexing and highlighting TODO comments:

3 Likes

ROBLOX Engineers leave documentation not only for people on their team, but also for you- the user? This is common work flow for any open source project. By engineers marking things as TODO, the user, alongside people working on the project, know that there is an expected change in functionality at a given location in a future update.

It would be extremely stupid to remove internal documentation on any open source project. And if you for whatever reason do wish to remove documentation, then that’s your choice- and as such you should remove it yourself.

This is a double edged sword? Why would ROBLOX change their industry-standard, properly documented, official workflow, just for you?

2 Likes

I specifically just mean the “TODO”, not the comments themselves. Removing it myself makes the Packages unable to auto-update, and therefore negates them being Packages.

'Tis a request, not a demand.

3 Likes

I have had this problem myself, not with developer modules (cause I don’t use them) but with the PlayerModule and general third party code. Unfortunately, I doubt that this problem can or should be fixed at the level of individual comments. But as others have hinted, a solution more in the realm of being able to filter out results (e.g. by script) would be useful.

For what it’s worth, I will describe to you my own personal solution to this issue:

I prefix all my TODOs by @. Then by searching for @todo I can get results that are only my own. This style is uncommon enough that I haven’t had a conflict so far, and it lets you keep the fancy syntax highlighting (though to me I find that sort of thing matters less and less nowadays).

-- @TODO Fix this terrible bug!

Also if you want to disable results that are not relevant, you can insert a different character in between the @ and the searchable text (I use !).

-- @!TODO This comment is now hidden from typical search results.

Hiding comments this way is occasionally useful in my own code, and it’s more significantly useful in situations where third party code is using the same style as you and you want to quickly ignore their TODOs in a nice structured way. Because you can just find and replace every @todo with @!todo in their code and then you’ll never have to deal with those comments again.

Bonus description of how I generalize this system to help with other things

Turns out, being able to make specific, exclusively searchable comments is useful, so I call this general approach “tags” and use it for many things. I also use the colon : to separate a tag into pieces which can be searched independently and is useful to communicate relationships.

Here are some examples different tags I use:

-- @Debug Indicates code which is used for debugging purposes.
-- Is often enabled/disable temporarily via comments.

-- @Session:TODO Indicates something which should be done in
-- the short term (e.g. pending changes to a system you are
-- refactoring, things you need to get done before you release an 
-- update).

-- @Session:Debug Indicates temporary debugging code with a
-- similar lifetime to @Session:TODO.

-- @Session Of course you can also search for this prefix on its
-- own which is useful if you want to quickly check that you have
-- cleaned up all your loose ends.

-- @SomeNewChange:On
-- @SomeNewChange:Off
-- These are used to indicate old/new/different pieces of code
-- doing a similar  thing. Can be helpful when refactoring or trying
-- to compare solutions to a problem.

-- @SomeFeature:Variant1
-- @SomeFeature:Variant2
-- @SomeFeature:Variant3
-- ...
-- Similar to the on/off thing except more generalized, not just
-- binary or implying some kind of on/off state where the things
-- are just conceptually different.

-- @Modification This is used to indicate a modification made
-- to third party code. Particularly useful if those modifications
-- need to be tracked over time and/or migrated to newer
-- versions of the third party code (e.g. this is very useful for
-- maintaining a forked copy of the PlayerModule)

-- @Duplicate:SomePieceOfCode This is used with two or
-- more blocks of code which are doing something a similar way
-- and are sort of conceptually coupled together so if you change
-- one you should also change the other. Occasionally pieces of
-- code like this exist where it wouldn't be very productive to try
-- to abstract them and it's better to just document that the
-- duplication exists.

Tags are also greatly enhanced by using multiline comments, as you can use them to attach the tag to a particular block of commented code. Multiline comments can also be easily enabled/disabled by adding/removing an extra - to the beginning of comment opener --[[.

---[[ @Debug (code is currently enabled)
print("This is a debugging print!")
--]]

--[[ @Debug (code is currently disabled)
print("This is a debugging print!")
--]]

In practice, most of my use of tags end up being with these multiline comments, so that it’s very clear what code the tag corresponds to, and so the code can easily have its comment state toggled. The main exception are my TODOs which are usually isolated “blocks” of single-line comments.

6 Likes

What about a way to just exclude certain modules from coming up in searches? I don’t need cloned movement/camera/chat scripts appearing when I search “control” or “camera”. A way to just exclude these from search would be nice

4 Likes

Looking back at my response- damn, I was in an extremely pissy mood last night. Sorry about that.

I do still stand by my point though, the TODO tag is meant to be a signifier of change as well for people who are using the product. It’s not just for the engineers. I do get your argument though. I still think it really comes down to a user basis, in this case, I think it’d just be easier for you to remove those references if you don’t need them. :smile:

2 Likes