Skip to content

Conversation

@Trott
Copy link
Member

@TrottTrott commented May 4, 2017

This change removes common.noop from the Node.js internal testing
common module.

Over the last few weeks, I've grown to dislike the common.noop
abstraction.

First, new (and experienced) contributors are unaware of it and so it
results in a large number of low-value nits on PRs. It also increases
the number of things newcomers and infrequent contributors have to be
aware of to be effective on the project.

Second, it is confusing. Is it a singleton/property or a getter? Which
should be expected? This can lead to subtle and hard-to-find bugs. (To
my knowledge, none have landed on master. But I also think it's only a
matter of time.)

Third, the abstraction is low-value in my opinion. What does it really
get us? A case could me made that it is without value at all.

Lastly, and this is minor, but the abstraction is wordier than not using
the abstraction. common.noop doesn't save anything over () =>{}.

So, I propose removing it.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

test

@TrottTrott added the test Issues and PRs related to the tests. label May 4, 2017
@nodejs-github-botnodejs-github-bot added addons Issues and PRs related to native addons. node-api Issues and PRs related to the Node-API. test Issues and PRs related to the tests. labels May 4, 2017
@refack
Copy link
Contributor

I don't remember who said that Function.prototype.call is a built in noop for when you need to refer to it by name (removeListener, etc)

@TimothyGu
Copy link
Member

Copy link
Member

@TimothyGuTimothyGu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if CI is green.

@vsemozhetbytvsemozhetbyt mentioned this pull request May 4, 2017
24 tasks
@jasnell
Copy link
Member

I'm going to abstain on this. I find it useful (which is why I added it :-) ...). I would likely just do it as a revert of the original commit that added it then do a separate commit that adds back in the changes to common.mustCall() defaulting to a no-op.

@lpinca
Copy link
Member

Most of the problems caused by common.noop can be avoided by paying a little attention when using it so I'm with @jasnell in the sense that I find it useful but I'm also fine with not using it at all :)

@benjamingr
Copy link
Member

Note that I reviewed the changes and the changes LGTM, but I'm +0 on actually removing common.noop.

@aqrlnaqrln mentioned this pull request May 4, 2017
4 tasks
@Trott
Copy link
MemberAuthor

Trott commented May 5, 2017

Rebased to resolve a few conflicts. New CI: https://ci.nodejs.org/job/node-test-pull-request/7907/

@Trott
Copy link
MemberAuthor

Trott commented May 6, 2017

Obviously, I"m all for this, but there are more neutral comments than supportive comments. If anyone who hasn't weighed in yet has objections, please comment! Thanks! /cc @nodejs/testing

@thefourtheye
Copy link
Contributor

-0. I kinda liked the idea of common.noop. If we are repeating something in many files, it is better to put it in a common module. Moreover, if we want to use normal functions instead of arrow functions for noop, for whatever reason, again there will be code churn.

@Trott
Copy link
MemberAuthor

@Trott
Copy link
MemberAuthor

@Trott
Copy link
MemberAuthor

@TrottTrottforce-pushed the nononoop branch 3 times, most recently from 37d072e to 7bf77f7CompareMay 17, 2017 04:49
This change removes `common.noop` from the Node.js internal testing common module. Over the last few weeks, I've grown to dislike the `common.noop` abstraction. First, new (and experienced) contributors are unaware of it and so it results in a large number of low-value nits on PRs. It also increases the number of things newcomers and infrequent contributors have to be aware of to be effective on the project. Second, it is confusing. Is it a singleton/property or a getter? Which should be expected? This can lead to subtle and hard-to-find bugs. (To my knowledge, none have landed on master. But I also think it's only a matter of time.) Third, the abstraction is low-value in my opinion. What does it really get us? A case could me made that it is without value at all. Lastly, and this is minor, but the abstraction is wordier than not using the abstraction. `common.noop` doesn't save anything over `() =>{}`. So, I propose removing it.
@Trott
Copy link
MemberAuthor

Trott commented Jul 3, 2017

It's time...

CI: https://ci.nodejs.org/job/node-test-pull-request/8939/

@Trott
Copy link
MemberAuthor

Trott commented Jul 3, 2017

Landed in 380929e

@TrottTrott closed this Jul 3, 2017
Trott added a commit to Trott/io.js that referenced this pull request Jul 3, 2017
This change removes `common.noop` from the Node.js internal testing common module. Over the last few weeks, I've grown to dislike the `common.noop` abstraction. First, new (and experienced) contributors are unaware of it and so it results in a large number of low-value nits on PRs. It also increases the number of things newcomers and infrequent contributors have to be aware of to be effective on the project. Second, it is confusing. Is it a singleton/property or a getter? Which should be expected? This can lead to subtle and hard-to-find bugs. (To my knowledge, none have landed on master. But I also think it's only a matter of time.) Third, the abstraction is low-value in my opinion. What does it really get us? A case could me made that it is without value at all. Lastly, and this is minor, but the abstraction is wordier than not using the abstraction. `common.noop` doesn't save anything over `() =>{}`. So, I propose removing it. PR-URL: nodejs#12822 Reviewed-By: Teddy Katz <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
@addaleax
Copy link
Member

@Trott This doesn’t land cleanly on 8.x; can you backport it? (link to the backport guide)

Trott added a commit to Trott/io.js that referenced this pull request Jul 11, 2017
This change removes `common.noop` from the Node.js internal testing common module. Over the last few weeks, I've grown to dislike the `common.noop` abstraction. First, new (and experienced) contributors are unaware of it and so it results in a large number of low-value nits on PRs. It also increases the number of things newcomers and infrequent contributors have to be aware of to be effective on the project. Second, it is confusing. Is it a singleton/property or a getter? Which should be expected? This can lead to subtle and hard-to-find bugs. (To my knowledge, none have landed on master. But I also think it's only a matter of time.) Third, the abstraction is low-value in my opinion. What does it really get us? A case could me made that it is without value at all. Lastly, and this is minor, but the abstraction is wordier than not using the abstraction. `common.noop` doesn't save anything over `() =>{}`. So, I propose removing it. PR-URL: nodejs#12822 Reviewed-By: Teddy Katz <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
@TrottTrott mentioned this pull request Jul 11, 2017
2 tasks
@Trott
Copy link
MemberAuthor

Backport in #14174

addaleax pushed a commit that referenced this pull request Jul 12, 2017
This change removes `common.noop` from the Node.js internal testing common module. Over the last few weeks, I've grown to dislike the `common.noop` abstraction. First, new (and experienced) contributors are unaware of it and so it results in a large number of low-value nits on PRs. It also increases the number of things newcomers and infrequent contributors have to be aware of to be effective on the project. Second, it is confusing. Is it a singleton/property or a getter? Which should be expected? This can lead to subtle and hard-to-find bugs. (To my knowledge, none have landed on master. But I also think it's only a matter of time.) Third, the abstraction is low-value in my opinion. What does it really get us? A case could me made that it is without value at all. Lastly, and this is minor, but the abstraction is wordier than not using the abstraction. `common.noop` doesn't save anything over `() =>{}`. So, I propose removing it. PR-URL: #12822 Backport-PR-URL: #14174 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
@addaleaxaddaleax mentioned this pull request Jul 18, 2017
addaleax pushed a commit that referenced this pull request Jul 18, 2017
This change removes `common.noop` from the Node.js internal testing common module. Over the last few weeks, I've grown to dislike the `common.noop` abstraction. First, new (and experienced) contributors are unaware of it and so it results in a large number of low-value nits on PRs. It also increases the number of things newcomers and infrequent contributors have to be aware of to be effective on the project. Second, it is confusing. Is it a singleton/property or a getter? Which should be expected? This can lead to subtle and hard-to-find bugs. (To my knowledge, none have landed on master. But I also think it's only a matter of time.) Third, the abstraction is low-value in my opinion. What does it really get us? A case could me made that it is without value at all. Lastly, and this is minor, but the abstraction is wordier than not using the abstraction. `common.noop` doesn't save anything over `() =>{}`. So, I propose removing it. PR-URL: #12822 Backport-PR-URL: #14174 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
Fishrock123 pushed a commit that referenced this pull request Jul 19, 2017
This change removes `common.noop` from the Node.js internal testing common module. Over the last few weeks, I've grown to dislike the `common.noop` abstraction. First, new (and experienced) contributors are unaware of it and so it results in a large number of low-value nits on PRs. It also increases the number of things newcomers and infrequent contributors have to be aware of to be effective on the project. Second, it is confusing. Is it a singleton/property or a getter? Which should be expected? This can lead to subtle and hard-to-find bugs. (To my knowledge, none have landed on master. But I also think it's only a matter of time.) Third, the abstraction is low-value in my opinion. What does it really get us? A case could me made that it is without value at all. Lastly, and this is minor, but the abstraction is wordier than not using the abstraction. `common.noop` doesn't save anything over `() =>{}`. So, I propose removing it. PR-URL: #12822 Backport-PR-URL: #14174 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
MylesBorins pushed a commit that referenced this pull request Aug 16, 2017
This change removes `common.noop` from the Node.js internal testing common module. Over the last few weeks, I've grown to dislike the `common.noop` abstraction. First, new (and experienced) contributors are unaware of it and so it results in a large number of low-value nits on PRs. It also increases the number of things newcomers and infrequent contributors have to be aware of to be effective on the project. Second, it is confusing. Is it a singleton/property or a getter? Which should be expected? This can lead to subtle and hard-to-find bugs. (To my knowledge, none have landed on master. But I also think it's only a matter of time.) Third, the abstraction is low-value in my opinion. What does it really get us? A case could me made that it is without value at all. Lastly, and this is minor, but the abstraction is wordier than not using the abstraction. `common.noop` doesn't save anything over `() =>{}`. So, I propose removing it. PR-URL: #12822 Backport-PR-URL: #14174 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
@MylesBorins
Copy link
Contributor

Managed to get this to land on v6.x

this common.noop thing has been a trip, just backported it yesterday 😅

@MylesBorinsMylesBorins mentioned this pull request Aug 16, 2017
MylesBorins pushed a commit that referenced this pull request Sep 5, 2017
This change removes `common.noop` from the Node.js internal testing common module. Over the last few weeks, I've grown to dislike the `common.noop` abstraction. First, new (and experienced) contributors are unaware of it and so it results in a large number of low-value nits on PRs. It also increases the number of things newcomers and infrequent contributors have to be aware of to be effective on the project. Second, it is confusing. Is it a singleton/property or a getter? Which should be expected? This can lead to subtle and hard-to-find bugs. (To my knowledge, none have landed on master. But I also think it's only a matter of time.) Third, the abstraction is low-value in my opinion. What does it really get us? A case could me made that it is without value at all. Lastly, and this is minor, but the abstraction is wordier than not using the abstraction. `common.noop` doesn't save anything over `() =>{}`. So, I propose removing it. PR-URL: #12822 Backport-PR-URL: #14174 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
@TrottTrott deleted the nononoop branch January 13, 2022 22:45
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addonsIssues and PRs related to native addons.node-apiIssues and PRs related to the Node-API.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

12 participants

@Trott@refack@TimothyGu@jasnell@lpinca@benjamingr@thefourtheye@gibfahn@addaleax@MylesBorins@not-an-aardvark@nodejs-github-bot