📜 ⬆️ ⬇️

About the use of someone else's code. Plug-in "pager" for smarty.

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

This time it was all over the same way - my “pager” was written, which subjectively turned out to be much shorter, more understandable, usable. Calling my plugin requires much less extra parameters, fits on one line, is friendly to semantic code with CSS coloring. Fishechek in it is also smaller (and they are needed?).

Here it is , if anyone is interested.
')
At the same time, I am sure that many other people to my plugin may have no less complaints than I have to the one I refused. Because it is someone else's code .

Conclusions : Its code, especially if it is adapted for reuse is always better than the same, but taken from the side. If someone else says, “don't reinvent the wheel,” I will look down on him indulgently. And then they like to be clever, damn ...

Source: https://habr.com/ru/post/20548/


All Articles