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.

Callback naming consistency

See original GitHub issue

Following up on @vitaly-krugl’s comment, we’re going to use the on_ prefix with an action verb for all callback parameter names.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
vitaly-kruglcommented, Mar 7, 2018

@lukebakken, regarding documentation comment in https://github.com/pika/pika/issues/988#issuecomment-370978795, I was hoping to get the apps away from accessing the connection’s internal ioloop, which is often an adapter on top of the native I/O loop. I would not want them to depend on any connection.ioloop API (that’s should really be just for the benefit of adapter implementations), calling it’s start method, etc. (it shouldn’t be even providing a start() method). Instead, apps should be interacting with the native I/O loop directly - calling the native loop’s start(), run_forever(), etc.

I started going on this path in my WIP PR https://github.com/pika/pika/pull/982.

1reaction
vitaly-kruglcommented, Mar 7, 2018

Making the callback names more descriptive would help with making the API more self-documenting. But things are not bad now, so I’m not certain it’s worth the extra effort. I’m okay to keep as they are.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handy Naming Conventions for Event Handler Functions ...
Tying it all together. Following these simple naming conventions provide your code predictability and consistency. By implementing these naming conventions, ...
Read more >
Nested Callback arguments and naming conventions
I have a piece of code that has nested call backs. Each callback has a response. One is name res and one is...
Read more >
Inconsistent naming convention for callback props #14406
Name things consistently when developing components. Naming should be consistent, so that it's clear to third-party developers which one is ...
Read more >
Simple Naming Tips for Event Handlers | by Vlad Sabev
1. Event names should answer the question when, because they're on the left side and describe the conditions under which events trigger. 2....
Read more >
Naming (in code) - The ultimate guide and reference
This article is the complete guide and reference for naming in code. ... Programming principles tell us that consistency is very important.
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