Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,156,214 members, 7,829,354 topics. Date: Thursday, 16 May 2024 at 04:16 AM

How About An Actual Code Review? - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / How About An Actual Code Review? (715 Views)

The Actual Cost For SEO Services In Nigeria / Hide Actual File Path (2) (3) (4)

(1) (Reply)

How About An Actual Code Review? by my2cents(m): 10:33pm On Mar 09, 2008
So,

Every now and then, one of us will post a website for review. For the most part, it has always centered on the actual UI - "colors out of whack" or "the header is inconsistent here and there". That's all fine and dandy. I am probably one of the few who actually will go as far as view the source to see what lied underneath. So I began to think, "why not we do actual code reviews where we look at our css, php, html, javascript, etc?" Sure, in the end, the site works and we got paid. Having said that, there are efficient ways to write code.

The aim of this isn't to say, "your code sucks" but to advise on what is more efficient and why it is so. I think we can all learn from this. An example: I see many CSS sripts with:
padding-left: 22px; padding-right: 10px; padding-top: 4px; padding-bottom: 10px;

It's all good but such code could be compacted (thereby saving some bandwidth, among other reasons) via the T(op) R(ight) B(ottom) L(eft) (TRouBLe for short) technique into one line like so: padding: 4px 10px 10px 22px. Even better, if all 4 attributes are the same, we could tighten it even more like so: padding: 10px 10px; (Top and Bottom: 10px, Left and Right: 10px).

Again I think we can all learn from this. Other than the back-end languages, no one needs to copy and paste their code as it can be easily made available via "view source".

What do you all think?
Re: How About An Actual Code Review? by prodgalson: 2:34am On Mar 11, 2008
I think its a great idea, Helping people to get rid of bad coding habits will get us all at best practices sooner than later. The only thing I see in the way of achieving that goal is that a lot of people don't write their own code: they use WYSIWYG editors or, at best, copy and paste code from other sites.
Re: How About An Actual Code Review? by my2cents(m): 11:22am On Mar 11, 2008
The only thing I see in the way of achieving that goal is that a lot of people don't write their own code: they use WYSIWYG editors or, at best, copy and paste code from other sites.
Prodgal,

You know, I never thought of that. However, I still think it is possible - there are things that WYSIWYGs do (like include scripts inline on a page as opposed to in a .js file, for example) that we could advise against. Here's an example: Someone posted for review a website with a cool script I ended up using for a recent project of mine. I viewed source and found that it came from Dynamic Drive. I however didn't paste the code inline in my file. Rather, I copied it, pasted it in a .js file and included that file on my pages, thus separating the script from the presentation. In other words, if I had pasted the same code on 5 pages, it would have been a nightmare to maintain.

Your points have been well noted. I still think though that it is possible. Or at least, let's give it a try.

(1) (Reply)

I Need A Swish/flash Trainer / Nigerian Youth Software Developers / Nigeria's Foremost Professional It Community

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 20
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.