Object Oriented Principles

  • Encapsulate what varies.
  • Favor composition over inheritance.
  • Program to interfaces, not implementations.
  • Strive for loosely couple designs between objects that interact.
  • Classes should be open for extension but closed for modification.
  • Depend on abstractions. Do not depend on concrete classes.
  • Only talk to your friends.
  • Don’t call us, we’ll call you.
  • A class should only have one reason to change.

Continuing from the basics of OO, we now move on to its principles. The list above is taken from the wonderful book Head First Design Patterns and it enumerates some of the most important principles in OO. I’ll explain briefly what each principle means below the cut.

Continue reading “Object Oriented Principles”

Something Not So Obvious About Exercise

A recent Time Magazine article explains why most people who go on exercise regimens don’t lose weight at all.

You’ve heard it for years: to lose weight, hit the gym. But while physical activity is crucial for good health, it doesn’t always melt pounds — in fact, it can add them. Here’s why.

It’s nothing new to someone who has taken fitness seriously. But given that a lot of people are not aware of the simple facts brought forward by the article, I think it’s still worth sharing.

Bottom line: if you want to lose weight, don’t feed yourself with more calories than you can handle, exercise or no exercise. When I was on the way to lose 20 pounds, not only did I perform regular cardio and strength training exercise, I also skipped the high-calorie snacks served at our company’s pantry and ate salt crackers (Skyflakes) instead.

Why Exercise Won’t Make You Thin [via Time]

Great Laws of Software Development

laws
laws

Agile: In A Flash is a great source of software engineering tips regardless if you’re planning to go agile or not.

Out of the many flash cards in that site, I find the two cards above to be the most important to a novice software developer. It should make them feel less surprised when Brook’s Law or Hofstadter’s Law hits them from out of nowhere.

Stuck on Stupid

Yes, this is basically a repost of Lex’s latest post. But since over half of my readers aren’t Sugoi or AME peeps, I thought it would be a good idea to share it too.

Francis Kong has a very insightful (and very blunt) article entitled Stuck on Stupid on the Philippine Star.

Why do certain people go deeper into debt? Because they are stuck on stupid. They are not only acting their age, they are not acting their wage…! Buying things they don’t need with money they don’t have from people they don’t know to impress people they don’t like.

Why do certain people cannot get a steady job? Because they are stuck on stupid. Anywhere they go they feel like the world is against them. Poor people skills and the inability to respect authority. They are all wrapped up in themselves and they make a small package.

Why do certain people destroy their relationship with their families? Because they are stuck on stupid. Playing with fire all the time and not expecting to get burnt?

Why do certain people continue to work in a job they don’t like, live in a house they don’t want and live a life they hate living? Because they are stuck on stupid. They have not taken the initiative to stop doing what they are doing and to start working on themselves more than they do on their jobs.

Geek M&Ms Test

guess what I'm thinking

I believe I haven’t eaten M&Ms for years now because one of the first things that went into my head while popping those colorful chocolate candies into my mouth was something geeky.

See if you can figure out what I was thinking then using the picture above. It’s not that hard, but if you need a hint, look at the category under which this post is filed.