design and refactoring to do

Release and discuss things you've made, including mods.
Posts: 58
Joined: Mon Feb 11, 2013 1:02 pm UTC

design and refactoring to do

Postby freem » Sat Jun 01, 2013 1:18 pm UTC

Through the discuss I had on IRC yesterday, it seems many areas could use refactoring, but remembering them after an IRC discuss is not really easy, so I would like to know if it would be possible to add a dedicated sub-forum, where it would be possible to describe current design, what could be made to enhance it, which areas of the code are the most urgent to refactor, refactoring rules (what should be sent in other files or which modules could be simplified by example), etc.

Here is a list of what I remember from the discuss:

* G_*Timer* in gamelogic/cgame/cg_draw.c needs cleanup
* aliens attacks needs simplifications (of the code, not of behavior)
* winning and loosing conditions should be decoupled to allow easier implementation of new kinds of games

Of course, it can be doable to continue to discuss all of this on a single thread, or just random threads in programming, but I think refactoring is a very special case of programming, because it does not affect the behavior if it is well done, and it can make further changes easier... or harder if the resulting design is bad.
Making things worse is not an objective, of course, so it needs coordination, and since we are from different regions of the world, IRC is not the panacea.
I am not too bad in code design, but I am more used to create stuff from scratch, which is not doable in the unv's situation, and I can not easily think about better design since I do not know the current one.
To show what I mean, here is an extract of yesterday's discuss (it is an example of things which needs to be discussed somewhere where they could stay alive and allow other contributors to take part to discussions. An example, so, not the thread subject.)

IRC wrote:03:12:54 <`Ishq> Just out of curiosity how far do you want to go?
03:13:03 <Freem> how far in what?
03:13:11 <`Ishq> g_shotgun.c, g_rifle.c vs g_weapon.c for all weapons
03:13:18 <`Ishq> Is that something yd like
03:13:19 <`Ishq> or
03:13:21 <`Ishq> g_dretch.c
03:13:24 <`Ishq> g_dragoon.c
03:13:52 <Freem> g_dretch.c / dragoon.c /etc would be an error for me.
03:13:56 <`Ishq> What I mean to ask is what new files will you create?
03:14:12 <Freem> the g_shotgun/rifle/etc would be doable if stuff is not too short
03:14:30 <Freem> hum
03:15:04 <Freem> it depends on current stuff, I can not really speak without code knowledge
03:15:18 <`Ishq> Just from the stuff you have looked at.
03:15:25 <`Ishq> What new files would you have created
03:15:32 <Freem> but by example, when you have 2 teams with very different behaviors in one file, i think it is wrong
03:16:03 <Freem> I think I would have sent each team in it's own folder
03:16:30 <Freem> and sending what they have in common in some files
03:16:44 <`Ishq> team_common
03:16:46 <`Ishq> team_alien
03:16:47 <`Ishq> team_human
03:16:49 <`Ishq> ?
03:16:51 <Freem> something like that yes
03:17:08 <`Ishq> I see.
03:17:35 <Freem> it could be a first step, depending on how long team_something stay
03:17:44 <`Ishq> Right.
03:17:52 <Freem> generally speaking, when I do my own programming, I work with very atomic classes
03:17:59 <Freem> and ultra specialized functions
03:18:12 <Freem> of course, I ususually use C++ :)
03:18:16 <`Ishq> Well, yes. That is what is encouraged.
03:19:03 <Freem> this is not something which is present in unv, and I think it is a big problem for newcommers
03:19:20 <Freem> of course, you know the code, so maybe you do not see it as very problematic

I think it really shows the limits of a newcomer as I (in the unv code. About programming, I do not think I am still a newbie, and I'm also not an expert) and the interest a more stable discuss could have.

IRC is good for fast discussions, but forums allows more organized debates, so I think this kind of discussions should be [u]mirrored/backed-up[u] from IRC to forums, allowing us to have fast ideas exchanges and clarifications on IRC reinforced by good argumentations and more general opinions on forums.

Return to “Community Development”

Who is online

Users browsing this forum: No registered users and 3 guests