Opened 17 years ago
Closed 15 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 <[email protected]…> | |
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 17 years ago by
Milestone: | → 0.2release |
---|---|
Version: | → 0.0 |
comment:2 Changed 17 years ago by
Milestone: | 0.2release → 0.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 16 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
still no success criteria. closing.
comment:4 Changed 16 years ago by
Milestone: | 0.3release → 0.5 |
---|---|
Resolution: | invalid |
Status: | closed → reopened |
Version: | 0.0 → 0.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 16 years ago by
Cc: | Paul Sowden <[email protected]…> [email protected]… 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 16 years ago by
Cc: | [email protected]… removed |
---|
comment:7 Changed 16 years ago by
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 15 years ago by
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 15 years ago by
I think it is actually much worse for local and private vars now...
comment:10 Changed 15 years ago by
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 15 years ago by
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
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.
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.