About using someone else's code. Pager plugin for smarty.

    Recently, once again, to the sound of sympathetic remarks “do not reinvent the wheel”, I ran into the glitches of someone else's code. In this case, it was a semi - official “pager” plugin for smarty , which worked terribly crookedly (I didn’t even figure out why, because it’s useless anyway). Last time, I wrote my class for converting JSON <-> Object, which really converted all types correctly, did not use UTF-8 and correctly reported if something was wrong, and did not stupidly return emptiness. The year before last - two hours of trying to get drag'n'drop from mootools to do what I needed, led to writing in 40 minutes my own drag'n'drop for JS.

    This time everything ended in a similar way - his “pager” was written, which subjectively turned out to be much shorter, clearer, more usable. Calling my plugin requires much less extra parameters, fits on one line, is semantic code friendly with CSS coloring. There are also fewer little chips in it (do you need them?).

    Here it is , if anyone is interested.

    At the same time, I am sure that many other people can have no less complaints about my plugin than I have against the one I refused. Because this is someone else's code .

    conclusions: Own code, especially if it is adapted for reuse is always better than the same, but taken from the outside. If someone else says “don't reinvent the wheel”, I will look down at him condescendingly. And then they like to be clever here, damn it ...

    Also popular now: