Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Hardware>>How do you write maintainable code?

How do you write maintainable code?

ca_redwards
10-12-2005, 07:15 PM
I have developed a few tips, but would like to hear your ideas too.


Never nest parentheses. I refactor any simple inner expression as its own local variable.
Type both opening/closing brackets/parentheses/quotes before entering any content. I type both the opening and closing, then left arrow, and enter the inner content (then right arrow, if needed). If I abandon this construct to refactor out some complicating subexpression, then at least this expression will be syntactically complete on its own.


I have many others, but would like to hear others tips as well.

nikkiH
10-12-2005, 08:37 PM
comments are your friends
there is no substitute for good naming conventions
each function does ONE thing (procedural coding basic for good code) and it is encapsulated in "black box" fashion
avoid global variables when at all possible. If it isn't a pseudo-constant, you probably don't need it to be global.


 

TOP

For more info

setting a minimum size
Auto Preview of Image 
Refresh with a query s
JS Validation obsolete
Javascript Pop up func
Slide show transitions
I'm a newbie...please!
how to write coding in
Advanced Debug Info 
.js file doesn't work 

News Archive

Adding Graphic To Text
re-direct form after s
pop up window controls
Clock on homepage - He
passing a param from a
Password Procection wi
document.title in same
focus onload 
Counting Wrong from Ri
Help needed on how to 

Related stories:

validate using ONSUBMIT vs ONUNLOAD
data from forms
Cross-Browser Menu Now Working, BUT Now Have FireFox Refresh Loop
How to excecute 2 different form validation Java scrpt with 1 submit button ?
I want to Resize frames on a button click
Need Cross-Browser Capable Menu / Script - event.srcElement to getElementById
Simply splitting a date up?
Link Extractor Mod to Get Page Domains

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics