How to program UI?

I know it is an absurd title but… I really am all over the place when it comes to programming UI. I’m not talking about the GUI API, but I’m talking about how to design the code to be in one place and reusable at the same time.

So for example, I have a HUD with scores and level and HP. How do I update them? Do I write 3 scripts that will listen and update the UI or should I write one that will handle everything.

What about buttons? Should I write different scripts for each button click behavior? Should I write one? I really don’t know how to manage my UI code. How do you do your UI? Can you give code snippets? Best design pattern to use? I know sometimes it is a matter of preference. Maybe what I’m looking for are examples that works and clean.

after watching the new gui for 4.6 I wouldn’t waste my time trying to learn the old GUI stuff… I know that seems odd, but they’re making major changes to how things like that work…