Godot version:
3.1 (master)
OS/device including version:
Windows 10
Issue description:
There are some files in the cpp codebase that look like obfuscated code.
Example:
Steps to reproduce:
I understand this is subjective, but there are still some improvements like e.g. using readable variable names, that can improve community collaboration. BTW I have no idea what those variables are.
Please don't bloat the issues with those generic "make code more beautiful" or "make the engine better".
We need specific feedback on specific things, not vague assumptions on the engine code quality that are impossible to solve.
t = time
b = beginning
c = change
d = duration
out and in, appear to mean ease out, and ease In
This appears to be where the code came from:
https://github.com/jesusgollonet/ofpennereasing/tree/master/PennerEasing
Someone made a pull request in that repo that removes a lot of the weird stuff in the tween code.
https://github.com/jesusgollonet/ofpennereasing/pull/2
Please don't bloat the issues with those generic "make code more beautiful" or "make the engine better".
We need specific feedback on specific things, not vague assumptions on the engine code quality that are impossible to solve.
Maybe it's just me, but I don't think this is one of those "generic issues" or "vague assumptions" that are "impossible to solve". That code shown as an example is definitely unreadable. I have little idea what is going where, and it's hard for me to figure out what parameters are for what because this seemed like a case of minimal code > readability. Even with what @DarkChowder posted, that code is still hard for me to read. That example code just screams "don't maintain me", in my opinion.
That being said, yeah it would help if specific files were given. But for the moment, let's not assume we have to immediately scour every single file and PR to make sure the code is readable -- instead, let's just fix them as we find them.
As mention, the readability issue could possibly be solved by simply changing the names of those variables to something a little more descriptive.
If that is all there is to it, then I don't see why it shouldn't happen unless the proposed names happen to be quite long.
Math-intensive code is fine, it's just the Tween code which is ugly as heck. It was contributed and merged in the early days of Godot, it would never have passed our current PR review standards.
So yeah, PR welcome to refactor that code.
Maybe it's just me, but I don't think this is one of those "generic issues" or "vague assumptions" that are "impossible to solve". That code shown as an example is definitely unreadable. I have little idea what is going where, and it's hard for me to figure out what parameters are for what because this seemed like a case of minimal code > readability. Even with what @DarkChowder posted, that code is still hard for me to read. That example code just screams "don't maintain me", in my opinion.
Indeed this specific code does need improvements. And fixing this is welcome.
Still there were plenty of other issues like "making the docs better" or "asks devs to make better issues" & all, which are completely vague and impossible to mark at solved and end up in the backlog stacking under 4000 other ones. A good issue solves a single thing at a time, spot a single problem that can be solved.
I saw some Javascript/Typescript repos that fix the "improve code readability" issue by using a linter. I would like to know your opinion about using a linter in this repo. (they exist for js, css, ts, so probably there are some good ones for cpp)
I saw some Javascript/Typescript repos that fix the "improve code readability" issue by using a linter.
I don't think a linter can solve variable names, only formatting. We already use clang-format for that.
Most helpful comment
Math-intensive code is fine, it's just the Tween code which is ugly as heck. It was contributed and merged in the early days of Godot, it would never have passed our current PR review standards.
So yeah, PR welcome to refactor that code.