question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Naming convention: Visitors / event-handlers?

See original GitHub issue

This is not a bug report, just a discussion about documentation, or rather, naming. I was wondering what the name of the type of function associated with Identifier in the following example is.

return {
  "Identifier": function(node) {}
};

I know that Babel uses the term Visitor, as related to the visitor pattern, but couldn’t find a definitive, or explicit answer in the documentation.

I’ve been reminded that the term visit is used at some point in the docs, and events in some other place.

I personally like the term visitor, which is consistent with Babel (the use of visitors seems to have kind of the same purpose too). The term event handler speaks less to me.

I’ve asked the question in the Gitter chat, and been asked to create an issue, so that an explicit name could maybe get chosen, and reflected in the documentation.

(cc @pedrottimark @platinumazure)

Note: for context, I wanted to create a project that simplifies writing rules for some cases I encounter, and was therefore looking for an appropriate name.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
platinumazurecommented, Apr 14, 2016

Right now, we only inferred “Visitor” because there is one word visit buried in the middle of the third paragraph of that section. I don’t think it would hurt to make it a bit more clear, but I have no concrete proposal at this time. Since documentation PRs don’t require an issue, I think we can let this stay closed since @jfmengels has received an answer to the question raised.

0reactions
jfmengelscommented, Apr 14, 2016

Right. I meant more like clarifying the documentation. I’ll close this, someone can reopen it if needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Simple Naming Tips for Event Handlers | by Vlad Sabev
Simple Naming Tips for Event Handlers. Helping our team (and ourselves) write more meaningful and robust code. The Challenge. Here's something we've ...
Read more >
Event handlers, naming conventions
When creating form events and event handlers, we recommend these naming conventions: Use descriptive names; that is, names that indicate or can serve...
Read more >
Is there a naming style for VS's event handler naming ...
But I can't seem to find any way to tell RS to support Visual Studio's default naming convention for event handlers.
Read more >
Naming convention of functions that are a "response" to events.
No more searching function names, so no need for a long EventHandler suffix. Useful conventions are based on the exact process you use...
Read more >
Naming convention for delegates, events and event handlers?
I'm trying to pin down a good naming convention for the 3 things required to implement an event. You need: 1) a delegate...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found