??? 12/11/08 03:37 Read: times Msg Score: +2 +2 Good Answer/Helpful |
#160833 - My two cents Responding to: ???'s previous message |
I've spent over half my life programming in assembler - do I do it now? Only if I have to. In the early days of compilers I was continually comparing the compiler emitted code with mine and patting myself on the back with how smart I was beating the compiler. Now I only resort to looking the the emitted code if I have a performance issue or code problem. On larger projects the compiler can start to gain ground in regards to code size. I write my code in a simple and structured way so that I minimise defects, whereas the compiler can be a little smarter and do things differently depending on the situation. It can also look at variable usage etc and do specific optimisations and do this in seconds - for me this would take a long longer and most likely be error prone. It seems many of us here are 'professional' in that we do it for a living. I would think that for most of us the highest priority in writing code is to have it work and as defect free as possible. For the most part, speed is probably not an issue for most of the code (in Erik's case where he's refreshing led displays, speed would be a consideration!) nevertheless having small and fast defect ridden code is not a good thing. I think my boss would be more impressed by code with little or no defects vs code that is x% smaller/faster.
Two books that gave me good insight into programming are: Code Complete Writing Solid Code They give some pretty compelling arguments regarding how your write code. |