Author Topic: Kicad code review, after a quick poke around in the source.  (Read 1822 times)

0 Members and 1 Guest are viewing this topic.

Offline HackedFridgeMagnet

  • Super Contributor
  • ***
  • Posts: 1939
  • Country: au
Kicad code review, after a quick poke around in the source.
« on: April 25, 2013, 02:25:40 am »
I just had a look at some of the Kicad source code.
It's much better than I have been led to believe. Although I only looked at the PCBnew.exe

Some of the good things were:
It uses STL vectors
I only counted one char* in the files that I saw.
There was quite a bit of explanatory commenting.
It uses lots of functions to neatly encapsulate logical steps, with meaningful function names
The smaller functions seem to pass in all the necessary parameters
I didn't see any really bizarre or obscure c++ stuff that would be perfectly legal but is better not used.

There does seem to be some newer code classes mixed with some older ones.
Many files have the "class_" filename prefix such as  "class_pcb_layer_widget.h" these use the .h and .cpp file types in the traditional manner.

The other ones are all over the place.
eg. "block.cpp" has a member function for class PCB_EDIT_FRAME and a member function for class DIALOG_BLOCK_OPTIONS.
"editedge.cpp" also implements a function of the class PCB_EDIT_FRAME??!
This does need a reorganisation. I didn't actually find the declaration of these classes.

Overall I think the code quality seems pretty good.
I have seen far far worse, and for a large legacy O/S project I couldn't really expect better.

Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo