Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
private ICalculator calculator = new Calculator();
public void button_click_one(object sender, eventargs e)
{
textbox.text = calculator.add(1, 2);
}
public void button_click_two(object sender, eventargs e)
{
textbox.text = calculator.add(2, 3);
}
public void button_click_one(object sender, eventargs e)
{
textbox.text = 1+2;
}
public void button_click_two(object sender, eventargs e)
{
button_click_one(null, null);
}
reasons why this is not good.
1. no separation of concerns. the presentation layer is doing the logic
2. principle of least surprise does not apply. what happens when I call button_click_one(null, null)?
3. encapsulation is broken. we need to understand button_click_one to understand what button_click_one(null, null) does.
your welcome, I have a lot to learn myselfThanks Jason... I have a lot to learn from you I think.