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 I have it with milk? #18

Open
wants to merge 12 commits into
base: mistress
Choose a base branch
from

Conversation

blazgocompany
Copy link
Contributor

Yep, it's me again. I hope I'm not pestering you.

Copy link
Owner

@towerofnix towerofnix left a 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!

@blazgocompany
Copy link
Contributor Author

Great point... Ill think about it

@blazgocompany
Copy link
Contributor Author

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"
];
}
Copy link
Owner

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.

Screenshot of bottom four functions in this file

@blazgocompany
Copy link
Contributor Author

Ok sorry I didn't see this. Ill work on it.

index.js Show resolved Hide resolved
@blazgocompany
Copy link
Contributor Author

Hello????

*echoes*
@towerofnix

@towerofnix
Copy link
Owner

Sorry, we're on vacation for some school-related stuff! Check back between one week and fourteen years. 👍

@towerofnix towerofnix self-requested a review July 19, 2024 22:11
@blazgocompany
Copy link
Contributor Author

I thought Apple would acquire Github by then.

@blazgocompany
Copy link
Contributor Author

image
Looks like it's been a week... Will I need to wait 14 years or will this be merged @towerofnix?

@towerofnix
Copy link
Owner

Closer to one end of those two, for sure. ☑️

@blazgocompany
Copy link
Contributor Author

blazgocompany commented Jul 30, 2024

@towerofnix · Jun 29

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"
  } 




I also believe that is supposed to be like this with return at the end right?

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"
 }
  

@towerofnix
Copy link
Owner

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'

@blazgocompany
Copy link
Contributor Author

blazgocompany commented Jul 31, 2024

Oh, I just thought so because of this: https://javascript.info/generators#generator-functions

Generator Functions

To create a generator, we need a special syntax construct: function*, so-called “generator function”.
It looks like this:

function* generateSequence() {
 yield 1;
 yield 2;
 return 3;
}

Copy link
Contributor Author

@blazgocompany blazgocompany left a 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 Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated
yield "with cinnamon milk"
yield "with your favorite milk"
return "or even dry."
// console.log("Dry! WHAT! How dare you!")
Copy link
Contributor Author

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...

Copy link
Owner

Choose a reason for hiding this comment

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

Please:

  1. Drop this commented-out line
  2. As discussed in Can I have it with milk? #18 (comment), change return to yield
  3. 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 this yield. It's still going to do a final "yield" with {value: undefined, done: true}, as expected!)

Copy link
Owner

@towerofnix towerofnix left a 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! 👍

@blazgocompany
Copy link
Contributor Author

oh.. uh oh.... UH OH! Sorry, I'll change it back and create separate PRs.

@blazgocompany
Copy link
Contributor Author

Done!, the only 2 changes I am making is the fix for the name and the milky milk milk milky change

@blazgocompany
Copy link
Contributor Author

@towerofnix Done! Can we merge this milk?

@blazgocompany
Copy link
Contributor Author

@towerofnix MERGE THE MILK!!!!

Sorry, I meant merge the PR.
If I need to change something please let me know.
Ok?
Bye!

@micahlt
Copy link

micahlt commented Aug 17, 2024

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?

@towerofnix
Copy link
Owner

towerofnix commented Aug 17, 2024

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 nobodyToldMeYouThatYouCould like it was before this pull request, and if you want to see it fixed, file a separate pull request. I know it seems trivial, but it really is unrelated to milk, and should not be part of the milk PR.

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.

@blazgocompany
Copy link
Contributor Author

blazgocompany commented Aug 18, 2024

@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.

@towerofnix
Copy link
Owner

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...

Copy link
Owner

@towerofnix towerofnix left a 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!!

@towerofnix towerofnix self-assigned this Aug 20, 2024
@blazgocompany
Copy link
Contributor Author

blazgocompany commented Aug 20, 2024

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.. 😁

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

Successfully merging this pull request may close these issues.

3 participants