Opened 14 years ago

Closed 12 years ago

#68 closed defect (invalid)

less cryptic variable names in Dojo

Reported by: psowden Owned by: alex
Priority: high Milestone: 0.9
Component: General Version: 0.3
Keywords: Cc: Paul Sowden <paul@…>
Blocked By: Blocking:

Description

Dojo is full of cryptic variable names such as tn, lf, ghm, etc.. which makes it hard to debug and hard to understand for folks unfamilier with the code.

The build system has variable renaming for compactness and obsfucation or what have you, there is no need for cryptic names.

Change History (11)

comment:1 Changed 14 years ago by schontz@…

Milestone: 0.2release
Version: 0.0

While this may seem trivial, I think it is incredibly important that variable names be easily understood, even internal ones. Especially if the public version of Dojo is going to be compressed, we really have no business saving space. Now, if you want to use a short name with abbreviations locally to save keystrokes, that's fine.

comment:2 Changed 14 years ago by alex

Milestone: 0.2release0.3release

no one has volunteered criteria for success on this widget. Punting to 0.3 unless someone lands a patch or a set of success criteria which would allow it to be closed for 0.2.

comment:3 Changed 13 years ago by alex

Resolution: invalid
Status: newclosed

still no success criteria. closing.

comment:4 Changed 13 years ago by skinner

Milestone: 0.3release0.5
Resolution: invalid
Status: closedreopened
Version: 0.00.3

Looks like this bug was closed for lack of success criteria, so let me offer an idea...

The Dictionary Criteria: A dojo package qualifies as having "less cryptic variable names" (and this bug no longer applies) at the point when 80% of the variable names include at least one word that you can find in an ordinary english dictionary.

Examples of variable names that pass the Dictionary Criteria:

width
offset
delay
findLast
ptype
method 

Examples of variable names that fail the Dictionary Criteria:

wh
ns
cb
farr
e
kwArgs
lvl

With the cool new doc parser, it would also be possible to write a simple unit test that would pass or fail based on the Dictionary Criteria.

comment:5 Changed 13 years ago by skinner

Cc: Paul Sowden <paul@…> schontz@… added

Or, simpler but less robust than the Dictionary Criteria...

The Five Letter Criteria: A dojo package qualifies as having "less cryptic variable names" (and this bug no longer applies) at the point when 80% of the variable names are at least 5 characters long.

comment:6 Changed 13 years ago by david

Cc: schontz@… removed

comment:7 Changed 13 years ago by skinner

one more thought...

This might be an especially good bug to leave open as "low hanging fruit" for someone who's just getting involved in the project and looking for a useful way to contribute as they're reading through the code. (It's maybe similar in spirit to the notion in the Wikipedia community that fixing typos is a good first step toward getting involved.)

comment:8 Changed 12 years ago by tk

Was this ticket taken into consideration with the 0.9 rewrites? I hope so...

in comment to the 5 letter rule, that would allow vars like kwArgs to be used where the dictionary one would not... and we might end up with vars like 'abcde' and 'fghij' :P

comment:9 Changed 12 years ago by dylan

I think it is actually much worse for local and private vars now...

comment:10 Changed 12 years ago by tk

I was afraid of that... we really should establish some guideline for policing tickets... so this doesnt happen all the time.. .I wrote a custom query to order the tickets by last modified time... its pretty interesting to see... its query 32 I believe...

comment:11 Changed 12 years ago by Adam Peller

Resolution: invalid
Status: reopenedclosed

I think the age of this ticket and lack of progress proves that a ticket is the wrong way to address this. Let's move discussion to the forums and update the style guide, if needed, and encourage people to make improvements in their code. Leaving bugs open deliberately is not a good idea, IMO.

Note: See TracTickets for help on using tickets.