Code Refactoring

In the real world, you’re not a one-man team like you once were during college (because apparently, it’s cheating in your professor’s eyes). You will work with other people when developing software. If that’s the case, it’s inevitable that those other people you’re working with will also be looking at your code. Not only that, they’ll also be working with the code that you will write. One of the things a developer must strive for is better code....

December 12, 2010 · 8 min · 1540 words

Classes and Objects in Java

DISCLAIMER: Do not use any of the code found in this entry for real life exercises. They do not adhere to the standards of OOP. I intentionally wrote wrong code in this entry for the sake of discussion. I will smack you in the face if you used the following code in real life exercises. I’ve been trying to teach some of my classmates about the concepts of OOP, so I thought I’d turn them into a series blog posts for future reference....

December 4, 2010 · 6 min · 1241 words

Regular Expressions in Java

This semester, I have a class in Java, specifically, Java EE. It’s about time I have another programming class. It’s been 2 years already since my last class in Java. So anyway, for our first exercise, the professor asked us to make a basic Java application. The requirement for the application is to use classes and packages. The classes should have private attributes, public methods, getter and setter methods. I figured I should try using regular expressions since one of the class attributes’ setter method seems to be screaming for one....

November 25, 2010 · 4 min · 796 words

Introspection in Python

I just finished reading a chapter about Introspection in the book that I’m reading. Learning the concept of introspection and doing it in Python is the trickiest challenge I’ve come across so far. Introspection, by definition, is determining and manipulating objects at runtime. The idea is that we know that there are objects that will definitely come across our program during run-time. We don’t know what they are exactly, but we want to do something about them in case our program encounters them....

November 3, 2010 · 8 min · 1583 words

Python and its weird boolean logic

I found some pretty interesting keywords in Python: and and or. Coming from a C background, this is somehow new to me since I’m used to using symbolic operators for boolean logic (&& and ||). One of the things I noticed was how Python interprets these keywords: 1 'a' and 'b' It returns ‘b’. Surprised? I know I am. One look and I immediately thought it would return something similar to True since both values aren’t null....

November 2, 2010 · 2 min · 238 words