Not logged inOpenClonk Forum
Up Topic Development / Developer's Corner / Coding Guidelines
- - By MrBeast [de] Date 2009-06-05 17:12
For such projects like openClonk where a lot of people can extend it it would be good to have some guidelines for coding. (For making the code more uniform.)

What do you think would be good guidelines?

One suggestion would be a prefix for new implented classes. "OC" would be a good one i think.
Reply
Parent - - By Sven2 [us] Date 2009-06-05 17:14
Engine classes are prefixed C4 already. I see no reason to change that to another prefix. If it would be changed, I'd rather go for no prefix at all.
Parent - - By MrBeast [de] Date 2009-06-05 17:16
Because it isn't "Clonk 4" anymore? And to have a difference between the old and the new classes?
Reply
Parent - - By Zapper [de] Date 2009-06-05 18:08

>And to have a difference between the old and the new classes?


To confuse everyone starting to code?
Parent - - By MrBeast [de] Date 2009-06-05 18:13
why should it confuse? Its obvious that the C4 Classes are from the Clonk4 Time and OC stands for openClonk. And a simple hint that the C4 Prefixes are from before OC in the Coding Guidlines isn't really to much demanded...
Reply
Parent - - By Zapper [de] Date 2009-06-05 19:18

>Its obvious that the C4 Classes are from the Clonk4 Time and OC stands for openClonk.


So before using a class you have to think about what it was? And what if C4-Classes are totally recoded (not the interface, of course. Good classes don't need recoded interface)? Change every occurrence of "C4ABX" to "OCABX"?
Parent - - By Günther [de] Date 2009-06-05 19:41

> And what if C4-Classes are totally recoded (not the interface, of course. Good classes don't need recoded interface)?


You obviously have read too much OOP propaganda and not enough C4 classes :-)
Reply
Parent - By Zapper [de] Date 2009-06-05 20:15
Okay, forgot to put "!!!!!1111" at the end of my bracket
Parent - By Günther [de] Date 2009-06-05 19:43
Lots of the classes in the engine are singletons. Using PrefixFoobar for the class and Foobar for the instance is expedient.
Reply
Up Topic Development / Developer's Corner / Coding Guidelines

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill