glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [glob2-devel] Ugly code in glob2 hg


From: Bradley Arsenault
Subject: Re: [glob2-devel] Ugly code in glob2 hg
Date: Wed, 4 Jul 2007 10:57:26 -0400



On 7/4/07, Stéphane Magnenat <address@hidden> wrote:
Hi,

I've had a quick look at src/GameGUI.cpp to look for the scroll bug, at I've
discovered with horror that there is a lot of key related code that is not
styled according to glob2's coding rules. This code is very hard to read and
thus very likely to hide bugs. I've fixed it, but please take care of doing
good looking code.

Furthermore, this key code is full of "if" and "case", which shows a bad
coding practice. This should be improved with tables and indexes.

Also, indexing actions with strings is bad for readability and efficiency.

Oh and did I mentioned it is fully uncommented?

In summary, I don't have time to find the bug now in such a mess.

Steph

--
http://stephane.magnenat.net


_______________________________________________
glob2-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/glob2-devel

Then try rewriting the mess like I have been. Anyhow indexing by strings I chose specifically because it was good for readability, in fact this was discussed a long time ago (when I did customizable keyboard shortcuts), we concluded that for anyone half intelligent an enum was just as readable, however the change was never done.

--
Really. I'm not lieing. Bradley Arsenault.
reply via email to

[Prev in Thread] Current Thread [Next in Thread]