Skip to content

Unclear best-practices guidelines in Advanced Plugin Concepts #513

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

Closed
teo1978 opened this issue Jun 20, 2014 · 2 comments
Closed

Unclear best-practices guidelines in Advanced Plugin Concepts #513

teo1978 opened this issue Jun 20, 2014 · 2 comments

Comments

@teo1978
Copy link
Contributor

teo1978 commented Jun 20, 2014

http://learn.jquery.com/plugins/advanced-plugin-concepts/#give-full-control-of-elements

I had a hard time figuring out what this section was trying to highlight.

The confusing part is where it says:

"A bad implementation: "

    // Plugin code:
       ....actual code
    // Retain an internal reference:
       ....actual code

That looks like the whole block of code (including two parts with heading comments) is supposed to be the example of bad implementation (and the code doesn't make much sense alltogether), and then one expects the rest of the text to explain what's wrong in it and how to improve it.

Instead, the first part of the code under the comment "//Plugin code" is the bad implementation, and the second part starting with the comment "//Retain an internal reference:" is already the improved code that replaces the previous one. That's not clear at all.

This could be improved for example like this:

"""
A bad implementation:

    // Plugin code:
       ....actual code

A better implementation:

    // Retain an internal reference:
       ....actual code
@mnitchie
Copy link

I was confused by the same thing, and this helped me figure out the intended meaning. Thanks for posting this issue.

@arthurvr
Copy link
Member

PR: #526

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants