|
I've known plenty of developers who were afraid of touching code.
A new feature was always "glued" to already existing code, no matter if it fit.
The result is almost always some Frankenstein's monster.
I say, we have source control so we can always roll back or see how it was.
We have advanced developer tools showing us where what code is used.
Just rewrite the thing if necessary and make sure you test well (unit tests, if possible, and manual tests).
Never forget to manual test everything you've touched.
I know some developers don't manual test because "that's a tester's job".
In the end it's my code and I'm responsible for it.
I'm the master of my code (even if I inherited it) and not the other way around.
|
|
|
|
|
The last few years I've acquired responsibility for a number of our products that were written by someone else now laid off, retired, dead, or some combination thereof. One of the earliest lessons I learned in this is: If you want to get back to your real job, and the code you wrote:
Don't. . With. It.
Don't rewrite bits you don't like, don't reformat the code to your style, don't refactor unless it's part of fixing the bug. Once you start down that path you look up one day to find you're the schmuck who works on all the old crap. You're also bitter and depressed from looking at poorly-written shït all day long, and the temptation to just fix it becomes irresistable.
I spent over 200 manhours a couple of years ago debugging some embedded code, parts of which had been around since the mid 1990's. Ultimately I found and fixed a bug in the TCP/IP stack we'd bought from a third party in 1995. The fix was about 20 lines of code. I probably could have rewritten the whole ing thing in six months, but then it would have been mine forever.
Software Zen: delete this;
|
|
|
|
|
I'd say fear of breaking code is the symptom. The cause is not being able to read, synthesize, and understand what the code is doing in order to introduce a new mechanism which is stronger/more efficient/more readable/whatever your reason for refactoring is.
Sometimes, that's understandable due to a system being horrifically designed and having layers of dependency (the old house-of-cards or ball-of-mud syndrome). It's tough to refactor one piece of data when it's put into session and potentially used anywhere in the application, for example.
A lot of the time, though, it's simply due to hiring bad developers. Some people simply don't have the horsepower to do serious analysis.
|
|
|
|
|
I think you are simplifying pretty badly there. It doesn't take incompetence or lack of foresight or anything of that nature to get to this situation. It only requires the realities of commercial development where people leave the company and take their knowledge with them, where just keeping up with the competition and customer requirements takes all your time plus some, etc...
Explorans limites defectum
|
|
|
|
|
A-flipping-men. The whole team, stakeholders/management to BAs to PMs to devs to testers to power users to end users need to be more courageous in this regard. Preach it. Take risks.
|
|
|
|
|
A colleague was just rewriting some code that broke due to new/different behavior in an updated JVM. He was nervous about doing it since it was a critical function, but it had to be done.
I recommended that he enumerate all of the affected classes (hundreds) and dump the state with the old JVM. Apply the update and code changes and dump the state again. If there really was no impact, the before and after would be the same.
This is a typical practice that I do all of the time when refactoring to add a feature. The refactor should NOT change the results at all. Once the refactor is complete, then you add a new feature and you should see the expected changes.
He did that and found where his new code was producing better results because it fixed a rare but unreported issue in the older code. Now the new code can run any on either JVM and produce the same results.
|
|
|
|
|
That's only doable on certain types of software. In highly user configurable, very broad software products, there's no practical way to do that.
And of course we aren't just talking about refactoring. In many cases it will require jettisoning out of date tools that have deep roots in the code base, and/or rewriting large chunks of it that might contains really complex domain knowledge.
Explorans limites defectum
|
|
|
|
|
Unsure about "most broken", but definitely "least fixed".
|
|
|
|
|
|
Diligence work which can be theoretically done in one hour takes at the end several hours, days.... because it is only boring stuff.
New requests which needs estimated weeks, can be done in days because I'm keen on to solve it?
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
|
I've got a mix of old projects needing new features and new projects that my customers keeping coming up with. I keep having nightmares where a line of end users are waiting in front of my desk, when another comes in and breaks line to ask for another report or program tweak...a fight breaks out and I find myself paralyzed...then I wake up!
It's the new stuff that seems to take forever, mostly because there's no roadmap...unlike the rest of you, the only project specs I've ever gotten were handwritten on scratch paper or bar napkins...if I'm lucky, there might be a drawing!
Personally, I'd rather add features/fix bugs in existing projects than work on new stuff.
When asked, I always give multiply a reasonable time estimate by 3.
"Go forth into the source" - Neal Morse
|
|
|
|
|
kmoorevs wrote: the only project specs I've ever gotten were handwritten on scratch paper or bar napkins You guys are getting specs?
|
|
|
|
|
In classic waterfall (the thing before agile/nonplanning/adhoc) writing specs is the devs' work. From that, a basic design is formed, and from that, a technical design. AFAIK, agile skips that and goes directly to implementation.
Makes estimating so much harder; it's like guessing at what date you finish the book filled with sudoku-puzzles, and putting a price tag on it. That sounds a lot like gambling
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Eddy Vluggen wrote: writing specs is the devs' work That should NEVER be the devs work!
Especially in a waterfall environment, a business analyst (or more) should talk to users, stakeholders, etc. and only when it's finished hand it over to development.
In fact, if a developer strays from the written specs a tester should make note of it and either the software should be fixed or the specs should be changed accordingly by the analyst.
A developer is probably the least suitable person to write specs.
Agile doesn't skip it, it just doesn't plan too far ahead.
It's more like, let's write the specs for this particular feature.
Which features are getting specced or built next is up to the product owner who decides on priority (also with input from users and/or stakeholders).
The specs are then made into stories (or perhaps the stories make up the specs) which are estimated by the developers.
If any story isn't fully clear it goes back to the product owner who can then try to clear things up, probably by talking to the users.
In agile, you also don't estimate time, but complexity, in terms of story points.
The story should be done by the end of the sprint (usually two weeks) and every sprint can have x story points.
Estimating anything else than complexity of user stories isn't agile, it's a team trying to do agile in an otherwise waterfall company.
At least that's what I understood.
|
|
|
|
|
That's a lot of explanation in one post.
Thank you
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
|
That can work for small companies or small products or products that are your own.
When working for bigger companies and with demanding customers you can't get away with that unless you can clone yourself and work five weeks in a week
I've been there too and it has its merits
|
|
|
|
|
Is reading between the lines a good idea unless there is a train coming?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
or as the song says "...there's light at the end of the tunnel, lord I hope it ain't no train!"
They call me different but the truth is they're all the same!
JaxCoder.com
|
|
|
|
|
If you see a train coming, is it better to make tracks, or unmake them?
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
modified 11-Nov-19 11:16am.
|
|
|
|
|
Unless you have some sort of loco motive to risk injury, it just depends upon how you conduct yourself.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
You have a one track mind.
/ravi
|
|
|
|
|
Interesting train of thought, but of course you are known for your excellent track record in thoughts.
|
|
|
|
|
So, where you are the trains actually come?
|
|
|
|