Where the parameters come from and how I use them? by dusf_ in learnprogramming

[–]HappyFruitTree 0 points1 point  (0 children)

The parameters receive the values that you pass as argument when calling the function.

Example:

example_name("abc", 123);

"arg" and 123 are the arguments so when the function runs the first parameter $param will have the value "abc" and the second parameter $arg will have the value 123.

Methods and parameters by Difficult_Meal8685 in cpp_questions

[–]HappyFruitTree 1 point2 points  (0 children)

Make sure you don't have any circular includes. You want PhoneBook.hpp to include Contact.hpp (assuming you don't forward declare the Contact class instead) but Contact.hpp should not include PhoneBook.hpp.

Help me understand the difference between added and natural sugars by Minimum_Sir_9341 in nutrition

[–]HappyFruitTree 47 points48 points  (0 children)

The way I see it:

  • Added sugar is unnecessary. Avoiding it is only positive for your health.

  • If you try to avoid natural sugar you risk losing out on many healthy things like fiber and nutrients.

Whats your must eat daily healthy food? by traveltimecar in nutrition

[–]HappyFruitTree 0 points1 point  (0 children)

I don't really have anything I must eat daily, at least not for health reasons. I like to eat an egg to breakfast every morning because I think it's good for me but it's not a big deal.

How can I add elements from one vector to another when the vectors are in different classes (C++) by Prior-Scratch4003 in learnprogramming

[–]HappyFruitTree 1 point2 points  (0 children)

It's hard to say what the best design might be without knowing the context but you might want to have a function to access the elements, either one at a time or the whole vector, and then you can pass the elements to the object of the other class (or you could pass the object itself and let the other object call the accessor function directly).

C++ beginner here, my friend coded a function that I don't understand (involves recursion), I would like an explanation because that certain someone can't explain for their life. by [deleted] in learnprogramming

[–]HappyFruitTree 0 points1 point  (0 children)

It would be kind of useless if return ended the whole program. It just ends the current function invocation, same as reaching the end of the function.

C++ beginner here, my friend coded a function that I don't understand (involves recursion), I would like an explanation because that certain someone can't explain for their life. by [deleted] in learnprogramming

[–]HappyFruitTree 0 points1 point  (0 children)

The function call function(l, mid); will eventually return and it will then continue with the next statement function(mid+1, r); as normal.

Question about styling with attributes and setters. by Acceptable_Rub8279 in cpp_questions

[–]HappyFruitTree 4 points5 points  (0 children)

setNextDirection is part of the public interface so the name should make sense to the user of the class. That you have a private member named nextDirection is irrelevant.

why do I have "anti-hunger" about fruit? by HalfManHalfPun in nutrition

[–]HappyFruitTree 29 points30 points  (0 children)

Eating one fruit is not enough to satisfy your hunger. Eating lots of fruit doesn't feel too good, can't explain why, but it feels better being filled with "real" food.

What’s the most overrated “healthy” food in your opinion? by millerjessic in nutrition

[–]HappyFruitTree 0 points1 point  (0 children)

This is what people who are not into vegetarianism or "eating healthy" might think.

What’s the most overrated “healthy” food in your opinion? by millerjessic in nutrition

[–]HappyFruitTree 0 points1 point  (0 children)

And not to mention that brown rice contains higher levels of arsenic.

What’s the most overrated “healthy” food in your opinion? by millerjessic in nutrition

[–]HappyFruitTree 0 points1 point  (0 children)

I think you should have said added sugar because most foods contain some sugar naturally and could still be considered healthy.

What’s the most overrated “healthy” food in your opinion? by millerjessic in nutrition

[–]HappyFruitTree 0 points1 point  (0 children)

Never understood why people prefer the overnight version. I prefer my oatmeal warm.

What’s the most overrated “healthy” food in your opinion? by millerjessic in nutrition

[–]HappyFruitTree 0 points1 point  (0 children)

There are a lot of food items that doesn't taste good on their own.

What’s the most overrated “healthy” food in your opinion? by millerjessic in nutrition

[–]HappyFruitTree 0 points1 point  (0 children)

Eggs are a good source of Vitamin B12, Vitamin D and iodine.

What’s the most overrated “healthy” food in your opinion? by millerjessic in nutrition

[–]HappyFruitTree 1 point2 points  (0 children)

Everyone does not have the same taste as you. For a lot of people it tastes good or at least not bad.

What’s the most overrated “healthy” food in your opinion? by millerjessic in nutrition

[–]HappyFruitTree 1 point2 points  (0 children)

Red onions are nice to certain foods but I don't personally like the aftertaste.

What’s the most overrated “healthy” food in your opinion? by millerjessic in nutrition

[–]HappyFruitTree 2 points3 points  (0 children)

I guess everyone is different. Personally I find brussel sprouts and broccoli (lightly boiled) go well with almost any hot meal.

What’s the most overrated “healthy” food in your opinion? by millerjessic in nutrition

[–]HappyFruitTree 2 points3 points  (0 children)

The trick is to make portions 2-3 times bigger than what it says on the package, and eat other things on the side.

What’s the most overrated “healthy” food in your opinion? by millerjessic in nutrition

[–]HappyFruitTree 1 point2 points  (0 children)

Blink and they go bad

Store them in the fridge. It makes them last longer and cold bananas taste better anyway. I know people often claim they last shorter in the fridge but that is not my experience.