Blogs

Make Your CSS Readable

As one who works with front-end code on a daily basis, it can quickly become an annoyance when perusing through code someone has written, if there's no attention to detail. Specifically when dealing with the format of that code. While this applies to more than just CSS, I've decided to simply focus on it alone in this article. Why? Well, because I was just reading a tutorial from an unnamed website which I subscribe to, and I stopped reading it because the CSS was all over the place.

Looking to get out of your AT&T contract without an ETF? (UPDATE)

I may have stumbled upon the perfect 'get out of jail free card' with AT&T, and found a way to get out of your contract without paying the Early Termination Fee (ETF).

On June 24th, I stood in line, among the masses, for the much anticipated launch of the iPhone 4 and was able to snag one. Well, 30 days in, I just couldn't bring myself to deal with the iPhone's antenna issue any longer, and decided to take a chance with Sprint and the HTC EVO.

Prototyping Custom Properties and Methods to Objects in JavaScript

After a couple days into my reading on JavaScript's Prototype object, I'm becoming a bit more familiar with it. Still have some questions I need answered, but I'm guessing they'll be answered through experimentation and reading.

In the meantime, I figured I'd share how you assign custom methods and properties to an object, using prototype. This will allow all objects of that type to share them. First we'll start with the following object constructor. The object constructor is nothing more than a function, the only difference is how you call it, using the new keyword, which you'll see in a moment. The constructor will help define a particular object type, so you don't have to redefine a new instance of the same type, over and over.

Setting JavaScript Variables Using 'OR'

I'm working my way through JavaScript: The Good Parts, and as I come across things I'm not familiar with myself, I'm sharing it. My hope is that some of my findings perk the interest of anyone who reads it and gets them to dive a bit deeper into JavaScript as well.

While reading about objects, Crockford describes the process of retrieving object values and assigning them to variable. While he didn't specifically outline that this is a performance benefit, I'm pretty sure it is, since you wouldn't have to "lookup" the value each time and could simply refer to the variable which holds that objects value.

First Encounter w/ JavaScript's Prototype Property

Not a whole lot to really say on the topic yet, since I'm still getting into the Object-Oriented side of JavaScript, but I'm loving my newfound knowledge. In the code snippet below, I simply create a function to define the properties of the Person object and extend it using prototype, adding the setAge method.

If you have any comments on a more efficient way to set objects or extend them, I'm all ears. As I mentioned, I just started venturing into O-O JavaScript the last couple of days. Would love to hear any feedback you might have.