May 8, 2006
Do That To Me One More Time…
imagined by: James Mathias
Something I take very seriously when it comes to web development and design is the precept of doing something once, and using it over and over. I call this “write once, use twice”. In reality I’ll use it more than twice; it just sounds better than “write once, use it thousands of times”. This theory can be put into practice in every aspect of developing for the web—or even running your business.
In CSS
When I write CSS, I do it differently than most developers; I use a logical and ordered format that I have developed over time. I have a framework I created called “CSS467” (it’s named for a specific scene in a movie I love). Within this “framework” I have CSS classes that control specific things, which allow me to keep my overall CSS slim, but still have flexibility and control over the non-specifics.
For instance, I have a class named “shaft”, and another named “shift” the former contains the rule “float: right;” and the latter has “float: left;” this is all these two classes do. This allows me to quickly float an image or paragraph or div without having to create a whole new class, or edit an existing class, it affords me control and flexibility.
There are exceptions to this, if I need to place floats on an unordered list to make a horizontal-image-rollover menu, I would apply the “float: left;” in the CSS rule for the “li”, as this is easier to control and change later—not to mention cleaner—than applying class=“shift” to each “li”.
I have an entire series of framework classes that allow me to add properties/rules to certain elements without having to create a whole new class or edit an existing one with potentially redundant information.
In PHP
The concept of using a server side programming language to build web-sites is to make things easier to create and maintain, in my opinion PHP does this beautifully.
I have a function I wrote for use in OnePanel 1.5 (that will be built into OP 2), which builds any kind of menu you need from an array. It returns the menu using an xHTML unordered list, which can be endlessly styled using CSS.
The function allows me to build consistent and unique menus for my web-site projects without having to type out each menu, and then have to find and change each one if I make a minor change to structure, presentation or data. Menu_create() allows me the flexibility of individually styled CSS menus, without the overbearing hassle of site-wide code maintenance. And because all the values for the menu are stored in an array, it’s easier to read and change later. It allows me to go to exactly one place to change the structure of all my menus site-wide, and one other place to change the presentation and one other to change the data/content. This is true separation of content, structure and presentation, which makes my life and job much, much easier.
In Graphics
Photoshop has actions which allow us to do something once, and then apply it many more times without having to physically repeat each step. There is also the ability to create textures, shapes, brushes, patterns and styles that can be used—or overly used—without having to recreate them each time.
In Business
For me having templates for everything I send out; e-mails, contracts, letters, invoices etc… All I have to do is fill out the pertinent client information and click send. This saves me loads of time that I would be spending drafting every e-mail from scratch every time.
In conclusion, doing something one time, then re-using it is maybe one of the most powerful, flexible, consistent and overlooked ways to accomplish your daily development duties.
I hope I’ve given you some ideas and helpful solutions to help decrease the daily workload.
Do That To Me One More Time…
- 05.8.06 at 2:28pmthrown down:
- James Mathiasimagined by:
- Developmentally Ablestored in:
- 241 peeps, 13 of whom commentedenjoyed by:
More of the Same
10 recent “Developmentally Able”
- Big Business Bulli…
⇒ on: Aug. 26, 2007 - 6pins has launched…
⇒ on: Apr. 19, 2007 - Steal Ma.gnolia
⇒ on: Apr. 4, 2007 - Getting Logitech…
⇒ on: Feb. 3, 2007 - Can I get that ico…
⇒ on: Dec. 21, 2006
- Help Wanted
⇒ on: Dec. 6, 2006 - 13 Applications of…
⇒ on: Nov. 16, 2006 - Will The Real Styl…
⇒ on: Jul. 9, 2006 - Mr. Alan Jax is an…
⇒ on: Jul. 9, 2006 - Links to Me Will b…
⇒ on: Jun. 27, 2006





your comments
add comment
13 comments
May. 08, 2006 (5:15pm) [#1]
Jamie
Nice little things, quite interesting…might take some up myself, like the email templates and actions in Photoshop
Nice article
May. 08, 2006 (7:25pm) [#2]
James Mathias
Thanks Jamie, I appreciate the comment, and I’m glad you enjoyed the article!
May. 11, 2006 (3:01pm) [#3]
David Myers
Nice post James. I use the email templates as well, as I know what it’s like having to start from scratch.
May. 11, 2006 (8:57pm) [#4]
James Mathias
Hi David,
Thanks I appreciate it. Yeah templates are a real time/life saver.
May. 12, 2006 (1:33am) [#5]
Kennedy
I like those ideas.
P.S: Loving the changes you’ve made, especially the new lotus.
May. 12, 2006 (3:27am) [#6]
James Mathias
Thanks Kennedy, I appreciate it.
May. 15, 2006 (3:29pm) [#7]
Ian Gordon
I think for most times that is true, if you do it the right way one time you don’t have to worry about doing it again. But, you should also consider maintenance and updates and such.
I mean, you have to remember the saying “there’s more that one way to skin a cat” so there’s always more, and sometimes better, ways to do something. Don’t limit yourself too much, you might find it the future you were stifling yourself. A little creative flair and experimentation never hurt anybody.
May. 15, 2006 (9:29pm) [#8]
James Mathias
Hi Ian,
I keep things adaptable and consistently update when needed. This method doesn’t stifle anything, nor does it make maintaining harder, in fact it makes maintence much, much easier.
I’m not really sure where the misunderstanding is for you but, I have been doing things this way for 3 years, and I can safely say that my work has improved steadily across that time, not to mention the hundreds of hours I’ve saved not having to do the same thing over and over again.
May. 16, 2006 (2:58am) [#9]
Kennedy
What version of Photoshop are you using?
May. 16, 2006 (11:56am) [#10]
James Mathias
On The PC I have PS 7.0.1, on the Mac, I have PS CS
May. 17, 2006 (2:05pm) [#11]
Jordan
Yeah re-usability is great. I have made a template in InDesign then gets filled with data from an XML file. So I just need to write a simple XML file to create an invoice or quote. I hope to make a new client management system in PHP at some point, but for now this is good.
May. 18, 2006 (12:05pm) [#12]
James Mathias
Yeah, That would be great.
May. 19, 2006 (9:24pm) [#13]
Kennedy
Which version do you prefer? I like 7.0.1 better than CS because in CS the scrolling options have been taken out…
add comment
13 comments