-
Notifications
You must be signed in to change notification settings - Fork 4
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 I have it with milk? #18
base: mistress
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this might be a contentious subject... of course you can have it with milk, and indeed any milk would probably be quite delicious. But is cinnamon milk truly the best? Is not the beauty of Cinnamon Toast Crunch in milk, that it flavors the milk, that its sugar-cinnamon goodness is absorbed into the milk? In this regard cinnamon milk is not only superfluous, but actually obscures that oh-so-essential cereal-milk action!
I think if we want to be a serious reference on why kids love the taste of Cinnamon Toast Crunch (and we surely do), then we might take care to acknowledge Cinnamon Toast Crunch in all its delightful dynamics.
We should also try to match the larger JavaScript ecosystem. getMilkCombinations...
is a plural name, so one would expect it to return an array or otherwise iterable (such as a generator). Apart from the cinnamon-philosophical quandary above, either the function should be renamed (the export is OK), or the contents should return an iterable of milk combinations that go with cinnamon toast crunch.
Thank you for your contributions, of course!
Great point... Ill think about it |
Your language in the first paragraph is truly amazing! I don't know if this is what you're looking for (see the commit) but I hope that's good! |
index.js
Outdated
"Soy Milk", | ||
"Cinnamon Milk" | ||
]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is almost there!! I'm a stickler for literals, so can we try a syntax that's more like...
module.exports.whichMilkCanIHaveItWith =
function* getMilkCombinations() {
yield "with 2% milk"
yield "with whole milk"
yield "with almond milk"
yield "with coconut milk"
yield "with soy milk"
yield "with cinnamon milk"
yield "with your favorite milk"
yield "or even dry"
}
Maybe we should add an example in the examples folder too, something like this:
const getReasonWhyKidsLoveTheTasteOfCinnamonToastCrunch = require(
'why-do-kids-love-the-taste-of-cinnamon-toast-crunch')
const getMilksICanHaveCinnamonToastCrunchWith =
getReasonWhyKidsLoveTheTasteOfCinnamonToastCrunch.canIHaveItWithMilk
for (const milkICouldHaveItWith of getMilksICanHaveCinnamonToastCrunchWith()) {
console.log(`I could have it ${milkICouldHaveItWith}`)
}
I don't know what to name this example though LOL. Just make sure you use an underscore (_
) between each word, like the other files in the examples folder.
Also, please put a line break above the module.exports
line - you can look at the picture below to see how the code you added doesn't quite fit the same style as the other ones, but that's just a simple fix.
Ok sorry I didn't see this. Ill work on it. |
Hello????*echoes* |
Sorry, we're on vacation for some school-related stuff! Check back between one week and fourteen years. 👍 |
I thought Apple would acquire Github by then. |
|
Closer to one end of those two, for sure. ☑️ |
module.exports.whichMilkCanIHaveItWith =
function* getMilkCombinations() {
yield "with 2% milk"
yield "with whole milk"
yield "with almond milk"
yield "with coconut milk"
yield "with soy milk"
yield "with cinnamon milk"
yield "with your favorite milk"
return "or even dry"
}
|
No, it's different from an iteration perspective. function* foo() {
yield 'foo'
yield 'bar'
return 'baz'
}
for (const kaz of foo()) {
console.log(kaz)
}
// 'foo'
// 'bar'
// but NOT 'baz' |
Oh, I just thought so because of this: https://javascript.info/generators#generator-functions
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@towerofnix I made some changes, and I hope we are ready to merge - We have to! because there's a small mistake!
index.js
Outdated
yield "with cinnamon milk" | ||
yield "with your favorite milk" | ||
return "or even dry." | ||
// console.log("Dry! WHAT! How dare you!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@towerofnix Let me know if I should remove this line...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please:
- Drop this commented-out line
- As discussed in Can I have it with milk? #18 (comment), change
return
toyield
- Get rid of the period at the end, just leave it as
"or even dry"
- The output value of this function (milk combinations) belongs in the same part of a human sentence every time. We don't need to imply the sequence is over by using
.
—the consumer of the generator will already understand when the sequence is done. (Technically it's not done after thisyield
. It's still going to do a final "yield" with{value: undefined, done: true}
, as expected!)
- The output value of this function (milk combinations) belongs in the same part of a human sentence every time. We don't need to imply the sequence is over by using
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check out our comments, please. The main point is that you should not be bringing unrelated changes into a pull request that is about having it with milk. Use separate branches in your GitHub fork repository (each starting from the current state of the original repository's mistress
branch) and file unrelated changes in separate pull requests.
Basically, there is no reason (for instance) to make a gravely essential fix to a public interface's apparent name wait around on perfecting the expression of different combinations with or without milk! That is a fix that can be merged very quickly and likewise published to NPM. But we can't do that if the fix is bundled in with a whole bunch of other unrelated changes that we are taking time to get right. That's why it's important to make separate pull requests from different branches.
There are also a couple of changes requested to do with the milk part of this milky milk milk can I have it with milk pull request. Thanks! 👍
oh.. uh oh.... UH OH! Sorry, I'll change it back and create separate PRs. |
Done!, the only 2 changes I am making is the fix for the name and the milky milk milk milky change |
@towerofnix Done! Can we merge this milk? |
@towerofnix MERGE THE MILK!!!!Sorry, I meant merge the PR. |
Hi, just a friendly piece of advice @blazgocompany: it isn't polite to spam on a GitHub issue or PR until it gets accepted. @towerofnix is pretty on top of things and most likely busy with life or another project that is significantly more important than this. They will merge this when they get around to it, so let's not fill up their email inbox, all right? |
Thanks @micahlt! @blazgocompany The reason we haven't merged this yet is that we are meaning to add the example that we mentioned up here #18 (comment) and frankly we don't have the time to back-and-forth on getting it quite right LOL. We'll add it ourselves when we can, but we haven't gotten around to it yet. We still need you to revert the change on this line https://github.com/towerofnix/why-do-kids-love-the-taste-of-cinnamon-toast-crunch/pull/18/files#r1711611318 — leave it as The rest of the stuff you reverted is good, thanks. Also make the changes we requested in https://github.com/towerofnix/why-do-kids-love-the-taste-of-cinnamon-toast-crunch/pull/18/files#r1711747374 — I don't believe any of these ones have been addressed yet. |
@towerofnix, Sorry if my message went a little too far. Ok, I'll work on those. Thank you. I was just wondering if you were just busy or there was something I actually needed to work on. |
It's cool! Yeah those were far but I don't actually mind, and it's clear you were wondering if anything needed to be changed. ("If I need to change something please let me know. Ok? Bye!") FWIW we didn't mark your comments as spam (I don't remember doing that anyway???) apart from locking #19 - hiding your comments would have been GitHub or whatever. No hurt feelings 👍 just best to ask directly if you want to know if there are any changes still needed!! Speaking of... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...The code changes in this PR look spot-on now! Marking as approved and self-assigning so we come back to it and add the example when we have the moment. Thanks for handling and bringing in all the requested changes!!
Yeah, I usually don't like spamming, but sometimes the silence feels a little... awkward. And aren't the examples supposed to go in another PR? (Sorry if I don't know what goes where) And by the way.. I hid those myself hehe.. 😁 |
Yep, it's me again. I hope I'm not pestering you.