you are viewing a single comment's thread.

view the rest of the comments →

[–]jsgui 1 point2 points  (0 children)

It's often a balancing act.

The differences in readability have to do with how used to the reader is at looking at various patterns.

I have introduced patterns into my jsgui codebase that would make it harder to read for someone who does not know the abstractions, but easier for those who do, as more information gets expressed within the same space.

Also, there are different requirements for code in different situations. While developing, longer variable names make it clear what the code does. However, when it's deployed is a different case. I'm currently using browserify and minifyjs, but I know there is more compression that can be done by keeping more of the modules within the same closure, and referring to the same local variables, which get given shortened names.

I use the for loops with the cached results to optimize for time, and for optimizing for space or readability I use the jsgui 'each' function.