Cycloidal Drive Gearbox

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: Cycloidal Drive Gearbox

Postby vocx » Fri Jan 10, 2020 9:24 pm

iplayfast wrote:
Fri Jan 10, 2020 9:02 pm
So it appears to me that it the CamalCase style is the norm, and by using the snake_case the style is being changed from the norm.

Is there a general push to rename all the functions and classes in FreeCad to use snake_case, or is this something particular to the libraries you are involved in, (Draft,Arch,Fem)?

I'm ok either way, it just seems like something I should question.
As I said, the C++ style is what originally existed, but in Python we always prefer to be PEP8 compliant. Draft, BIM, Arch, FEM, Path are the biggest workbenches in Python and they all use this PEP8 style, albeit a bit inconsistently. We are trying to change it little by little.

We cannot change most of the C++ functions that you show in your example (at least not right now) because that would break the entire software and would be a monumental task. So, it won't be done any time soon. But I have thought about discussing this with WMayer who's the lead C++ programmer to eventually in the future transition to a more Python-like syntax. This would also tie into Qt 6, which is in development. The Qt people are thinking of providing a more Pythonic syntax.

So, yes, the core of FreeCAD uses a CamelCase syntax for historical reason (this style is sort of common in C++). But everything that is programmed in Python, or accessed from the Python console, should preferably be consistent with PEP8 and Pythonic guidelines.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated:
User avatar
Posts: 135
Joined: Sat Sep 07, 2019 6:55 am

Re: Cycloidal Drive Gearbox

Postby iplayfast » Fri Jan 10, 2020 10:10 pm

Converted to snake_case done.

In order to reduce traffic on the announcement forum, I'm encouraging further discussion to happen at ... 61#p359590