Pre-code planning?
-
Of those of you who code on your own (as in not in a team), for money, pleasure or both: Do you chart out your work before you start coding? "No one knows what power lies yet undevelopped in that wiry system of mine." Ada Lovelace 1815-1852
All the time. I have proven to myself and others that the time taken to plan is more than made up for in the actual coding. I pay partiuclar attention to the API portion of the program to make sure I am getting all the information passed to me that I need and also try to plan to return all relevant information that may be needed eslewhere ( error codes, structs, pointers etc... ) Richard If you pick up a starving dog and make him prosperous, he will not bite you. This is the principal difference between a dog and a man. - Pudd'nhead Wilson's Calendar
-
Of those of you who code on your own (as in not in a team), for money, pleasure or both: Do you chart out your work before you start coding? "No one knows what power lies yet undevelopped in that wiry system of mine." Ada Lovelace 1815-1852
qomi wrote: Do you chart out your work before you start coding? Depends on what it is I'm coding. If it's a one shot deal or some other "throw-away code", or something really simple, then I don't. The more complicated it is, the more likely I am to chart out at least something. Granted, no matter how much planning you do, there's always something unexpected that crops up... like realizing that a CEditView won't hold more than 64K worth of text if you're running on Windows 98. X| The early bird may get the worm, but the second mouse gets the cheese.
-
Michael P Butler wrote: I didn't used to but as I've got older (more experienced?) I do a lot more planning and designing first. I find if I do too much though, when I get to writing the code I get bored easily That is really similar to me, when I code I mouse-click and type as fast as possible to get it over and done with. I have proved on paper and in my head that the code will work, So all I have to do is the mechanical operation of entering the code into my PC. I think Debuggers should be "banned" and then coders would learn to plan their code better. Regardz Colin J Davies
Sonork ID 100.9197:Colin
I live in Bob's HungOut now
I knew a guy who could code like that, bloody brilliant - He used to code against his own work without having locally installed at home, bring it into work on a disk or e-mail and it would almost always compile and work as intended. The only errors tended to be the odd spelling mistakes in calls etc.
-
I knew a guy who could code like that, bloody brilliant - He used to code against his own work without having locally installed at home, bring it into work on a disk or e-mail and it would almost always compile and work as intended. The only errors tended to be the odd spelling mistakes in calls etc.
Well I wouldn't call myself "bloody brilliant" It's more a case of having learnt to code on Punchcards and snail mail to the Mini that read them. And snail mail back home with the results. So I learnt to plan my code from the start and then stick to the plans like a drone carpenter would. When I find a "bug" I normally find it myself first in my charts and maps and scribbles rather than actually running the app. My biggest syntax errors are "puncuation marks" as they skip my eyesight quite often. But can you imagine a very large project that a builder would start and then finish with only an idea and no paper plans or even plans in his head? Regardz Colin J Davies
Sonork ID 100.9197:Colin
I live in Bob's HungOut now
-
Michael P Butler wrote: I didn't used to but as I've got older (more experienced?) I do a lot more planning and designing first. I find if I do too much though, when I get to writing the code I get bored easily That is really similar to me, when I code I mouse-click and type as fast as possible to get it over and done with. I have proved on paper and in my head that the code will work, So all I have to do is the mechanical operation of entering the code into my PC. I think Debuggers should be "banned" and then coders would learn to plan their code better. Regardz Colin J Davies
Sonork ID 100.9197:Colin
I live in Bob's HungOut now
I think Debuggers should be "banned" and then coders would learn to plan their code better. YOU HEATHEN!!! :) I really don't see the correlation between well planned code and debugger use. I use the debugger as a code quality tool. Even when the code has been well thought out. I practically live in the debugger making sure routines work as required. I have never understood the concept of run it, and fix it if it fails. I am always testing small core routines via the debugger and test routines. I am always making sure that the code paths are executing as I expect. I have done my time on embedded systems and older junk systems where you didn't have debuggers. I see no point to go back to self flogging. Tim Smith Descartes Systems Sciences, Inc.
-
Of those of you who code on your own (as in not in a team), for money, pleasure or both: Do you chart out your work before you start coding? "No one knows what power lies yet undevelopped in that wiry system of mine." Ada Lovelace 1815-1852
If I feel that it will take longer than 8 hours to implement the solution, or if I think someone else (other than me and my immediate peers) will be interested in the code. I usually use UML to flesh out parts of the system - state charts for systems that have a memory, sequence diagrams for behaviors, and class diagrams for the static structure. I also draw out the user interface - if there is one. Once I have all that in place I start coding based on the diagrams. I find that is saves a lot of time since the exercise of drawing the diagrams gets me closer to the problem (I gain a better understanding of the problem), so that I'm in a better position to provide a solution for it. I also prototype using HTML or even Visual Basic before I start coding the solution since prototyping makes parts of the application's look and feel visible to the client. I use prototypes to start discussions and get specific with domain experts when I'm working in a field that I'm not familiar with - it's amazing what details you can get into when you're working with a simple prototype with a domain expert! Once the solution is in place, I use the drawings to write the documentation. If I'm not writing the documentation, I pass on the drawings (which I do by hand on paper) to the person writing the documentation to reduce or eliminate my involvement in the documentation process - based on the feedback I get, the diagrams seem to help. Essam ___________________________________________ Author - JScript .NET Programming ...and a bunch of articles around the Web
-
I think Debuggers should be "banned" and then coders would learn to plan their code better. YOU HEATHEN!!! :) I really don't see the correlation between well planned code and debugger use. I use the debugger as a code quality tool. Even when the code has been well thought out. I practically live in the debugger making sure routines work as required. I have never understood the concept of run it, and fix it if it fails. I am always testing small core routines via the debugger and test routines. I am always making sure that the code paths are executing as I expect. I have done my time on embedded systems and older junk systems where you didn't have debuggers. I see no point to go back to self flogging. Tim Smith Descartes Systems Sciences, Inc.
Tim Smith wrote: I am always testing small core routines via the debugger and test routines. I am always making sure that the code paths are executing as I expect. Hmm, I suppose that is OK, But I believe a lot of coders use it to solve problems in badly written code. Tim Smith wrote: I really don't see the correlation between well planned code and debugger use. Ok, My basic belief is if you plan your code well and know your OS and Subject well, you will not write buggy code. So I have never needed to learn how to use the debugger environment yet. "I have had a play with it. And just for safety sake , I do actually build a debug version before final release and manually test it also. So I'm not a total Heathen :-) Regardz Colin J Davies
Sonork ID 100.9197:Colin
I live in Bob's HungOut now
-
Well I wouldn't call myself "bloody brilliant" It's more a case of having learnt to code on Punchcards and snail mail to the Mini that read them. And snail mail back home with the results. So I learnt to plan my code from the start and then stick to the plans like a drone carpenter would. When I find a "bug" I normally find it myself first in my charts and maps and scribbles rather than actually running the app. My biggest syntax errors are "puncuation marks" as they skip my eyesight quite often. But can you imagine a very large project that a builder would start and then finish with only an idea and no paper plans or even plans in his head? Regardz Colin J Davies
Sonork ID 100.9197:Colin
I live in Bob's HungOut now
-
Alex wrote: I take it you've never had any building work done in England. Sorry, forgive me for my ignorance. :-) Regardz Colin J Davies
Sonork ID 100.9197:Colin
I live in Bob's HungOut now
-
Always! Though I'm a lot less fromal about it than I used to be, I still start with a clear plan, even if it's only on a bar napkin.
Roger Wright wrote: on a bar napkin I hear this all the time, people scribbling some brilliant architecture onto a napkin at a bar or restauruant. Do people always bring their pencil and/or pen along with them when they go out to eat and just forget to bring along a pad of paper or something? Pencils in a pocket pokes you when you sit down and forget about it, and that hurts. And sometimes pens in a pocket leaks destroying your clothes. But I guess one could keep it in their breast shirt pocket, but then that would be too geeky and I haven't seen anyone do that in a while. Maybe this only really happens to women whom I could conceive carrying a writing utensil in their purses, but guys is another matter since there's no practical place to carry those things besides perhaps behind the ear or in the hair ;P
-
Of those of you who code on your own (as in not in a team), for money, pleasure or both: Do you chart out your work before you start coding? "No one knows what power lies yet undevelopped in that wiry system of mine." Ada Lovelace 1815-1852
For small projects where the design can easily fit into my head or if it's a small-medium sized project where I've done something very similar before then I don't do too much designing. For non-trivial products, it's usually essential unless you don't care about spaghetti code that is hard to maintain and extend. However, I almost always at the very least usually write down some candidate classes, pick which ones I think I'll be using, and write down their responsibilites and collaborators to keep my head straight. If I want to do another level of design then I'd probably take the selected candidated classes and draw the major UML architecture diagrams.
-
Tim Smith wrote: I am always testing small core routines via the debugger and test routines. I am always making sure that the code paths are executing as I expect. Hmm, I suppose that is OK, But I believe a lot of coders use it to solve problems in badly written code. Tim Smith wrote: I really don't see the correlation between well planned code and debugger use. Ok, My basic belief is if you plan your code well and know your OS and Subject well, you will not write buggy code. So I have never needed to learn how to use the debugger environment yet. "I have had a play with it. And just for safety sake , I do actually build a debug version before final release and manually test it also. So I'm not a total Heathen :-) Regardz Colin J Davies
Sonork ID 100.9197:Colin
I live in Bob's HungOut now
But I believe a lot of coders use it to solve problems in badly written code. A lot of bad programmers program in C++. That doesn't mean that C++ is bad. Ok, My basic belief is if you plan your code well and know your OS and Subject well, you will not write buggy code. So I have never needed to learn how to use the debugger environment yet. "I have had a play with it. So what do you do when the program doesn't work? Give up and start a new project? Using print statements or desk checks are different forms of debugging. Some of us just like to use tools specifically designed for helping us find problems. It is the same concept as using a memory checking package such as Rational Purify to help find memory leaks. No programmer writes perfect code the first time. The question is how efficiently do you find the imperfections and get them corrected. You might like to use print statements. I like to use the debugger. Tim Smith Descartes Systems Sciences, Inc.
-
But I believe a lot of coders use it to solve problems in badly written code. A lot of bad programmers program in C++. That doesn't mean that C++ is bad. Ok, My basic belief is if you plan your code well and know your OS and Subject well, you will not write buggy code. So I have never needed to learn how to use the debugger environment yet. "I have had a play with it. So what do you do when the program doesn't work? Give up and start a new project? Using print statements or desk checks are different forms of debugging. Some of us just like to use tools specifically designed for helping us find problems. It is the same concept as using a memory checking package such as Rational Purify to help find memory leaks. No programmer writes perfect code the first time. The question is how efficiently do you find the imperfections and get them corrected. You might like to use print statements. I like to use the debugger. Tim Smith Descartes Systems Sciences, Inc.
Tim Smith wrote: A lot of bad programmers program in C++. That doesn't mean that C++ is bad. I hadn't thought about that, Tim Smith wrote: So what do you do when the program doesn't work? Ok, I Admit first time arround I use lots of AfxMessageBoxes to make sure it runs as planned. Then I comment them out. But the more experienced I get in C++ the less times I find I have to check stuff. After a while you write stuff and just expect it to run, quite arrogantly. I admit I should change habbits and start using the debugger output instead, but I guess I have fallen into a habit. But, I assure you that I still belive planning well and researching cuts down dramatically on bugs. Many coders seem to be employed "maintaining code" this to me means it was not well written in the first instance. Sure new features arrise that need to be implimneted, and plans change. :-) Regardz Colin J Davies
Sonork ID 100.9197:Colin
I live in Bob's HungOut now
-
Tim Smith wrote: A lot of bad programmers program in C++. That doesn't mean that C++ is bad. I hadn't thought about that, Tim Smith wrote: So what do you do when the program doesn't work? Ok, I Admit first time arround I use lots of AfxMessageBoxes to make sure it runs as planned. Then I comment them out. But the more experienced I get in C++ the less times I find I have to check stuff. After a while you write stuff and just expect it to run, quite arrogantly. I admit I should change habbits and start using the debugger output instead, but I guess I have fallen into a habit. But, I assure you that I still belive planning well and researching cuts down dramatically on bugs. Many coders seem to be employed "maintaining code" this to me means it was not well written in the first instance. Sure new features arrise that need to be implimneted, and plans change. :-) Regardz Colin J Davies
Sonork ID 100.9197:Colin
I live in Bob's HungOut now
I actually agree with you that many people use the debugger as a crutch. I also agree that the better you plan, the less debugging you will have to do. As far you should start using the debugger, I really don't see why if what you currently do is working well for you. What ever works in my book. I was just arguing that the debugger isn't inherently a bad thing. That is all. Tim Smith Descartes Systems Sciences, Inc.
-
Roger Wright wrote: on a bar napkin I hear this all the time, people scribbling some brilliant architecture onto a napkin at a bar or restauruant. Do people always bring their pencil and/or pen along with them when they go out to eat and just forget to bring along a pad of paper or something? Pencils in a pocket pokes you when you sit down and forget about it, and that hurts. And sometimes pens in a pocket leaks destroying your clothes. But I guess one could keep it in their breast shirt pocket, but then that would be too geeky and I haven't seen anyone do that in a while. Maybe this only really happens to women whom I could conceive carrying a writing utensil in their purses, but guys is another matter since there's no practical place to carry those things besides perhaps behind the ear or in the hair ;P
Reno Tiko wrote: I hear this all the time, people scribbling some brilliant architecture onto a napkin at a bar or restauruant. That would go down well on a date. "Oh darling, are you writing me a poem on that napkin to express your love for me?" "No, i'm writing some pseudo code for a cool algorithm I just thought of." Simon Hey, it looks like you're writing a letter! Sonork ID 100.10024
-
Roger Wright wrote: on a bar napkin I hear this all the time, people scribbling some brilliant architecture onto a napkin at a bar or restauruant. Do people always bring their pencil and/or pen along with them when they go out to eat and just forget to bring along a pad of paper or something? Pencils in a pocket pokes you when you sit down and forget about it, and that hurts. And sometimes pens in a pocket leaks destroying your clothes. But I guess one could keep it in their breast shirt pocket, but then that would be too geeky and I haven't seen anyone do that in a while. Maybe this only really happens to women whom I could conceive carrying a writing utensil in their purses, but guys is another matter since there's no practical place to carry those things besides perhaps behind the ear or in the hair ;P
I never go anywhere without my trusty mechanical pencil - those aren't leads in there, they're my last remaining neurons:laugh: And I usually have a notebook with me, as well. My usual routine includes ordering a pitcher, practicing darts for a while, then sitting in a booth doing the things I can't do at work (ie - anything requiring thought and concentration). I pay a few bills, design an occasional program or electronic widget I need for something, review materials for a couple of charities whose boards I'm on, layout out a database or two, sketch a few web pages. Simple stuff... Dull, but without it I'd go stark raving mad* *There's another school of thought that maintains this has already happenned!
-
I actually agree with you that many people use the debugger as a crutch. I also agree that the better you plan, the less debugging you will have to do. As far you should start using the debugger, I really don't see why if what you currently do is working well for you. What ever works in my book. I was just arguing that the debugger isn't inherently a bad thing. That is all. Tim Smith Descartes Systems Sciences, Inc.
But you called me a heathen :-) Just joking, The more advanced and bigger my code base is the more likely that debugging skills will be required I guess, And AfxMessageBoxes can get painful if you accendly put one in a big loop. :-) Tim Smith wrote: I was just arguing that the debugger isn't inherently a bad thing. That is all. Actually as you can guess I agree, but I think it is the way the education system has implimented it now-days. It's in everybodys best interests that we have less buggy code circulating. Best Wishes Tim :-) Regardz Colin J Davies
Sonork ID 100.9197:Colin
I live in Bob's HungOut now
-
But you called me a heathen :-) Just joking, The more advanced and bigger my code base is the more likely that debugging skills will be required I guess, And AfxMessageBoxes can get painful if you accendly put one in a big loop. :-) Tim Smith wrote: I was just arguing that the debugger isn't inherently a bad thing. That is all. Actually as you can guess I agree, but I think it is the way the education system has implimented it now-days. It's in everybodys best interests that we have less buggy code circulating. Best Wishes Tim :-) Regardz Colin J Davies
Sonork ID 100.9197:Colin
I live in Bob's HungOut now
Hi Colin, in our company we use a class comparable to Writing trace messages in multi-threaded C++ applications. Several debug levels, warnings and so on, and they either are directed to a file or w/
OutputDebugString
to DevStudio, DebugView, or similar. IMHO that's a very comfortable way for debugging. Regards Thomas Finally with Sonork id: 100.10453 Thömmi
Disclaimer:
Because of heavy processing requirements, we are currently using some of your unused brain capacity for backup processing. Please ignore any hallucinations, voices or unusual dreams you may experience. Please avoid concentration-intensive tasks until further notice. Thank you. -
Of those of you who code on your own (as in not in a team), for money, pleasure or both: Do you chart out your work before you start coding? "No one knows what power lies yet undevelopped in that wiry system of mine." Ada Lovelace 1815-1852
That depends on the type of project I'm working on: it's size, importancy, language etc. Mostly I plan ahead when I code something big in VC++. However, I never sketch or anything while coding in VB. Actually I believe this low-level language is just for that - instant coding! You don't need to define anything serious, you can just insert variables whenever you want without prototypes. I use VB mostly for tools I do for myself - I need them to work and I need them fast! When I don't plan I just get lousy messed-up code which none the less works (and pretty quickly), but isn't very nice to update or alter later. So I guess it's a question of how important the current project is and what's it's purpose. Isaac Sasson, Small time programmer - complainer at large.
-
But you called me a heathen :-) Just joking, The more advanced and bigger my code base is the more likely that debugging skills will be required I guess, And AfxMessageBoxes can get painful if you accendly put one in a big loop. :-) Tim Smith wrote: I was just arguing that the debugger isn't inherently a bad thing. That is all. Actually as you can guess I agree, but I think it is the way the education system has implimented it now-days. It's in everybodys best interests that we have less buggy code circulating. Best Wishes Tim :-) Regardz Colin J Davies
Sonork ID 100.9197:Colin
I live in Bob's HungOut now