Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Is the Portage source code a mess or am I just a style nazi?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
kavau
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jul 2004
Posts: 87

PostPosted: Fri Sep 17, 2004 10:04 pm    Post subject: Is the Portage source code a mess or am I just a style nazi? Reply with quote

Hi, this question is mainly directed towards developers, and is certainly not meant to be a Troll. :) I recently started looking through the portage.py code in an effort to learn a bit about the inner workings of Portage. In the process I noticed that the code pretty much violates every style rule in the book. For example,
    - Instead of packing functions and classes with similar functionality into separate modules, everything and their dog are thrown into a single 6500-line file.
    - Initialization code and function definitions are intermingled, instead of packing the initialization code into a single function.
    - Major classes and functions (e.g. the config class and the grab_stacked() function) are defined without any comments, not even a line indicating the general purpose of the class or function.
    - The source code documentation is generally, erm.. a bit sparse, to say it politely.

It seems to me that this messy style can be a serious barrier of entry for people wishing to contribute to Gentoo. Okay, my questions are:
    Am I the only one who has a problem with this? Should I better shut up and change my attitude? :wink:
    Is this the general style among OSS developers?
    Would an effort to clean up the code be appreciated? Or is the prevailing attitude "if it ain't broke, don't fix it"?

Thanks for your feedback!
Kavau
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Fri Sep 17, 2004 10:31 pm    Post subject: Re: Is the Portage source code a mess or am I just a style n Reply with quote

kavau wrote:

Would an effort to clean up the code be appreciated? Or is the prevailing attitude "if it ain't broke, don't fix it"?
Kavau


They may never read your post here. I can't speak for that team, but they generally don't bite if you talk to them (about portage) in #gentoo-portage

And you can always submit your patches in https://bugs.gentoo.org. I hope they wouldn't reject help with cleaning up code and documenting portage classes/functions.

[Edit:]
If you haven't seen this, its essential reading on this topic:
http://dev.gentoo.org/~g2boojum/portage.html
Back to top
View user's profile Send private message
spb
Retired Dev
Retired Dev


Joined: 02 Jan 2004
Posts: 2135
Location: Cambridge, UK

PostPosted: Fri Sep 17, 2004 10:54 pm    Post subject: Reply with quote

Yes, a lot of it is fairly messy (to quote/paraphrase carpaski/ferringb, "emerge needs an exorcism" and "the dep_* functions are quite hard to follow" (understatement of the year there) ). portage.py has far too much stuff in it, but there's active work going on to move it out into seperate modules and clean up the API. It's a mess at the moment, but it'll be improving.
Back to top
View user's profile Send private message
kallamej
Administrator
Administrator


Joined: 27 Jun 2003
Posts: 4975
Location: Gothenburg, Sweden

PostPosted: Sat Sep 18, 2004 7:13 am    Post subject: Reply with quote

I guess this is a typical problem with code that gets added to bit by bit.

Moved from Portage & Programming as it is not a support request.
_________________
Please read our FAQ Forum, it answers many of your questions.
irc: #gentoo-forums on irc.libera.chat
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum