Difficult code

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
bjorn
Posts: 75
Joined: Thu Apr 28, 2011 3:13 pm

Difficult code

Post by bjorn » Wed Aug 07, 2013 10:52 am

Lately I have started to look closer at the code of CMSimple_XH. Well, I know that I'm not a PHP wizard but I think it is difficult to read and understand the code. Much more difficult than the original CMSimple. Just to mention a few examples, I think it is hard to figure out how to integrate external editors. I also find it difficult to understand why there is both a defaultconfig and a config to be included one after the other.

If we want to attract more developers I think we need a better manual and especially some good examples of plugins and user functions.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Difficult code

Post by cmb » Wed Aug 07, 2013 11:55 am

bjorn wrote:I think it is hard to figure out how to integrate external editors.
Indeed, that's quite tricky. The increased complexity is primarily due to the possibility that plugins can use the editors now very easily. Before CMSimple_XH 1.5 a plugin requiring an HTML editor had to include one itself (cf. SMU vs. Extedit_XH) or did offer a textarea only (cf. Also vs. Coco_XH). After all, there is some documentation available in the CMSimple_XH wiki (should be improved, however).
bjorn wrote:I also find it difficult to understand why there is both a defaultconfig and a config to be included one after the other.
That was meant as a simple way to solve update issues. When doing an update, one only has to upload defaultconfig.php (not config.php), and any new settings will be added to the (possibly modified) settings of the old version. That's basically the same for the language files, what's documented in the CMSimple_XH wiki. After saving the new configuration (resp. language settings) one can delete defaultconfig.php (resp. default.php). However, in the long run we should have an update script, so merging of the configuration and localization can be done there, so it's not necessary to read the default(config).php on each page request.
bjorn wrote:If we want to attract more developers I think we need a better manual and especially some good examples of plugins and user functions.
I agree (and IMO attracting more developers is mandatory for the success of CMSimple_XH in the long run). A bit is already there in the developer manual (the plugin tutorial tackles the basics of writing a plugin). For CMSimple_XH 1.6 generated code documentation will be available (a somewhat outdated version can be seen on http://3-magi.net/doc/).
Christoph M. Becker – Plugins for CMSimple_XH

bjorn
Posts: 75
Joined: Thu Apr 28, 2011 3:13 pm

Re: Difficult code

Post by bjorn » Thu Aug 08, 2013 12:31 pm

Thank you Christoph!

I know it isn't easy. Programming is always a compromise between a lot of conflicting things. But I really think we need some people who can explain things to new developers in a good way. Here is an example on what I talk about: [url]http://cmsimple_addon.famnissen.dk/?Write_your_own&print[/url] This helped me a lot first time I wanted to understand how plugins for CMSimple was written.

In the recent years the team behind XH has developed CMSimple's functionality but at the same time sacrificed some of its simplicity. I'm not complaining I'm just trying to point out a weakness that we should try to do something about if we want to increase CMSimples popularity

Björn

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Difficult code

Post by cmb » Thu Aug 08, 2013 3:29 pm

bjorn wrote:Here is an example on what I talk about: http://cmsimple_addon.famnissen.dk/?Write_your_own&print
I didn't know that before--thanks. But actually the Plugin Tutorial is quite similar (a bit more verbose, though).
bjorn wrote:In the recent years the team behind XH has developed CMSimple's functionality but at the same time sacrificed some of its simplicity.
Yes, and unfortunately much of the extensions were not properly documented. For instance the page data API still lacks an understandable description. Yet there's only a short documentation about some useful methods of the $pd_router object (Martin PM'ed this once to me when I developed Pagemanager). The biggest problem is always the lack of time (and that most developers prefer developing over writing documentation ;)). I hope we can catch up with the developer documention in the next weeks and months during the beta phase of CMSimple_XH 1.6.
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply