Sunday, December 28, 2008

Learning form jQuery: how to write good software

1. Provide simple interfaces.

Your users should learn how to use your application as quick as possible. jQuery provides the simplest interface for accessing DOM elements. Everything you should know for it is the $() factory function and CSS selectors. Both designers and programmers are familiar with CSS, so you need minimum time to start using the library. Method names are mnemonic, so you can understand their functionality without looking at the documentation.

Providing documentation is a very good approach, but if your users use it very frequently, it is a signal that you should probably redesign your application. Think about what do your users already know about the problem you solve. Try to make your application to be understood intuitively.

Simple interfaces are good not only for end users, but also for developers. If you have simple and elegant interface, you start to write simple and elegant code almost automatically, and this allows you to solve the problem more quickly and efficiently.

2. Solve real problems.

Don't try to invent problems. There is plenty of them around us, and we should concentrate on reducing them, not producing new ones. Working with DOM was a headache of JavaScript programmers for many years, and jQuery provided the best solution for it. There are lots of such problems in each field, and those developers who solve the complicated ones will get the best reward.

3. Provide only those features that are necessary for solving the problem.

Your application shouldn't be giant. Giant applications cost more, have lots of bugs, and it's difficult for users to learn them. And there is the only way to reduce the size of the application - providing less features. Try to improve existing ones instead. Always ask yourself: if the feature I am going to add to my application is necessary for my users, is it going to make their life better? And if the answer is no, stop even thinking about it. You should think about problem you solve, not about features. This is the way you can create cheap, lightweight, and easy to learn applications.

4. Let third-party developers extend your application.

Yes, you should implement only necessary features. But remember that there are lots of users with specific needs and demands. You can not satisfy all of them, but you can create mechanism that will allow third-party developers to do it for you. Export your data through RSS feeds, provide rich API for developers, and you will get more users.

jQuery has a perfect plugin system that allows developers to create new methods and even selectors. As a result, there are hundreds (or maybe thousands) jQuery plugins that do lots of tasks that jQuery is not able to do natively. The library remains lightweight, but users with very specific needs are able to get ready solutions, without need to code it themselves.

5. Be beautiful.

Your application should be charming. When I work with jQuery, I feel its beauty, but I can not explain it. To reach this, you should write your application with passion, you should really love your job. If you do it just for money, the users will notice it. You can create something perfect (or close to it) if only you invest your emotions, the part of your soul to your job.


Kyle Farris said...

Very nice. It's all true too... There is a lot to be learned from jQuery. It's elegant, simple, powerful, and well documented.

pixeline said...

yup, jquery is da bomb !

seribuinfounik said...

Acuteness you exquisite ourselves now end forfeited. Enquire ye without it garrets up himself. Interest our nor received followed was. Cultivated an up solicitude mr unpleasant.
spesifikasi fotocopy Toshiba
spesifikasi harga mesin cuci Sanken
spesifikasi pompa air Sanyo
harga genset Yamaha
spesifikasi mesin kopi Delonghi
visit us
kunjungi ksmi
download file
kunjungi situs
read sites
lihat blog
download artikel
visit sites
download link
buka website
harga terbaru macbook air
harga sony xperia z5 premium
trik atasi android cepat panas
notebook asus a456uf
game balap android