-
Notifications
You must be signed in to change notification settings - Fork 326
Prefix all declared function parameter list identifiers with a
#264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Wait, we're now using hungarian notation? |
Not familiar with that term but this will clear up coding issues especially in between object names and identifiers. Stands for argument btw... similar to our r requirement for regular expressions. This is a perfect example right where I'm at too: strat: aStrat.name, vs. what we have been doing of: strat: strat.name, The latter can confuse anything. |
We're only prefixing function parameter names. Nothing else.
|
Correct. |
a
a
a
a
Oh, it's a strategy not array strategy. Hungarian notation prefixes the data type. Where In javascript, |
* Normalize `callback` and `cb` to `aCb` Not finished yet but shown for @Zren to see what I'm doing Applies to OpenUserJS#264
The main reason is for human readability... e.g. not having to figure out if it's a parm or an intermediate.
That's probably something that could go into the STYLEGUIDE.md for sure. |
If the key name is the same as a variable in the current scope or always? |
This issue... has the sounds of the need to use an editor that you can set the color of parameters differently. |
Applies to OpenUserJS#264 and d7465a3#commitcomment-7004333 > You don't use short forms (cb = callback) with verbose varible name standards. Not explicitly declared the STYLEGUIDE** but can be used to accomodate those who don't know what the short term of a callback is... been debating on making a minimum length too. e.g. not one letter identfiers with a potential prefix.
Always... if this goes in there. Let me finish with this issue and we can discuss that change in another one.
I won't be distracted from this issue by debating what editor is better than another. Thanks though. |
My point was that it makes it harder to read these variables, rather than easier. Using a different syntax colour for parameters is the least intrusive on the codebase. Too many variables are using shortforms that using this style will break the point of using the shortform and force to be renamed. Point me to another javascript codebase that does this. |
Your point is exactly to compare editor highlighting capabilities and that is off topic. I've made my share of not catching STYLEGUIDE.md mistakes and you and sizzle have as well... part of the issue mentioned yesterday (that you didn't comment on but you did comment (albeit in the wrong issue ticket) ) ... is that the code is unreadable both human and logically. A simple |
Didn't read the entire thread, I only skimmed it. It was about removing old code and existing consistency. Not new styleguide standards or so I thought.
...
|
That's something for you to improve upon. I reread every comment every day on current issues... sometimes even the old ones to see what has changed.
In relation to what? What are you talking about? There is no logic removal with this. I think you need to ask yourself why are you fighting a standard naming change that many projects already have in place. It's not that difficult to ignore the |
Name 1 |
The entirety of Mozilla (a few thousand or so). I'm done having you argue incessantly on this... I am more than willing to accommodate reasonable change given there is sufficient proof... which you haven't given at all for this. |
Greasemonkey, to name just one (for below, bolded is for arguments, italicized are points of interest):
Basically:
It isn't System Hungarian notation, which is what you are thinking, but Apps Hungarian notation (System vs Apps Hungarian notation). Not everyone has a code editor that stylizes arguments different from other variables, nor should they be required. For example, Sublime doesn't know the difference between the two: I am +0. Just quit spamming my inbox with petty arguments. |
Ah. The only ever project I've seen (system) hungarian is jQuery.DataTables, and they're moving away from it.
While our site is for userscript browser extensions like Greasemonkey, our site doesn't depend on it. They depend on us. The technologies we use don't use it.
Mozilla's style guide also has to deal with C++, and it makes sense for them to have a consistent style guide... I guess.
Short forms are now capitilzed and they look terrible.
Your theme doesn't do it. It's possible to do as the scope is defined. Most themes don't do it as you don't normally need to treat arguments special. |
…ve libs to do. * Changed "WARNING" on login page to "CAUTION"... a little too assertive... some users may want their email addy in there. * Notated some STYLEGUIDE conformance needs * Notated very short function name(s) * At least one undefined identifier
Nearing completion. A few areas are marked as Ambiguous because it is unclear on how to convert them because historically the STYLEGUIDE was not followed regarding unique identifier naming sequences. This is reason No. 1 for doing this... as a few of you haven't been paying attention to this much. A few areas are also not in compliance with naming standards of not using Duplicate code for searching is historically present. Have to run this through some final checks to see what is and isn't busted. Known TODO:
@sizzlemctwizzle
@cletusc |
* At least 1 redundant/unreachable statement found Applies to OpenUserJS#262 Also some uncaught OpenUserJS#255 because no code was executed before... but not doing all of these yet.
* Change/Add some more comments in for Ambiguous * Remove some comments added as it appears they have been identified. * Unified what comments I found that I added for 264. Applies to OpenUserJS#264 as well
* Removed one comment Applies to OpenUserJS#264 and inclusive to OpenUserJS#262
Closed by #267 |
PLEASE TEST THOROUGHLY! Applies to OpenUserJS#264
* Currently pro returns a 502 and dev returns the error when trying to submit a change to an OUJS collaboration... this *should* fix that... works on dev. Refs: * OpenUserJS#273 * OpenUserJS#264
* Missed Apps Hungarian notation from OpenUserJS#264 * Curly braces with newlines
* Basic statusCodePage for those users who are accidentally/intentionally putting in blank comments... applies to OpenUserJS#37 * Some missed Apps Hungarian from OpenUserJS#264 ... there's probably more. ;) * Some STYLEGUIDE.md conformance with braces, newlines and indention * Stray trailing comma fix * Flip Cancel and Reply buttons... this may be some of the accidents with empty comments. Most likely when someone is going full screen they might be clicking reply on touch screens... favor canceling instead of replying if that's the case
* `a`Modelname indicates "live" Object document vs `a`ModelnameData indicates that `toObject()` is applied for plain JavaScript Object and is EXPECTED... the "old style" was due to lack of Hungarian Apps notation See OpenUserJS#264. There is inconsistency noted in the individual parsers here but leaving until further testing can be done * Line length max 100 excluding TODO/NOTE/BUG comments as those should eventually go away * Added some issue pounds to what needs to be done in these files * More STYLEGUIDE.md conformance with newlines * Top header style conformance previously done in controllers * `var` hoisting as per STYLEGUIDE.md for ES5 coding **NOTES** * All of this should be a parallel change e.g. no logic changes * Some *mu2* *(mustache)* `option`s appear unused... followup Applies to OpenUserJS#819 and OpenUserJS#262... treads on OpenUserJS#262 (comment)
Applies to #262
The text was updated successfully, but these errors were encountered: