Developing production code (with database)

Discussion and feedback on Construct 2

Post » Sun Aug 31, 2014 8:51 am

grossd wrote:re: "Not possible"

I agree. With the right parameterization it can be done, but it would involve other tradeoffs, such as larger event sheets and more parameterization -- which makes the code less understandable.

re: duplicate code

I surely understand the "evil" of code duplication. However, during prototyping, code duplication can save significant time and cost -- even if i systematically need to make changes across several event sheets -- and I have to do this rather frequently. These event sheets are btw easy to spot since code duplication is only needed for very similar layouts -- such as when "AB" testing layouts ...


Well, at the beginning of this very thread, you asked for advice on production quality code, and that's what I'm giving you. And I beg to differ on parameterization making it less understandable. Consider the example I edited in to my previous post.
B
54
S
19
G
13
Posts: 97
Reputation: 10,146

Post » Sun Aug 31, 2014 9:38 am

Thank you for your parameterization example:

There are indeed different kinds of parameterization. The kind that I am referring to are those that act as preconditions in events, and/or use data structures (such as dictionaries and arrays) to allow flexible processing of contents. In such cases, code typically becomes less understandable, since the code deals with exceptional cases, that have to be treated in a generalized manner, and with acting upon datastructures that store relevant data rather than the data itself (it adds indirection).

To give a simple example,

Suppose you have an language dictionary set up to deal with multiple languages. So your code "knows" (is designed) how to map the current language setting, say "en", and a unique string identifier, #Game1Greeting, to a language string. All works well for languages until you notice that you have to specifically deal with the gender of the player -- in Hebrew, for example. So now you need to think how to add this additional detail into your code and datastructure -- and it doesn't fit as neatly to the mapping before.

Its clearly doable but its unanticipated changes you encounter as you learn more about the structures of the game add key complexities.
B
8
S
4
G
1
Posts: 205
Reputation: 1,354

Post » Sun Aug 31, 2014 9:47 am

"well, at the beginning of this very thread, you asked for advice on production quality code, and that's what I'm giving you. "

Indeed, and your advice is very sound!

thank you,

Dan
B
8
S
4
G
1
Posts: 205
Reputation: 1,354

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests