ReinforcementLearning.jl icon indicating copy to clipboard operation
ReinforcementLearning.jl copied to clipboard

Rename some functions to help beginners navigate source code

Open findmyway opened this issue 4 years ago • 3 comments

I only realize this problem very recently. Multiple dispatch seems to be overused here in this package. For example, the update! function. I thought it was quite straightforward. When we want to update a policy during interactions with environments, we collect all the necessary information and then narrow them down layer by layer. Just like peeling the onions. And update!(x, y, z...) is usually read as please update x given y and z. Unfortunately different implementations are split accross many different files, which makes it hard for beginners to understand the code structure.

So before we have a smarter IDE to jump between such function calls, we'd better name them more clearly.

findmyway avatar Jun 16 '21 14:06 findmyway

For me, it's a kind of entry barrier for Julia packages (due to multiple dispatch); hard to navigate the source codes. So it would be quite helpful for beginners although people who are already familiar with this concept may not need it.

JinraeKim avatar Jul 23 '21 04:07 JinraeKim

Multiple dispatch seems to be overused here in this package.

I agree particularly on update!. I thought update! was a high-level interface with a limited number of signatures, but it is implemented almost everywhere with no consistency in the signatures. Currently the VS code Julia IDE is somewhat silly when jumping among multiple dispatches, which indeed causes many difficulties to find the true implementation for a beginner like me. For the internal updating that deviates from the standard API, _update! may be a choice.

ShuhuaGao avatar Oct 18 '21 05:10 ShuhuaGao

I'll address it in the next minor release.

findmyway avatar Oct 18 '21 06:10 findmyway