FreeCAD coding/documentation standards?

Discussions about the wiki documentation of FreeCAD and its translation.
User avatar
Kunda1
Posts: 3932
Joined: Thu Jan 05, 2017 9:03 pm

FreeCAD coding/documentation standards?

Postby Kunda1 » Mon Feb 06, 2017 10:29 am

Is there a place where these are stated?
For coding:
uniform coding style for c++
uniform coding style for python
indentation, parenthesis, dos and don'ts
comment styling

I see https://www.freecadweb.org/wiki/index.p ... ource_code but it's a summary not specifics
https://www.freecadweb.org/wiki/index.p ... ui_Command has some info but very limited to specific subject

For documentation:
How to write doxygen comments for FreeCAD? (ref: http://www.iesensor.com/FreeCADDoc/0.16-dev/index.html or https://www.freecadweb.org/api/)
How to comment FC code?

EDIT:
FYI https://www.freecadweb.org/api/ is broken

EDIT 2:
I did find @qingfengxia effort at: https://github.com/qingfengxia/FreeCAD_Mod_Dev_Guide
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
Jee-Bee
Posts: 1699
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: FreeCAD coding/documentation standards?

Postby Jee-Bee » Mon Feb 06, 2017 10:38 am

User avatar
PrzemoF
Posts: 2482
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FreeCAD coding/documentation standards?

Postby PrzemoF » Mon Feb 06, 2017 10:40 am

For python in FEM: https://forum.freecadweb.org/viewtopic.php?f=18&t=12833

There were suggestions to use it for the rest of FreeCAD, but I don't know if it happened.
User avatar
kkremitzki
Posts: 1387
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: FreeCAD coding/documentation standards?

Postby kkremitzki » Mon Feb 06, 2017 11:20 am

Kunda1 wrote: EDIT:
FYI https://www.freecadweb.org/api/ is broken
Fixed via FTP and in repo via PR 504. There's still an error on both HTTP and HTTPS though, what is this "dynsections.js" in
https://github.com/kkremitzki/FreeCAD/b ... r.html#L17
?
It isn't present on the server, obviously, and it isn't present in a "make DevDoc" build folder...

Edit: Bleh, only index.html is fixed, new docs will need to be built.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
User avatar
Kunda1
Posts: 3932
Joined: Thu Jan 05, 2017 9:03 pm

Re: FreeCAD coding/documentation standards?

Postby Kunda1 » Mon Feb 06, 2017 1:15 pm

kkremitzki wrote:
Kunda1 wrote: EDIT:
FYI https://www.freecadweb.org/api/ is broken
Fixed via FTP and in repo via PR 504. There's still an error on both HTTP and HTTPS though, what is this "dynsections.js" in
https://github.com/kkremitzki/FreeCAD/b ... r.html#L17
?
It isn't present on the server, obviously, and it isn't present in a "make DevDoc" build folder...

Edit: Bleh, only index.html is fixed, new docs will need to be built.
Thanks @kkremitzki !
yorik wrote:summoning @yorik to rebuild api docs
Thanks!
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
kkremitzki
Posts: 1387
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: FreeCAD coding/documentation standards?

Postby kkremitzki » Mon Feb 06, 2017 3:14 pm

Kunda1 wrote:
summoning @yorik to rebuild api docs
Thanks!
I actually have FTP superpowers now so I built the API web docs myself and I'm pushing them as we speak 8-)
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
User avatar
Kunda1
Posts: 3932
Joined: Thu Jan 05, 2017 9:03 pm

Re: FreeCAD coding/documentation standards?

Postby Kunda1 » Mon Feb 06, 2017 5:05 pm

PrzemoF wrote:For python in FEM: https://forum.freecadweb.org/viewtopic.php?f=18&t=12833

There were suggestions to use it for the rest of FreeCAD, but I don't know if it happened.
@PrzemoF Great. Should I continue the conversation in the FEM sub-forum or continue it here?
kkremitzki wrote:I actually have FTP superpowers now so I built the API web docs myself and I'm pushing them as we speak 8-)
Awesome...thanks for being so johnny on the spot :D
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
yorik
Site Admin
Posts: 10848
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: FreeCAD coding/documentation standards?

Postby yorik » Tue Feb 07, 2017 12:26 pm

kkremitzki wrote:I'm pushing them as we speak 8-)
Thanks!
User avatar
Kunda1
Posts: 3932
Joined: Thu Jan 05, 2017 9:03 pm

Re: FreeCAD coding/documentation standards?

Postby Kunda1 » Wed Mar 21, 2018 8:38 pm

I'd like to resurrect this thread and continue discussing how to improve the API documentation for FC.
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
NormandC
Posts: 18469
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: FreeCAD coding/documentation standards?

Postby NormandC » Thu Mar 22, 2018 2:59 am

Sorry, I don't have the time to read the linked FEM coding standards topic.

I would like to submit for general standards that when creating a new command that generates an object in the Model tree, the programmer should ensure that the label is available for translation. I've been asking for this for years (there's a very old ticket on Mantis), and no programmer seems to care about it. Currently, only the Part Primitives have translated labels.

FC_translated_part_primitive_labels_01.png
French
FC_translated_part_primitive_labels_01.png (9.52 KiB) Viewed 855 times
FC_translated_part_primitive_labels_02.png
Spanish
FC_translated_part_primitive_labels_02.png (9.76 KiB) Viewed 851 times
FC_translated_part_primitive_labels_03.png
Chinese traditional
FC_translated_part_primitive_labels_03.png (10.8 KiB) Viewed 843 times

This is just one of many usability issues in FreeCAD, and I think it's an important one that would be easy to fix. For most FreeCAD tools, the command is translated, but not its result.

I'm so tired of it not getting done that I would change the source code and submit a PR myself, if someone showed me how. I'm no programmer but I have an analytic mind.