Skip to content
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

can function declaration be named as a pattern? #143

Open
chapgaga opened this issue Dec 18, 2014 · 3 comments
Open

can function declaration be named as a pattern? #143

chapgaga opened this issue Dec 18, 2014 · 3 comments

Comments

@chapgaga
Copy link

seems it is only kind of trivil skill,
https://github.com/shichuan/javascript-patterns/blob/master/general-patterns/function-declarations.html

@noamkfir
Copy link

There are a number of ways to declare functions in JavaScript, but some are better than others. And the worst way looks a lot like a standard function declaration in many other languages.

I've taught JavaScript to quite a few programmers, and this has led me to believe that this is not a "trivial skill" (though I agree that it is a basic one). To my mind, outlining the options and explaining their advantages and disadvantages provides, to paraphrase, "reusable solutions to common problems".

@chapgaga
Copy link
Author

@noamkfir seems this pattern is named by you, i cannot find it in a couple of books which is talking about JS Pattern :(

@noamkfir
Copy link

@chapgaga I did not create the pattern and I did not name it. But I do agree with it, for the reasons I mentioned above.

Design patterns are descriptions of reusable solutions to common problems. The description on this page fits that definition, as far as I can see.

There are many patterns that are described in only one book or by just one source. That is not an argument against them. For example, Martin Fowler describes many patterns in his books and on his site, quite a few of which are probably not mentioned elsewhere, and most of which had not been mentioned anywhere before Fowler came along and cataloged them. That does not make them any less valuable.

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

No branches or pull requests

2 participants