🔒 Locked
Confidence in programming...
Advertisement
Original Post
I have been reading Code Complete, and other similar books, and have been re-evaluating the habits I've formed over the years. I was wondering what the saving/compilation rates where of the more advanced programmers. Meaning, how often to you find yourself saving source files and compiling them? Do you find yourself compiling after each routine just to verify that it is working as intended? Or are you confident enough in your coding ability to where you don't really compile often? I'm not going to lie, I still find myself compiling/test even after a few blocks ( or even lines!! )at times just to reassure myself--which I've come to understand is the mark of a trial-and-error ( read : juvenile/ineffective ) programmer. Are there any other habits you practice that show the presence ( or lack of ) coding confidence? Thanks, ahayweh
Lol
Im ctrl+shift+s addicted. Every few lines I tap it so that my code is saved. In fact I tap it often in notepad (where it doenst work!) and other programs just to be shocked when I realise its not working.
as for compiling I do it after each "idea". If I am building an entire class I might write its skeleton until I press compile. If im working on a specific method and rebuilding it as i write it I tend to compile more often.
Usually compiling is just to make sure I got the correct syntax (specilly when I dont have intellisense).
Yours Truly
K
Im ctrl+shift+s addicted. Every few lines I tap it so that my code is saved. In fact I tap it often in notepad (where it doenst work!) and other programs just to be shocked when I realise its not working.
as for compiling I do it after each "idea". If I am building an entire class I might write its skeleton until I press compile. If im working on a specific method and rebuilding it as i write it I tend to compile more often.
Usually compiling is just to make sure I got the correct syntax (specilly when I dont have intellisense).
Yours Truly
K
When I start a new class I usually wait until i reach a compilable state :-)
Usually I lack of concentration skills (a problem I have in general) and do compile often just to be sure I'm not doing things completely wrong.
I mean, if I'm changing some code that is supposed not to modify the program behaviour, the if the code is not trivial I always compile often to check I'm not doing very bad things (recovering too late is always more hard than Compile & Run :-)
This aside, I have your same feelings, that this habit is an heritage of a wrong coding style...
Usually I lack of concentration skills (a problem I have in general) and do compile often just to be sure I'm not doing things completely wrong.
I mean, if I'm changing some code that is supposed not to modify the program behaviour, the if the code is not trivial I always compile often to check I'm not doing very bad things (recovering too late is always more hard than Compile & Run :-)
This aside, I have your same feelings, that this habit is an heritage of a wrong coding style...
I save often (it marks the transition from a "write code" mental state to a "plan code" one). I often write several hundreds of lines (half a dozen classes and twenty or thirty functions) in-between compiles. Most of the errors my compiler comes up with are petty typing errors (like std::strign), with the occasional missing typename or namespace qualifier someplace or another.
Sometimes I'll do a quick build just to see what complains about my changes. Think of it as "breadth-first" code modification. Other times, though, I'll just fully implement whatever I'm working on and chase down errors in the order they come up in the output.
Oh, and I too am a habitual "saver". I regularly hit Cntl-S instead of enter on Google when doing a search. I quickly realize that I didn't intend to save the webpage, though.
Oh, and I too am a habitual "saver". I regularly hit Cntl-S instead of enter on Google when doing a search. I quickly realize that I didn't intend to save the webpage, though.
For me, it varies how often I compile. But I usually find that I compile after a complete chain of thought is coded. I program in a very logical order (still use flow charts before writing the code). As I complete each step in the progression, I compile to make sure that each step is working before I code further. Makes it easier for me to debug as well.
As for how often I save ... let me put this way ... if you were watching me type code, you would think that "; ALT F S" is the correct syntax for ending a C++ statement.
As for how often I save ... let me put this way ... if you were watching me type code, you would think that "; ALT F S" is the correct syntax for ending a C++ statement.
lol. It's good to hear that there are more pathological savers out there. I have decided to start consciously holding off redundant/unnecessary compilations. It just something about seeing 0 warning 0 errors that is reassuring ( like a pat on the back ). My problem is not only do I compile, but I link and run as well ( just to check to syntax errors... )
This has little to do with confidence, more with practicality.
When there were terminals and punch cards, you couldn't just randomly punch keys and hope for the best.
- You'd write the algorithm.
- You'd pass it to programmer, who'd punch the keys and drill holes in 200 paper cards
- Then you'd mail that to the computing center
- In 3 days you'd receive a response ( R17=0. R16=5. ERR )
And after going through the punched cards, reading the binary code, you'd realize the programmer mis-read your period for a comma, causing a program error.
This would of course take 3 more days to find, and re-submittal would take another 3 days.
Real-time compilation is great. This makes Java and C# IDEs such great tools. They do make you lazier, but ultimately also more productive.
When there were terminals and punch cards, you couldn't just randomly punch keys and hope for the best.
- You'd write the algorithm.
- You'd pass it to programmer, who'd punch the keys and drill holes in 200 paper cards
- Then you'd mail that to the computing center
- In 3 days you'd receive a response ( R17=0. R16=5. ERR )
And after going through the punched cards, reading the binary code, you'd realize the programmer mis-read your period for a comma, causing a program error.
This would of course take 3 more days to find, and re-submittal would take another 3 days.
Real-time compilation is great. This makes Java and C# IDEs such great tools. They do make you lazier, but ultimately also more productive.
Just for you people with wrist pains: Saving is Ctrl+S.
Ctrl+Shift+S is normally "save as" and Alt-F-S is probably a bit hard on your hands ;-)
Of course, you could always use emacs: Ctrl+X-Ctrl+S or vim (god knows what, probably escape :w or something - I'm just guessing here!) if you intend to punish your yourself :P
But yeah, I'm saving every time I breathe too. I almost exclusively recompile when I want to run the program. A decent IDE such as NetBeans does all checking in real time anyways.
Ctrl+Shift+S is normally "save as" and Alt-F-S is probably a bit hard on your hands ;-)
Of course, you could always use emacs: Ctrl+X-Ctrl+S or vim (god knows what, probably escape :w or something - I'm just guessing here!) if you intend to punish your yourself :P
But yeah, I'm saving every time I breathe too. I almost exclusively recompile when I want to run the program. A decent IDE such as NetBeans does all checking in real time anyways.
I also compile much too often. Not only that, I will make a back up of my project, it will be called "Junk" and then the project name. I will edit the "Junk" file, until I have made a fully functional upgrade to the program, and save the "Junk" file as the normal file itself, and then continue editing the "Junk" file with my next idea. Also, if the idea I am currently working on is huge and there are many things I need to implement before it is ready, I will save "checkpoint" files, as I go through the idea. Every time I complete a vital section of the idea, I will save it as "CP", which means checkpoint, and then a number corresponding to the checkpoint number it is, and then the file name. When the complete idea is coded, I'll re-save the "Junk" file to the normal file, and delete all the "CP" files. I do this so I don't have to go back to the very beginning of the idea if I mess up horribly in the middle of the idea. I am a very unconfident programmer, and fear dysfunctional code. My worst fear is having to rewrite an entire program.
Quote:
Original post by Guhill
I also compile much too often. Not only that, I will make a back up of my project, it will be called "Junk" and then the project name. I will edit the "Junk" file, until I have made a fully functional upgrade to the program, and save the "Junk" file as the normal file itself, and then continue editing the "Junk" file with my next idea. Also, if the idea I am currently working on is huge and there are many things I need to implement before it is ready, I will save "checkpoint" files, as I go through the idea. Every time I complete a vital section of the idea, I will save it as "CP", which means checkpoint, and then a number corresponding to the checkpoint number it is, and then the file name. When the complete idea is coded, I'll re-save the "Junk" file to the normal file, and delete all the "CP" files. I do this so I don't have to go back to the very beginning of the idea if I mess up horribly in the middle of the idea. I am a very unconfident programmer, and fear dysfunctional code. My worst fear is having to rewrite an entire program.
VERSION CONTROL !!!!
Quote:
Original post by Antheus Quote:
Original post by Guhill
I also compile much too often. Not only that, I will make a back up of my project, it will be called "Junk" and then the project name. I will edit the "Junk" file, until I have made a fully functional upgrade to the program, and save the "Junk" file as the normal file itself, and then continue editing the "Junk" file with my next idea. Also, if the idea I am currently working on is huge and there are many things I need to implement before it is ready, I will save "checkpoint" files, as I go through the idea. Every time I complete a vital section of the idea, I will save it as "CP", which means checkpoint, and then a number corresponding to the checkpoint number it is, and then the file name. When the complete idea is coded, I'll re-save the "Junk" file to the normal file, and delete all the "CP" files. I do this so I don't have to go back to the very beginning of the idea if I mess up horribly in the middle of the idea. I am a very unconfident programmer, and fear dysfunctional code. My worst fear is having to rewrite an entire program.
VERSION CONTROL !!!!
QFE!
Wow, Some of you are truly nuts! Either that, or you need better tools.
I save once --- when Visual Studio asks me to on exit. My computer has crashed and lost power unexpectedly before but I have never had a problem of losing data. How? It's called using the auto-save feature.
As for compiling, Visual C# performs automatic compiling for its intellisense, so I only compile when I need to run my program and otherwise depend on the editor to let me know when something is not correct.
I save once --- when Visual Studio asks me to on exit. My computer has crashed and lost power unexpectedly before but I have never had a problem of losing data. How? It's called using the auto-save feature.
As for compiling, Visual C# performs automatic compiling for its intellisense, so I only compile when I need to run my program and otherwise depend on the editor to let me know when something is not correct.
I use Visual C#, which has autocomplete for names and types, and automatically highlights syntax errors when you type them, so I have little need to compile regularly.
Edit: Wow, dejavu.
Edit: Wow, dejavu.
Wow, call me a bit different here, but im of a completely different mind on the matter. I will code 1 class or CRITICAL function before each compile (unless its really painstakingly simple code like a windows process or button handler, etc). I also code them so that they can each be performed as a unit test and profiled, this way I have the confidence that a particular critical function or class works just as expected. And while this does take a bit of time, it would take alot more time in my mind to find the obscure bug caused by forgetting something important before moving on, only to have it show up months later.
I'm writing my code in the TDD way. I have to build & run often. My tests run automatically as a post-build step, so that failures in my unit tests show up just as if they were compiler errors.
As for saving... Well, I canceled the save-as dialog four times while writing this message - I'm a CONTROL+S addict... ;)
As for saving... Well, I canceled the save-as dialog four times while writing this message - I'm a CONTROL+S addict... ;)
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement