Top-level object names for JavaScript class libraries user experience Analysis _javascript skills

Source: Internet
Author: User
Because top-level objects are portals that use almost all of the functionality of the class library, these characters are frequently entered in the encoding, so the simplicity of the top-level object name input is also important when designing the class library.

This will focus on the three class libraries from the length of the object name and the key sequence of the input object name, while trying to take care of some special points to get a more comprehensive evaluation result.

name Length
jquery is a total of 6 characters, from the length of the three class library The longest one, also contains a capital letter Q, in the input process needs to join the SHIFT key, so the length value is given 7.

Ext is a total of 3 characters, is the most advantageous length, because the first letter is uppercase E, the input process needs to have a shift, so the length value is given 4.

The Kissy is composed of 5 characters, all uppercase letters, close to jquery in length, and the long press of the SHIFT key at a time, so the given length value is 6.

The most popular jquery in terms of name length is a weak disadvantage, but jquery uses other ways to make improvements in this area, which will be mentioned later in this article.

Key Order
The key sequence analysis is more complex, here are the principles involved in the following points

Use both hands to enter each character as much as possible.
Avoid continuous use of the same finger as far as possible.
As much as possible, reduce the length of time to press a key.
The index finger and middle finger are more flexible, so avoid using the pinky and ring fingers as much as possible.
Closer to the two fingers are prone to linkage phenomenon, that is, when the little finger moves, the ring finger will also reflect the micro-amplitude of movement, which may affect the next button, so as far as possible to avoid parallel fingers linked.
In the evaluation, the hands from the left little finger to the right hand little finger, numbered 0-9, from the digital observation will find some interesting phenomenon.

The key sequence of jquery is 606236, in the process of entering

One time the less flexible left-handed little finger was used.
On the basis of a previous supplement, in fact, the need to press Q with the left hand hold SHIFT key, so Q is actually to the original is not responsible for the Q key of the left ring finger.
In the input of capital Q, the left little finger and ring finger are linked to the phenomenon, but not in order to connect, but also percussion.
E and R are continuously struck by the left middle finger and index finger, which may have the effect of parallel finger movement. But in the actual input process, the author found that the index finger and the middle finger of the link not only has no effect on the efficiency, but the speed has a role to play, reflect on the process, found that the middle finger and forefinger continuous tapping desktop is the author in thinking often do the action, so formed a very efficient and skilled reflection movement ...
Ext key sequence is 213, the input process has found the following problems

All keys come from the left hand and the right hand is completely free to achieve the maximum input speed of the theory. But because in the process of entering ext, the right hand can be positioned at the same time. This button, therefore, does not affect the input of the whole line statement very much.
Enter the capital of E, the left pinkie need to hold down the SHIFT key, and immediately after the input x, the left ring finger press the front of the moment required to release the SHIFT key, because the two fingers are easily linked to the response, so the left hand according to the X-key positioning accuracy has a greater impact.
Kissy's key sequence is 77116, which is probably the worst sequence in a few class libraries.

Appears the right hand middle finger, the left-hand ring finger continuous key phenomenon, the right hand middle finger even needs in presses 2 keys the process to carry on the movement, seriously affects the input speed.
In the fast input process, the left pinkie needs to be long press SHIFT, the little finger is the least powerful of all fingers, the long press of the Non-alphanumeric key will cause great pressure on the little finger, long-term input little finger joints will become stiff, this can rise to the health of the developer height ...
In the middle finger long press shift process, there are 2 consecutive left ring finger input, the original ring finger and little finger will easily appear linkage, so in the ring finger constantly on the same point (S key) afterburner, unloading process, the pinky will follow the ring finger appears strength, weakening phenomenon, The worst case will cause the SHIFT key to be loosened. This sudden increase in strength and weaken the opponent Knuckles also have to ignore the damage, so in the input kissy these characters in the process, we left the little finger is great, he resisted the tens of thousands of pressure, and finally the glorious completion of the task!
Other
jquery is very thoughtful by using the alias $ to turn the more complex object name into a simple character, and also to not forget to provide the noconflict function locally to free the $ variable.

Ext because of the object organization reason, call a function usually need to enter more paths, example good jquery (selector) in Ext will become Ext.Element.query (selector), at this point, Ext has pushed some of the commonly used functions under the Ext object, such as Ext.Element.fly into Ext.fly,ext.domquery.select into Ext.query, and so on, but in terms of overall code, it's a disadvantage compared to jquery.

Kissy combines the modular structure of ext, at the same time, it also introduces the problem that ext function access path is too long, because there are such problems in the With statement in JavaScript, and the use of aliases in place of deeper objects will have such problems, so this kind of problem is not easy to avoid.

Why not analyze Yui? Because used to ext, late jquery use much, Kissy is in the author into the front of this field after the rise of concern also more, Yui from beginning to end without contact is the author of a great regret, but also let the author lost in this article evaluation of the framework of the right.

Summarize
We will be in the following ways to each class library to score a

Length can be divided into 10-length values.
The key sequence is divided into 10, each occurrence of a problem buckle to 1 points, there are particularly serious problems deducted 2 points.
The final results are shown in the following table

Name length Key order note
JQuery 3 6
EXT 6 7 Access function path too long deduction 1 points
Kissy 4 3 Some problems more serious than 4 points

The final statement: I absolutely do not have black kissy meaning, on the contrary, Kissy design, module separation, implementation and so have a deep interest, but this article only from the top-level object name input experience on the evaluation, at this point Kissy did choose a bad name.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.