Thursday, April 12, 2012

Prepare for code review!

Thats what I've been doing since I got home at like 3pm.  I went through all of my code, which is the majority in the project.  Since I own the majority, I felt the most pressured to do well tomorrow.  I'm usually proud of the quality of my code, but since I didn't know python well from the start I have some concern that something will be found.  For the most part I expect it to be, "oh you could have named this better".  If that is the worst of my fears, then I think I'll be fine.  Most of what I did today was commenting with the sphinx scheme, which is very close to javadoc.  I did the usual if its not private comment it scheme.  About 90% of my code is in private methods, since most of it is gui boilerplate.  So for the "private" methods, I prefixed them with "_" so I know.  This seems to be the standard in python.

The biggest area of concern for me was the ScanEventEditor.  It is probably the largest single module with about 850 lines of code.  Humongous, I know...  Anyways, my problem with that is python likes to have everything in a single module.  That combined with the small scope of the project I initially decided to keep the controller logic for the editor in the same file as the view stuff.  Terrible.  Well, think about it this way - If I was to make it more MVC modular, I'd put the controller logic in a different class than the view logic.  In python's way of doing things, this would mean I'd have 2 classes in the same module (file).  What would that really get me?  I'd still have to deal with it all in the same file.  The only difference would be at some point in the code I'd add a line "def class <name>".  Thats pretty much it.  What I did do to mitigate any negative feedback about this part is I organized the file layout better.  All the controller code is in the same place, labeled with what parts it controls.  All of the gui creation stuff is in a different part labeled as well.  This way it is almost identical to being in different classes, except I don't have to add inter class communications between them.  Win Win.

The last person I'd like to be tomorrow is Alfonso.  Maybe at some point ackley will get bored looking at gui boilerplate, and ask to see some of Alfonso's code.  Haha!  Good luck trying to find some.

I always think my code could be better.  We'll find out tomorrow if I'm the only one.

No comments:

Post a Comment