The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
Then my original answer still stands, depends on what I'm doing.
Writing a new feature requires less testing than the testing of that feature and fixing bugs
The writing to testing ratio depends on the feature.
If it's a front-end thing I like to add a line of HTML/CSS and then check how bad I messed up in the browser (but this doesn't require recompiles).
When doing back-end code I can better predict what my code will do and I can test the entire thing in one go when I'm done.
Seriously, no. What I'm writing is always connected to a single issue (new feature or bug fix), which makes it somehow monolithic, and for that easy to fix (because a single bug may open a chain effect, but also closes it)...
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
Years (decades) ago, we had a new guy on the team learning to program. One day he turned to everyone in the room and complained that no matter how many times he compiled his program, it still wouldnt work.
I seem to compile about every five lines of code on average!
In the old days I remember writing an application in C that was over a thousand lines of code. I wrote it all first (with a couple of saves), compiled clean on the first try, tested it and... it needed no editing before going to production!
Ah, the good old days when I could plan and keep an entire program in my head.
- I would love to change the world, but they won’t give me the source code.
Back when I started, the answer would be 'every fortnight'. It took that long for your coding sheets to be sent away, mispunched, and a program listing with error messages to be sent back. So, you'd rewrite the mispunched rows, sent it off, wait a fortnight to see if it had been repunched correctly. Sometimes it would take a couple of months before you got a program that was what you had written. Then you can move on to the next stage. Needless to say, desk dry running was a lot more rigorous - a potential bug found at that stage could save weeks of waiting. The problem with this is that you tended to put too much code into each iteration, so when you got anything usable back, there were too many places to check (and it was so long ago when you wrote it that even the copious comments weren't helpful.
That habit has been hard to break. Even when we punched our own cards and submission / turnround times were only a few days, compiling was seen as a milestone (or a millstone).
I had to train myself to write small blocks of code, test, write the next bit, test, repeat ad nauseum.
Fortnight? goo! In school it was drop the deck off ( we punched our own ) ( and drew lines on top as "hex marks" ), and pick up the printout next day or so. ( Of course, waiting a fortnight would have made class _difficult_. )
When I started work, we had ( Bruce and I ) the machine to ourselves. I atemped to compile about 3 times - about 10 lines of Fortran. Failed in the library. Found that no-one else had any luck with the compiler yet either. ( PDP11, 16K WITH the integer multiply / divide unit ).
Still punching cards, but no compile, assemble, test, ( CPU switches and lights ) sometimes patch at the CPU.
Depends on what I'm doing. If I'm doing layout/markup, it's very often. If I'd doing c# code (models, viewmodels, other stuff), intellisense kleeps me from doing stuff wrong up front, so the act of compiling is much much less frequent, and I only start compiling when I feel like a code compenent is ready to test.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
No but seriously, I compile anytime I make a significant change or fix a bug. My app right now is on Build 1017. Been developing this one for about 12 months. I think that works out to an average of 4 compiles per business day. However I say I would only work on the app half the time so when i'm working on it, like 8 compiles per day!
I think its significant that you mention language.
I think which language (build tools, etc) a person is using makes a big difference.
And the size of the project -- how long it takes to compile it -- back in the day when computers were slower this had more of an impact.
You write the code, evaluate it, run it, see what is wrong and then try it again.
That all depends upon how long it takes to run the project again. If it takes 30 minutes then you probably write more code and then try it. If it takes seconds to run it again, you probably write one line of code and try it.
If it takes seconds to run it again, you probably write one line of code and try it.
Under that premise I am currently doing this by every small closed function I program, to test if it does what I want to achieve (unless things that are pretty obvious and then I cumulate until next "Let's see"). Executables are less than 1 Mb, so the only F5 that takes a bit more is the first of the day.
When working on PLCs I programmed full units / sequences before transferring for the first time. Not so many "Test" options there...
I remember one project... the customer was already getting nervous because it was T-3 weeks to deadline and the machine had never moved until that moment. One day I said... ok, I am so far.
Transferred PLC and Robot. Two more days teaching all the motion points in the robot. 2 days testing / fixing. 1 day to let the operators test the process. One day with the official protocols... Finished 1,5 weeks before deadline, which I used to do the training and so on. The customer just flipped out (and apologized to me for the stress). My trainee was like
I whish I had that more often...
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
Sometimes, incremental with small changes. Most of the time, however, when quite a lot has changed. In general, however, 'quite a lot' is compartmentalized in a single function (method, class, whatever) - so I know where to go.
And the compiler will usually give me a hint.
But mostly, I work on a shadow copy of the production code. Identical in all respects (i.e., copied directly from it) so I don't cause harm to production. When all is well then I copy the shadow files to the production analog. Internally, they actually reconfiguration themselves during compile (or execution for scripting languages) - a sort of self-awareness based simply on the file checking it's own name.
So - I can fearlessly go where I have probably have gone before - although it was in a different place.
Frequently, especially if the syntax for something is tricky (gives a stern look at C++ templates). I also tend to iterate a lot, given that our products are complicated and mistakes in the 'plumbing' aren't always easy to find.
At my current workplace, there is one hard rule: You do not commit any code to the code base unless it compliles cleanly! So the question comes down to: How often do you commit?
In earlier jobs, I was used to committing when a module was reasonably completed and tested. You wouldn't find very many updates to each file. So when I switched jobs about ten years ago, it came as a surprise to me when my colleagues couldn't understand why I hadn't comitted that code change I had made before luch - they wanted to verify that it wouldn't break their code. I was frowned upon if I didn't make commits at least several times a day. Sometimes, a colleague could hang over my shoulder to see me type in the code, compile it and commit it, before going over to his own desk to check out my new code.
I quickly learned that as the appropriate working mode in this company. But I am not going to defend it as an absolute rule. Not even as a main one. And you wouldn't believe the amount of processing power required when 100+ developers commit a dozen times a day, and each commit triggers a backend complete rebuild, module testing, linking and integration tests of the entire system.
The documentation guys, too: For a while, they had a system that rebuilt all the volumes of all the variants of the documentation at every commit - a job requiring more than an hour of CPU time on our fastest build agent. The technical writes had made a habit of committing for every paragraph they changed. We forced them to restructure their builds so that an edit only rebuilt the volume with the changed paragraph, and later only to those variants of that volume where the paragraph actually occcured. Still, the doc guys had to get their own multi-CPU blade server to get their jobs through fast enough.
Last Visit: 14-Nov-19 9:15 Last Update: 14-Nov-19 9:15