Click here to Skip to main content
15,915,508 members

Survey Results

Do you optimise your code?   [Edit]

Survey period: 29 Nov 2004 to 5 Dec 2004

Do you optimise your code for speed, size or resource use? Or do you just let it all hang out?

OptionVotes% 
Yes, all the time27219.22
Yes, whenever I have the time or resources42930.32
Only when it's critical I do so45131.87
Occasionally1319.26
Never: I have no time or resources332.33
Never. What's the point?211.48
Never. I've never learned how.785.51



 
GeneralRe: Stack Overflow Error! Pin
Hambik30-Nov-04 23:49
Hambik30-Nov-04 23:49 
GeneralRe: Stack Overflow Error! Pin
avtar30-Nov-04 18:55
avtar30-Nov-04 18:55 
GeneralRe: Stack Overflow Error! Pin
Hambik30-Nov-04 23:47
Hambik30-Nov-04 23:47 
GeneralRe: Stack Overflow Error! Pin
HammerBlade1-Dec-04 1:32
HammerBlade1-Dec-04 1:32 
GeneralRe: Stack Overflow Error! Pin
Kastellanos Nikos1-Dec-04 2:47
Kastellanos Nikos1-Dec-04 2:47 
GeneralMaximum Efficiency and Minimum Resource Utilization Pin
sreejith ss nair29-Nov-04 21:14
sreejith ss nair29-Nov-04 21:14 
GeneralRe: Maximum Efficiency and Minimum Resource Utilization Pin
Ravi Bhavnani1-Dec-04 8:01
professionalRavi Bhavnani1-Dec-04 8:01 
GeneralRe: Maximum Efficiency and Minimum Resource Utilization Pin
Jeff J1-Dec-04 10:18
Jeff J1-Dec-04 10:18 
Ravi Bhavnani wrote:
Even at the expense of readability? I suggest (a) first get it to work (2) then make sure the code's readable and finally (3) optimize for speed and resources.

I completely agree with your priorities, and FWIW, don't think Sreejith intended to imply ignoring readability, but was just emphasising that we should try to reach step #3.

And that's what concerns me about what some of our coworkers don't do. By nature, especially under time pressure, we often don't reach step #3, and all too often not even step #2! Once something works, the pressure to move on is strong, and it's often rare that we have the time, let alone remember, to go back and tidy things up.

I'm sure many of us do the following intuitively, but for those that don't, this is my more verbose description of the same priorities:

.1) Give a moment's thought to how to organise the code for reasonable efficiency.

.2) While coding, ensure names are understandable to one's self and others, and comment what less obvious ones are for (this discipline does not waste time, since it saves enourmous amounts of time in the long run).

1) Get it to work.

1.1) While pondering how to make changes (for efficiency or just to get things working), write your thoughts out in a comment. This seeming annoyance can actually save time, since one is forced to describe the situation, which clarifies thoughts).

2) Make sure the code is readable. If steps #.2 and #1.1 were actually done, there's little to do here.

3) Optimize for speed and resources. If step #.1 was done, this step is much, much easier, and often a lot less needs to be done. If forced to skip this step or forgot about it, there will still be fewer rants from quality control, bosses, and users.

Just my 50 cents worth...;)
GeneralRe: Maximum Efficiency and Minimum Resource Utilization Pin
sreejith ss nair1-Dec-04 16:16
sreejith ss nair1-Dec-04 16:16 
GeneralRe: Maximum Efficiency and Minimum Resource Utilization Pin
diilbert2-Dec-04 9:46
diilbert2-Dec-04 9:46 
GeneralRe: Maximum Efficiency and Minimum Resource Utilization Pin
Ravi Bhavnani2-Dec-04 17:21
professionalRavi Bhavnani2-Dec-04 17:21 
GeneralEmbedded scandal! Pin
Bamaco229-Nov-04 11:57
Bamaco229-Nov-04 11:57 
GeneralRe: Embedded scandal! Pin
dr.justice29-Nov-04 19:52
dr.justice29-Nov-04 19:52 
GeneralOptimize for readability! Pin
Bamaco229-Nov-04 11:27
Bamaco229-Nov-04 11:27 
GeneralRe: Optimize for readability! Pin
sreejith ss nair29-Nov-04 21:16
sreejith ss nair29-Nov-04 21:16 
GeneralRe: Optimize for readability! Pin
Daniel Petersen3-Dec-04 4:01
Daniel Petersen3-Dec-04 4:01 
GeneralRe: Optimize for readability! Pin
Bamaco23-Dec-04 12:19
Bamaco23-Dec-04 12:19 
GeneralWhen it's needed.... Pin
Shog929-Nov-04 10:40
sitebuilderShog929-Nov-04 10:40 
GeneralRe: Very often required for embedded code. Pin
Jeff J29-Nov-04 6:48
Jeff J29-Nov-04 6:48 
GeneralGggggggggggggg... Pin
Kochise30-Nov-04 4:25
Kochise30-Nov-04 4:25 
GeneralNever, because...... Pin
Thomas Latuske29-Nov-04 6:48
Thomas Latuske29-Nov-04 6:48 
GeneralRe: Never, because...... Pin
Jim A. Johnson29-Nov-04 7:08
Jim A. Johnson29-Nov-04 7:08 
GeneralRe: Never, because...... Pin
Thomas Latuske29-Nov-04 7:27
Thomas Latuske29-Nov-04 7:27 
GeneralAll the time, or on a second pass at a minimum... Pin
James R. Twine29-Nov-04 5:01
James R. Twine29-Nov-04 5:01 
GeneralRe: All the time, or on a second pass at a minimum... Pin
patnsnaudy29-Nov-04 8:49
patnsnaudy29-Nov-04 8:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.