Justin Carmony
Web Designer & Software Engineer
  • Home
  • Pages
    • Utah PHP Users Group
    • PHP Bob
  • About
  • Portfolio
  • Talks
    • Demystifying CSS and WordPress
    • Blazing Data with Redis
  • Contact

Consumer Linux – When & How

Posted in: Technology|Tags: Linux, Ubuntu |January 16, 20091 Comment

I’ve been reading several responses about the news story of a girl who “dropped out of school” because of Ubuntu. I’ve read several responses, including Aaron Toponce’s response, and it got me thinking about a topic that has been on my mind for awhile.

You can read the story yourself and the follow-up backlash from the Ubuntu Community. I was extremely sad, but not at all surprised, of the backlash that this woman got. I’m sure the negative response is from a relatively small percent of the community that is just extremely loud. I also think the title of the story is a little misleading and that it can be taken as bias. However, the root of the problem lies in this: a woman thought she was buying a consumer product, when in fact, it wasn’t.

Difference Between Consumers & You

I don’t care who you are, but if you are reading this, you already have technical edge on 95% of all computer users. You are automatically disqualified from being able to say “Ubuntu is easy to use.” “Installing software is easy on Linux.” I’m sorry, but that is just the case. The definition of “easy” for you and I is completely different. To understand the average consumer, what you really need to do is observe the consumer trying to use your product.

A consumer expects to be able to stick a CD in have it work. A consumer expects to be able to download a file and double-click. If they can’t do that, to them it is broken, and in a consumer context, they are right. Easy-of-use when starting at a zero knowledge point is crucial for consumers. They don’t want to spend time learning new things. The learning curve an average consumer is willing to endure is extremely low. I’m sorry, but I don’t know of a single Linux distribution that is ready to be the main computer for the majority of consumers.

Right now I think Linux can make a great secondary computer for a normal consumer. It is easy enough to do Web, Email, and IM. School work can be done with OpenOffice. But for everything else that is out there for Windows and OS X machines, I really do think the learning curve is too much for normal users. (Heck, normal users struggle with Windows, something they have been taught for ever!)

Consumers Don’t Care About Freedom

Free as in freedom is useless to a consumer for the most part. My wife isn’t going to custom compile her applications. My mother doesn’t care if she has the option of modifying her programs. Freedom holds very little value in the sense of being able to change. Consumers, however, love freedom when it comes to installing on any and all machines, and freedom as in price. Free as in beer is something almost every consumer will love. However, it is not out of principle, but usually that their wallets stay full.

Education Is Expensive

It takes time to learn something new, and consumers have a completely different tolerance to education than technical users. Most of the time, technical users enjoy learning new things about technical topics. When something isn’t working, googling the problem isn’t that big of a deal. The average consumer, however, hates it. Their tolerance to “figuring stuff out” is extremely low. If you don’t enjoy technical stuff, learning how to do things is a pain.

Educating a user is expensive in the sense that it takes a lot of time. Both for the person putting together the education, and the time it takes for a consumer to learn. A consumer, like the women in the news article, doesn’t want to learn a new operating system. She just wants to write papers and log onto her website. Ubuntu is not a good solution for her if she doesn’t want to learn something new, because the onus is on her to figure stuff out. Most consumers have never used an online forum, and they have no clue about IRC. For her to get help, not only does she have to find a good place to ask, and ask in a correct way, she has to learn how to log onto IRC and how to use Forums. The education requirement is very high currently for people starting at zero knowledge.

I’ve seen people in the open source community throw out the idea of  “education” like it is this free commodity. However, in all honesty, educating people takes time, and time is a finite resource that is very valuable for most people. Asking someone to learn something completely new, especially when the onus is on the user to take care of themselves, is a lot to ask for.

Power & Polish

In my mind, the way I visualize computing and usability is by using the two terms power & polish. Power is the raw ability to do something. Polish is the ease doing that something. Lets look at an example:

Linux is very powerful. If you know your way around the command prompt, you can accomplish just about anything. I hate administering Windows Servers because I lack the power that I have when administering a Linux Server. However, I wouldn’t say Linux is very polished in comparison to OS X. Apple has placed a huge amount of time, effort, and work into polishing the interface and usability of their operating system. The reason I like the term “polish” is because polishing something doesn’t give you anything new, but just makes something already in existence better. It also requires a great deal of work.

Typically, I highly dislike “polishing” my applications as a developer. I already know how to use it, and use it well, because I made it. However, making it easy for everyone, from the intelligent to the confused, is extremely time consuming. Its amazing just how clueless I think users can be, however that polish is extremely important if I expect users to use and enjoy my application. Lets look at rsync for Linux. It is extremely powerful, and I love using it every day. However, you have to know what your doing. To polish rsync to a point it would be at a consumer level, we would have to make a GUI. That GUI would have to built in tutorials and help functions. We would have wizards and setup helpers to make automated backups. It would have to explain every little detail in their help functions, as well as handle every possible error, user and application. I would have to make it easy to open any where and use it anywhere. The time it would take to that version of rsync would be a lot. What open source developer wants to do that, especially since all the people currently user wouldn’t use that GUI at all? Technical people tend to favor power over polish. Consumers, however, love power, but are lost without polish.

Polish puts the onus on developers instead of end-users to make things ease and “user-proof.” I think Linux has made a lot of headway in the sense of Polish. The technical knowledge required to use Linux has dramatically dropped from ten years ago. I remember going to a store, buying a copy of Mandrake Linux, installing it on an old machine, and thinking “what the heck is this?” I was so confused and lost. Now I think I could get going a lot better if I tried it again at that skill level.

Death & Taxes

I think this is the best example of helping developers understand how consumers feel about using computers. My father-in-law, an owner of an accounting firm, has a saying he loves from Benjamin Franklin: “Certainty? In this world nothing is certain but death and taxes.” Taxes is something that we all will deal with and pain. They are also extremely complicated. The more money you make, and the more stuff you buy (house, cars) and things you spend it on (kids, education, medical, bills) the more complicated they get.

It is 100% possible for an individual to do all of their taxes for their entire life. All of the resources are available “in theory.” You can look up and read all the tax laws. You can contact your sate or federal IRS and ask very specific questions and go through hell trying to get answers. If the IRS performs an audit on them, they can read up again on all the laws, show them all of their records, and fight to prove they have been honest. They also can pay the consequences (ranging from fines to jail time) if they mess up and the IRS penalizes them.

But who would want to do that? That is why we have accountants and programs to do it for us. A few people take a lot of time to gain a full understanding, and then help normal people get through filing and paying their taxes. There are people, including my wife, who really enjoy learning about all the complexities and become an accountant, but it isn’t for everyone! So why do open source developers expect all people to be “accountants?” What would you do if your accountant told you to “RTFM?”

Yes, the resources are out there for consumers to find answers to their problems, but it in not always easy, and most of the time very difficult and over their heads. Consumers and end-users frustrate us developers, I know this, but we have to be understanding.

Consumer Version of Linux

I don’t think I could call any version of Linux right now available “a consumer version.” However, I do have my predictions as to what needs to happen for a consumer version of Linux to become available.

  • One Consumer Distro – I think we’re going to need to have one major consumer version of Linux. Not ten, five, or even two. There needs to be one version that is considered the “starting point” for consumers being introduced into Linux. There can be “others” out there, but there needs to be one great version that all OEMs and vendors carry and support.
  • More Polish Than Power – I think we’re going to need that distro to have a lot more polish than power. Consumers don’t need or want unwieldy power, they need easy control.
  • Easier Than Windows / OS X – If Linux wants to become mainstream, it needs to be easier and better than windows. The goal isn’t being as easy, but totally surpassing it.
  • One-Click Install / Download & Install – It needs to be easy for users to download and install applications. They need an easy way to find those installed applications. It also has to be relatively easy for developers to create these distributions.
  • Major Company Backing – I think one of the reason Ubuntu has been so successful is that it has had a great mix of company backing and a great community. I think Red Hat as well has found a nice niche in the market. The question is whether or not
  • Inexpensive – I don’t think this version could be 100% free (as in cost). The problem is the total amount of polish required to put into this  project, I don’t think you could get any team of open source developers to spend such a large amount of time on usability with out an open revolt. Preventing all levels of stupidity is just extremely monotonous and time-consuming. A low cost OS (like $39) would be great. I imagine an Ubuntu Plus project, and it would have a relationship like Fedora, CentOS, and Red Hat has.
  • Quality Customer Support – There will need to be several options of customer support. Right now there really aren’t any options for people to get paid assistance. But pointing people to forums, mailing lists, and IRC is not an option as being the first line of defense for getting support. Consumers pay for support so they can ask their really stupid questions. This support should come with the purchase of a new machine.

When?

I honestly don’t know. I would love to see this soon, but all of the current distros just are not ready to handle a full on-pslaught of stupidity that regular consumers bring. Ask anyone in technical support. I believe technical support is one of the most loathed jobs in the industry, and there is no way the current Linux community is ready to be subjected to it. I’m kind of glad that Linux, in its current state, isn’t 100% mainstream yet. Knowing Linux, and dealing with Linux users can be a haven of refugee from the common issues of regular users. I honestly think in order to have a consumer version of Linux take a strong hold in the market, there is going to have to be a very strong business behind it that knows how to rally a great community around their product.

MySQL, 40 Million Rows, MyISAM to InnoDB, 45 Minutes

Posted in: Programming|Tags: MySQL, PHP, Tips and Tricks |January 12, 200916 Comments

Warning: This blog post is NOT a walk-through or tutorial. If you don’t know what you’re doing, you could seriously screw up your database. This is just talking theory and ideas on how I solved my problem.

The other night (really, the other morning) I had the wonderful pleasure of trying to convert a table with 40 millions from MyISAM to InnoDB. The reason for the conversion was this table had a high amount of queries, and a high amount of writes. With this table growing and updating daily, the table locks were killing us. Because MyISAM needs to peform a lock on the entire table, we would have dozens of queries backlog as locks and writes were taking place. It was causing the site to screech to a halt, waiting for the locks the be released. It was a total nightmare.

We decided to convert to InnoDB because it allowed for row level locking. There are some drawbacks to using InnoDB, it being slightly slower than MyISAM for reads, and our table is double the size after the conversion.

I started the convertion at 12:00 AM when the site’s traffic was at a low. I disconnected the website from the database so no reads-writes could be excecuted against it. I then created several backups of the entire database. It was a good thing I created several, because one of them actually got messed up and was useless. I downloaded a good copy of the database and restored it to my local machine. I tried issuing the ALTER TABLE command to the table, and after waiting for 2 hours, aborted it. I then did an export of just the table’s data, and truncated it. I then issued the ALTER TABLE command, which on a table with no data executed in less thant .01 seconds. I then restored the dumped data. At first, it would take 0.5 seconds for every 2000 records. However, by the I had restored just 4 million rows, it was taking 5 seconds or more every 2,o00 records. After some rough calculations (and being very tired at 3 AM), I figured it would take around 30 hours, and I said screw it and aborted the restore. I wrote an email to my boss saying that I wouldn’t be able to do the conversion in a timely manner, and we would have to seek a different solution.

Just before I was going to restore my original backup, I had one more idea. I had been reading so much about different storage engines that I remember reading about the MEMORY storage engine. Once again, if you are looking for simple tutorials, this isn’t for you, this is an advanced topic. I just don’t want to see someone saying in a comment that they converted their table to MEMORY, saw awesome performace, lost all their data in a reboot. The MEMORY engine does what it says, it stores data within memory. The HUGE issue is when the mysql instance is reset, the data is just lost.

However, I didn’t need a permamant use of the MEMORY table. If I understood the manuals correctly, InnoDB stores it’s data according to the Primary Key. This table Primary Key was a combination of two INT fields. MyISAM, however, didn’t have the data stored by the Primary Key. So the problem is as the restore proceeds further, its having to search where to insert the data in the table. So I thought “What if I can have it insert in the order it will store it?” I edited my local my.cnf file to allow for 4GB memory tables, and then altered my table locally to use the memory storage engine. Once again, I did this on my local database on my 8GB Memory machine on a dummy database. This was not my production database.

I then restored my dump of the table to my memory table. It went extremely quick, under five minutes easily. I then was able to issue a “ALTER TABLE tbl ORDER BY key1 ASC, key2 ASC”. Because it was in memory, it was extremely quick (although watching mysql use 4 GB of my memory was rather interesting). I then exported this newly sorted table. It was in an order like 1-1, 1-2, 1-3, 2-1, 2-2, 2-3, etc. I then uploaded this table dump to the production server, and tried importing it again.

The task completed in under 30 minutes.

Between exporting, sorting, and re-importing it  had taken about 45 minutes. 30 hours compared to 45 minutes total, it worked so much better. I’ve learned if I have the ability to take a database offline, if I need to perform serious actions of pruning or anything else like that, using the MEMROY engine can make things go a lot smoother and faster. I wish I had known this the first time, that way I could have started at 12:00 AM and be done 45 minutes later. Instead, it took till 6:00 AM, but next time I’ll know better.

As always, hopefully this can help someone else.

Characteristics of Good PHP Code

Posted in: Articles, Programming, Technology|Tags: Best Practices, Development, PHP, Programming, Technology, Web Design, Web Development |January 11, 20092 Comments

At the time I am sitting in the Las Vegas airport waiting for a very delayed layover flight to San Diego. Wonderful weather causing all sorts of headaches. So I’ve decided to make the best of my time by writing the introductory article to a series of PHP articles. I’ve had this idea for a while, and now I’m going to finally sit down and write it.

A Different Type of Article

Over the years I’ve seen many great tutorials on programming better in PHP. Many start with a number, then with a word like “techniques, practices, patterns, etc,” and end with a phrase like “for better PHP.” Examples like “8 Tips for Cleaner Code,” “5 Practices that make you’re life easier,” and the list goes on. I’ve enjoyed and learned a lot about making my PHP code better. However, there is a subject I’ve never really read or heard about before: characteristics of good PHP code.

What is the difference between characteristic and the other subjects above? To me tips, techniques, and practices are well-defined instructions that are straight forward. They may be advanced topics, but they are well-defined. In lots of ways I think of them as rules to follow.

A characteristic, for me at least, is a more abstract concept. Let me give you an example: readable. Several techniques and practices help towards having more readable. However, if a developers follows a few rules, it doesn’t necessary mean his code will be readable. Characteristics are traits that code have that exists, but aren’t easily defined into a set of rules.

Real Life Example

Lets look at a non-programming example. A person can have the characteristic of being “nice.” We all know nice people, and people who are not nice. A nice person might have a habit of saying hi to their co-workers in the morning. However, just because a person says hi to a co-worker in the morning doesn’t mean they are nice. It is impossible to quantify being “nice” into a set of rules and regulations. Being nice is a so much more than just following a few guidelines, hence it is a characteristic. Its the way a person acts in a large variety of situations.

If I am a person who isn’t nice, but I want to become nice, I can’t just google “10 tips on being nice,” follow them, and declare myself a “nice person.” I can’t just emulate things nice people do and expect the same results. Becoming a nice person requires hard work and serious reflection. I would need to take a step back and continuously analyze my actions over time.

Why Characteristics?

So why list characteristics? Writing great code is so much more than following guidelines. It is impossible to write a book of rules that will guarantee great work, yet so many people take this approach when programming. I’ve met several developers, that while reviewing their code, list rules and guidelines as to why they did everything they did. “I’ve commented every section of code.” “I’ve used the DAL for all the queries.” “I used X pattern for Y situation.” The list goes on, but the code they’ve produced looks, feels, and runs sub-par. The reason I like to focus on characteristics is that is helps me recognize there is more to programming than rules and guidelines. Best practices will only help you out so far. The ultimate test is after everything is said and done, and I review my work, is going through my list of characteristics and seeing if my code follows the list.

Like personal characteristics, programming code with great characteristics can take time and experience. Every year I learn more as I write more. I find weaknesses in my code. I make it a personal goal to improve the quality of my code, and I find it helpful to have a list of characteristics I strive for.

What Characteristics?

So what are desirable characteristics of good PHP code? Here is my own list, in no special order. This article is the first of a series which I will describe how to achieve these characteristics with the your code, and how to evaluate your code. So without further introduction, here is my personal list:

  • Readable – Being able to easily read code is vital. Don’t ever assume you will be the only developer to ever read and maintain your code. I can’t think of a single project for the exception of my blog that I have been the only one who worked on it. Readable code has meaningful variables, good comments that help describe what’s going on. However, good variables and comments doesn’t necessarily mean your code is readable.
  • Organized – While some people think this is the same as readable, organization is different and crucial to me. Readability is the ability to read your code, however organized code helps you find what your looking for. There are many techniques to help keep your code well organized, but the most important thing is at the end of the day, can your fellow developers find what they are looking for?
  • Modular – I hear this word tossed around a lot when talking about programming. However, what really is modular? I like to define it as being able to take a part of your code and use it elsewhere with the least amount of headache.
  • Relevant – While I hear a lot about Modular code, I don’t hear a lot about relevant code. While people might consider relevant in the modular or organized characteristic, I find it helps me to separate this out. Relevant to me means that code is where it belongs. Its easy to have code blur together and have purposes mixed. Relevant code means the grouping of code belongs together.
  • Efficient – What good is code if it is slow, doesn’t scale, and will have to be re-written? Is being efficient is just following a handful of rules and guidelines?
  • Practical – It may be efficient, it be organized, but is it practical? In the past I’ve written the “coolest” class, or so I thought, only to have a fellow developer tell him that my implementation is confusing, and overly complex. While many times we create code that isn’t robust enough, but it is possible to make stuff just complicated, over-designed, or just impractical. Keeping your code practical helps you and your team to make a good solution that is easy to maintain.
  • Documented – Code that isn’t well documented will be a time drain. I know many developers who think keeping up documentation slows the development process down. However, without that documentation, the overall development process will suffer. Bringing new developers up to speed, maintenance, even just general development will be slowed down by “figuring stuff out.” Documentation is also more than just having a “wiki” or using comments.
  • Longevous – The definition is to live a long life. There are two parts to having longevous code. First of all, when you’ve programmed or maintained some code, ask yourself. “How long will this last? Will this solution work well over time?” Then, the second part which I think is almost never asked: “when the time comes, how easily can I extend, or replace this code?” To often programmers “dig ruts” so-to-speak in projects. They code an aspect of a project that locks them into a situation that is extremely difficult to code out of.
  • Secure – All of the time spent on development can be for nothing if it isn’t secure. Security in web development is a must. It doesn’t matter the size of the website, large or small, eventually someone will try to break it. Someone will try to compromise it. The consequences vary, from an annoyance, to destroying the entire business. Making your application secure is a skill all developers need.
  • Safe – While some people think of this as the same as secure, for me safe PHP code means it handles errors correctly. Great PHP code handles errors correctly. If a PHP class fails, it should handle the error properly. It should also throw errors correctly when needed. If code is safe, I know that it will behave as it should, and properly let me know when it is not.

This article is the first of this series for me, and I’ll try to write an article for each characteristic. I will start on the top of the list and work my way down. Hopefully I can write one every week, and this can help PHP developers take a broader, overall look at their work. Principles, tips, and techniques are great, the are helpful, but without a broader view of things, developers can still develop sup-par code. Knowing the characteristics of good PHP code can help us strive to ensure we make great solutions. It allows us to sit back and really ask ourselves “does this code really have these characteristics?”

The Dangers of Twitter!

Posted in: General|Tags: Database, Funny, MySQL, Twitter, Web 2.0 |January 8, 20092 Comments

Over Christmas my wife and I visited my father in San Diego, CA. Several members of my dad’s side of the family were there, and one day we had a discussion about being “wired.” What does that exactly mean? Well, how fast would a person respond after any form of electronic communication were to be sent.

We decided, that hands down, my father was the most wired. One evening my wife and I stayed in the car while my father ran into a grocery store to pick up something quickly. I made a tweet about our trip to Barnes & Nobel, and how I spend so much money there. By the time my father came back to the car three minutes later, he commented to me about my tweet. He had set up that all my tweets are sent to his phone. I laughed and told him he definitely was the most wired.

Fast forward to January 8th, 2009, where I’m performing some database maintenance on the database for Dating DNA. For those who don’t know, I work for my father as the VP of Engineering for Dating DNA. Well, turns out that during the problem, one of the tables gets hosed. I had made 4 local backups and 2 off site backups (I’m paranoid, okay?). Turns out the off site backup to my local server at my home got corrupted during the transfer.

Being 1 AM, and none of my friends being online to congratulate me on my data redundancy, I hop on Twitter and post the following:

Wow, I’m 100% grateful for database backups. *watches his boss freak at he gets this tweet*

I then think that I better follow up so Kevin doesn’t totally freak. Within seconds I post this second tweet:

Just an FYI Kevin (my boss), we’re 100% good, no problems :)

Before I can hit “update” I get a txt message from Kevin: “What happened???” I woke up my boss with the auto-txt from twitter, and made his heart skip a beat reading something about database backups from his VP of Engineering while he is working on DB maintenance.

Word of caution: know who is following your Twitter account! You might give your boss a heart attack!

CSS – I’m 100% Converted

Posted in: Articles, Programming, Web Design|Tags: Books, CSS, CSS Mastery, Tips and Tricks, Web Design, Web Development |January 8, 2009No Comments

It has been a hard, long road. But these last few days, I’ve finally have reached a realization of a great step in my life as a web design: I’m 100% converted to CSS layouts, and have forsaken tables. 5 years ago I would have believed that would be impossible, and that I would love and use tables for my layouts until the day I die. I remember hearing the lectures and heated discussions on using CSS instead, but I couldn’t bring myself to using CSS for layouts. Don’t get me wrong, using CSS was amazing for formatting and styling, such a color, size, bolding, etc. I love it every second and my conversion to CSS for those scenarios was very quick. However, the positioning of content, headers, footers, side menus and navigation was a nightmare for me at first. I just didn’t get it.

However, a few days ago I had to work with a layout that was created using tables. I looked at the source, face palmed my head, and dreaded the misery of working with it. There was no rhyme or reason to the syntax. It was total chaos. Then, when I had to create a similar page using the exact images, just adding different dynamic content, I was able to quickly re-make the page. The source was smaller and easier to read and work with. I had to incorporate content and styling from other parts of the website. I easily added the links to the needed CSS files, called the exact same rendering methods, and it worked perfectly. Super simple and easy.

We rolled the new content live, and we had a situation. Wonderful Internet Explorer 6 & 7 had issues rendering both pages, the table based and CSS based. I spent 2 hours trying to figure out the issues with the table based page. I couldn’t figure out where the extra space was coming from. I finally got it to the point where it didn’t look “bad” but it wasn’t 100% fixed. I then looked at the CSS page, and within 10 minutes I was able to solve the problem. I sat back in awe, and pondered the wonder that had just happened. I had converted, 100%, to using CSS layouts. I couldn’t imagine doing it any other way. There are appropriate times to use tables, but only then do I use them.

Why the Long, Hard Conversion?

Control – It is really, really simple why I had such a hard time switching over to using CSS for layouts. I had much more straight forward control over my layouts with tables. Yes, they were a pain to maintain. Yes, the source looked at total mess. Regardless, I could easily control every aspect of my layout. 100% height? No problem! Align text to the bottom of the cell? Piece of cake. Center stuff? I could do it blindfolded. While the source of tables might stink to edit, the concepts were very, very simple. After playing around with table layouts for a little while, you could learn all the tricks and understand the concepts. Even if you had a bug or problem, 99% of the time the solution was obvious and straight forward.

CSS on the other hand is a complete beast to wrap your head around. Especially if you had lived with tables, like I had, for years and years. With tables, there is little theory. You just make grid like layouts and go. CSS has a lot of principles you must understand before you can really use it. The box model, positioning, floating, etc. It can all be very complicated, and frustrating when it doesn’t work. Many times when my layout would break, I didn’t know if it was a browser issue, or maybe I had an error on my side. How do I fix it? I have to search over and over again on the internet, and there wasn’t a single place to find answers. Many times I would have to comb through results from forums, blogs, and articles to find my answer.

How I’ve Mastered CSS

I’m proud that I’ve finally been able to embrace and benefit from CSS. It has enabled my web development to be faster, cleaner, and more efficient. There have been several things that have helped immensely, and hopefully they can help you too.

Step 1: CSS Mastery by Andy Budd

This book is a must for every single website designer. It has the perfect balance of technical knowledge, real application, and great examples. It isn’t very long, and can be read in a few hours. It covers the basics & explains the principles, and is a great reference always. However, the best way I can describe what this book did for me is this: before, I felt guilt tripped into using CSS. Viewers with accessibility issues would have a difficult time. My HTML wasn’t “meaningful” but a jumble of tables and mess.

However, after reading this book, I preferred to use CSS. I saw all the advantages, I understood the principles, and I knew how to make CSS work for me. This book was better than any other tutorial, documentation, video, etc that I had ever used. I walked away feeling like I could actually use CSS.

Step 2: FireBug

If you are a web developer, and you do not have FireBug, you are in the stone-age. FireBug is a debugging tool that is a add-on for FireFox. It allows you to visualize and follow exactly how you’re CSS is being executed. See how much space a DIV tag was taking, and see it’s properties, and the different CSS statements that gave it it’s properties was a break through. I would say 90% of my CSS issues and bugs can be solved by using FireBug. Of course there will be IE bugs that I can’t use FireBug to solve, but it a million times better than not having it at all.

Also, have FireBug enabled all the time. There are many times where I’ll see a website with a cool technique and analyze how they do it using FireBug. Its a great way to learn new things.

Step 3: Cold Turkey w/ Small Project

The next step for me was going Cold Turkey on a small project. Why cold turkey? (Cold turkey is a saying that means to make a change instantly, and not slowly change over) It is painful, but forcing yourself to use 100% legit CSS makes you learning the techniques for using CSS well. Why a small project? Trust me, it will be very, very frustrating. Your small project’s design shouldn’t be overly complicated. Keep it simple. A great way to start is simply creating a personal portfolio website, 5-10 pages, and use 100% CSS. After getting the hang of it, gradually start working on large projects. Make a new blog theme, or incorporate CSS in all of your work. Eventually, you’ll find yourself using CSS more often than not.

Step 4: Make Designs CSS Friendly

With tables, I had total (while chaotic) control over my designs. You can also have that same control with CSS, but its takes different techniques, and often the more crazy, the more likely a browser will make it look bad. This was extremely frustrating for me as a web development. Make your life easy at first by making CSS friendly designs. If a design used to require 6 nested tables with many width and height definitions, setting the backgrounds to each one to make an effect look just right, it is probably over complicated, and unnecessary. Make your design easy to implement in CSS at first. You’ll find yourself making cleaner designs, and after you get the hang of it, you will start designing websites with CSS in mind. Instead of seeing grid frameworks with tables, you’ll see DIV tags.

Step 5: Keep Notes on Bugs & Solutions

Last, but not least, make sure you track the bugs you have, and your solutions to them. You’ll find recurring problems that you always will face. How to get 100% height, how to solve box model issues, etc. If you’re good at documenting problems & solutions, you’ll find that down the road you’ll rarely run into a problem you haven’t already faced. CSS has it’s weaknesses, but you’ll know how to overcome them. I personally need to do better at this step 5. I swear that once every 3-4 months I have an issue with unordered lists and IE6. You’d think I would write down the solution?

Step 6: Validate, Validate, Validate!

Many times a “bug” with CSS isn’t actually a bug, but you using it wrong. Typos can cause drastic affects, yet may not be apparent where the typo is. Services like W3C’s Validation tools make life easier. I know its frustrating when it spits back 27 errors, saying you’re doing it all wrong. However, if you get in the habit, validation will soon become a great tool and not a burden.

Step 7: Don’t Look Back

Once you start this journey, don’t look back at how you used to do it. Forget table layouts and it’s unreadable markup. You’re better than that! Trust me, I know how frustrating it can be when you don’t understand why your layout isn’t working like you want it to. I was in your shoes thinking “I will never, ever use and like CSS.” But I’m telling you, now I can’t stand the old methods. I cringe when I have to use a table for non-tabular uses. It is possible to love CSS! The more you revert to old table layouts the more you’ll struggle to convert to CSS.

Conclusion

I’m glad I’ve suffered through the torment of learning and mastering CSS. While I wish the learning curve for me hadn’t been so dramatic and difficult, it has paid off. Now that I have well formed XHTML documents with valid CSS, I can do all sort of things using JavaScript and jQuery, and do it quickly and efficiently. If you find yourself struggling, I highly suggest following my steps. I promise, it will pay off in the end. To be 100% honest, I still am totally shocked I’m a CSS fan now. If myself from five years ago could see me to day, that Justin Carmony in the past would be in utter disbelief.

Happy New Year – Snowmobile Trip

Posted in: General|January 5, 2009No Comments

I’ve just created my flickr account and trying it out. I thought I would upload the photos of new years snowmobile trip I took with my wife & in-laws. It was a great get-away, especially as tech guy. To give you guys an idea of where we went, there is no internet or cell-phone reception. It was too cold to bring up my laptop, and I didn’t want to risk breaking it, because we can only snowmobile in to the cabin. I didn’t feel like strapping my laptop to a snowmobile going up a mountin.

I highly recommend a get away for any technology people that requires them to become “disconnected” from the rest of the world. No emails, no tweets, no rss feeds, no IMs, nothing! Its very refreshing. It also is a great time to think with no distractions. Here are some of the pictures from our trip:

The View Again

The View

Justin & Joanna

DSCN0220.JPG

Snowy Tree

View Rest of the Pictures

Once again, happy new year, and I hope everyone has a great 2009. Just a shameless plug, if anyone is looking for a professional PHP developer to some freelance work, Q1 and Q2 of 2009 I have so

me time opening up. </shameless-plug>

Yay…. gotta love delays at t…

Posted in: General|December 25, 2008No Comments

Yay…. gotta love delays at the airport! Woohoo!

Merry Christmas & Happy Holidays

Posted in: General|December 24, 2008No Comments

Joanna and I would like to wish everyone a Merry Christmas and a Happy Holidays! I’ve included a funny little christmas video about a guy with WAY to much time on his hands:

XKCD & 11th Grade

Posted in: General|December 19, 20081 Comment

I saw a great cartoon today on xkcd.

Replace Perl with PHP, and that is how I feel about my public education. Granted, there were several teachers that had a large impact on my professional life, but over all my self-education has had a much bigger impact than my overall public education.

Also, if you’re a technical guy, and you’ve never read xkcd, you must read it. It is a fantastic cartoon series, especially for those with a little geek in them.

Useful Shell Commands

Posted in: General|December 17, 20081 Comment

I’m not an expert at all with the linux shell. I know how to run a LAMP stack, but that is about it. Every blue moon I need to use a command that I used last blue moon, but forgot how. This list will now be my list to write down the cool “commands” I learn to accomplish different tasks. That way I don’t have to bug people on #uphpu about it. ;)

  • How many files in a folder? - ls -1 | wc -l
  • How much disk space is a folder taking up? – du -sh .
  • Truncate/Empty a file – cat /dev/null > file.log

I’ll keep adding to the list as I continue my work with Linux.


« First…10«13141516»20…Last »

Tag Cloud

Apache Apple ASP .NET Blogging business CSS Dating DNA Designs & Patterns Development Education Errors Frustration Funny Goals Google GridView iPhone iPhone SDK JavaScript jQuery Linux Mac MySQL nginx Open Source OS X Personal PHP Presentation Programming Project Management redis scaling Security Servers Software Development svn system administration Technology Tips and Tricks Tutorials Ubuntu UPHPU utah utos Web 2.0 Web Design Web Development WordPress Zend Studio

Archives

  • April 2013 (2)
  • March 2013 (2)
  • February 2013 (1)
  • January 2013 (1)
  • December 2012 (1)
  • November 2012 (1)
  • October 2012 (2)
  • September 2012 (1)
  • August 2012 (1)
  • July 2012 (1)
  • June 2012 (2)
  • May 2012 (2)
  • April 2012 (3)
  • March 2012 (1)
  • February 2012 (1)
  • January 2012 (5)
  • December 2011 (1)
  • November 2011 (6)
  • October 2011 (2)
  • September 2011 (3)
  • August 2011 (1)
  • July 2011 (3)
  • June 2011 (1)
  • May 2011 (5)
  • April 2011 (5)
  • March 2011 (1)
  • February 2011 (5)
  • January 2011 (5)
  • December 2010 (2)
  • November 2010 (1)
  • October 2010 (4)
  • September 2010 (5)
  • August 2010 (1)
  • July 2010 (1)
  • June 2010 (1)
  • May 2010 (1)
  • April 2010 (1)
  • March 2010 (2)
  • February 2010 (4)
  • January 2010 (3)
  • December 2009 (1)
  • November 2009 (2)
  • October 2009 (2)
  • September 2009 (14)
  • August 2009 (1)
  • July 2009 (1)
  • June 2009 (1)
  • May 2009 (3)
  • April 2009 (2)
  • March 2009 (1)
  • February 2009 (4)
  • January 2009 (13)
  • December 2008 (13)
  • November 2008 (4)
  • October 2008 (13)
  • September 2008 (16)
  • August 2008 (6)
  • July 2008 (13)
  • June 2008 (17)
  • May 2008 (3)
  • April 2008 (2)
  • March 2008 (3)
  • February 2008 (8)
  • January 2008 (10)
  • December 2007 (2)

Recent Comments

  • онлайн игровые автоматы on Software Development With Clients In Mind
  • Ashwin on SMS Nagios Notifications with PHP & Twilio
  • pbyrne on The Catalyst for Agile Development: Sprint Retrospective
  • SolutionsIQ on The Catalyst for Agile Development: Sprint Retrospective
  • ChristianHughe8 on The Catalyst for Agile Development: Sprint Retrospective

Popular Posts

  • Mac OS X Lion, /etc/hosts Bugs, and DNS Resolution
    Mac OS X Lion, /etc/hosts Bugs, and DNS Resolution July 27, 2011
  • PHP Design – Biggest Database Oversights
    PHP Design – Biggest Database Oversights October 25, 2008
  • Why Are Some Open Source Advocates Hypocrites?
    Why Are Some Open Source Advocates Hypocrites? July 18, 2008
  • Zend Studio vs PHP Development Tools
    Zend Studio vs PHP Development Tools September 24, 2008
  • Page.FindControl() Returning Null Issues and Solutions Within Another Control
    Page.FindControl() Returning Null Issues and Solutions Within Another Control February 12, 2008
  • XAMPP for Mac – My Frustrations & Solutions
    XAMPP for Mac – My Frustrations & Solutions February 14, 2009
  • MySQL, 40 Million Rows, MyISAM to InnoDB, 45 Minutes
    MySQL, 40 Million Rows, MyISAM to InnoDB, 45 Minutes January 12, 2009
  • Restoring Large MySQL Dump – 900 Million Rows
    Restoring Large MySQL Dump – 900 Million Rows April 6, 2011
  • Web Development 10-Years Ago & Now
    Web Development 10-Years Ago & Now July 15, 2008
  • MS SQL 2005 (T-SQL) Row Count for Each Table
    MS SQL 2005 (T-SQL) Row Count for Each Table February 19, 2008

Recent Posts

  • The Catalyst for Agile Development: Sprint Retrospective
    The Catalyst for Agile Development: Sprint Retrospective April 22, 2013
  • Thoughts on HBR’s “Seven Rules for Managing Creative People”
    Thoughts on HBR’s “Seven Rules for Managing Creative People” April 7, 2013
  • First Serious Attempts with PHPUnit, Composer, and the Omniture API
    First Serious Attempts with PHPUnit, Composer, and the Omniture API March 19, 2013
  • Mobile Devices: What A Difference 8 Years Made
    Mobile Devices: What A Difference 8 Years Made March 15, 2013
  • PHP Live Regex
    PHP Live Regex February 23, 2013

Pages

  • About
  • Contact
  • Pages
    • PHP Bob
    • Utah PHP Users Group
  • Portfolio
  • Talks
    • Blazing Data with Redis
    • Demystifying CSS and WordPress

Email Us

Your message was successfully sent. Thank You!

Friends & Family

  • http://utos.org/
  • Joseph Scott
  • Kevin Carmony
  • Matthew Kimber
  • Utah Open Source Planet

News & Blogs

  • Andy Budd
  • Lifehacker
  • MySQL Performance Blog
  • Slashdot

What I'm Reading...

  • Patent Troll Lawyer Sanctioned Over Extortion Tactics
    ( Slashdot )
  • The London Riots and Facial Recognition Technology
    ( Slashdot )
  • Password Strength
    ( xkcd.com )
  • The TimThumb Saga
    ( Matt Mullenweg )
Read More Shared Items

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
Copyright © 2010 Justin Carmony. All Rights Reserved