I have moved my blog to Wordpress at theunixgeek.wordpress.com. I will still be checking back periodically on this one as well, though. 19 April 2009


Merging Mkdir and Cd | 280 Slides Interview | I Switched to KDE 4

clickable portals

Sunday, January 13, 2008

OOP in C, Part 1

Yes, believe it or not, you can write object-oriented programs in C! Of course, it's not the neatest of all programming languages when it comes to OOP but let's take a look at the possibilites. This part examines basic data encapsulation, a big point when it comes to writing object-oriented programs.

Background: Encapsulating data basically means that data in one part of the program isn't visible to other parts of a program. Why is this important? Debugging large programs. For example, say you're writing a web browser, and your back button doesn't work. You can focus only on that part of the program without having to think about data being processed in other parts of the program when it comes to finding out what's wrong.


union Data {
int digit;
union Data myData;
int digit = 2;
myData.digit = 3;

Explanation: The above snippet shows how data can be hidden from other parts of a program using unions. Although there is a digit variable in Data, it's OK to declare another variable of the same name outside of Data because that data is hidden to the instance  myData. Speaking of which, yes, you can have multiple instances of a union.

Is KDE 4 a Huge Step Backwards?

Is KDE 4 a big step backwards for KDE? Sure seems like it. I mean, I love the new Kickoff K menu, the Plasma widgets and graphics (which I'm surprised can run on an 8-year-old computer), but check out the windows. It's really hard on the default theme to tell which windows is the active window and which isn't where it not for shadows and overlapping.  Also, look at the taskbar. In previous versions of KDE, it was easy to tell if something was an open application or a button, but now huge icons make it harder to distinguish. These are both really bad interface design flaws. Overall, the K Desktop Environment 4 has nice features, but until the default theme is changed (since I usually stick to the defaults) and there are two rows for open applications again, I'm not sure I want to upgrade. It can make lots of people happy, but I don't seem that attracted to it. 

Saturday, January 12, 2008

MacBook Air coming soon?

9 to 5 Mac has begun to piece together information on the rumored upcoming ultra-thin MacBook that may or may not be a tablet, which they dub the "MacBook Air." Here's some of their reasoning:

  1. Pre-Macworld banners saying "There's something in the air."
  2. MacRumors leaks
Check it out for yourself... seems pretty believable.