📜 ⬆️ ⬇️

About the benefits of prefixes

I want to talk about the not quite obvious benefits of prefixes in the names of names and types. I believe that any development that has an external API, must have prefixes, and not carefully selected from the ceiling.
It's all about the convenience of finding information. I have been familiar with box2d for almost a year, a little more with SDL and for about two months I started writing under ios (cocoa). And when working with these libraries, I felt an extraordinary ease and convenience. And more recently, when I took up actionScript tightly, I realized what makes the libraries different from the standard Adobe runtime: prefixes. And it's not about the code, not about the availability of packages or namespaces. The point is google. It's just gorgeous, type in SDL_MOUSEBUTTONDOWN, or NSArray or b2Shape in Google and immediately get what you are looking for. This is a huge plus, the ability to instantly find what you need, a very important part of good api. To find documentation or third-party discussions on Array from Adobe, you need to assign all sorts of things, such as as3 or Adobe, some articles are lost and are not found that way. On request “array sort” google msdn and java and flash and php.

I think that all api with which other developers will interact need to be prefixed. At the same time, it is necessary to google them, in order not to intersect with those already occupied. This will make developers working with your api happier.

This text is published under the license CC-BY .

')

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


All Articles