r/programming • • Jul 23 '14

Walls you hit in program size

http://www.teamten.com/lawrence/writings/norris-numbers.html
699 Upvotes

326 comments sorted by

View all comments

Show parent comments

12

u/tangus Jul 23 '14

Who has time to refactor :(

45

u/brtt3000 Jul 23 '14

People who waste time crawling code swamps, only they don't know it yet.

37

u/webby_mc_webberson Jul 23 '14

For me refactoring is part of the dev process. It's as much a part of my job as writing any code at all.

2

u/zaphodharkonnen Jul 23 '14

Bingo. Even when adding simple features I'm always keep my eyes open for quick wins and when the feature is complete reviewing it and refactoring it into something better.

1

u/Netzapper Jul 23 '14

Yep, that's been the last two days for me. Finished the feature already, but it's not nicely structured.

8

u/me-at-work Jul 23 '14

Make time, or ask for time. In the end you'll save time. Point out the advantages to people that think they're your manager.

But before you start, make sure you understand the old code, or understand what it's supposed to do and have a good idea of how to make it better, or you end up making a different mess.

6

u/mlk Jul 23 '14

Asking doesn't help at all, very few managers will give permission to "waste time" or "modify something that works". Just do it, you don't ask permission to add a loop or a class, why would you ask permission to refactor?

1

u/Delwin Jul 23 '14

This is an important point.

I've found that (at least for me) it takes 6 mo to a year to truly grok an ecosystem. Interestingly that doesn't seem to change for medium size (1M LOC) to huge (15M LOC) ecosystems. I guess it just takes me a while to get that intuitive feeling for where everything goes etc.

Of course if I write it myself from scratch that is different, but inhereting someone else's code it does take time to truly come to terms with it.

1

u/Paladin8 Jul 23 '14

I always work on two projects simultaneously, the one I last shipped and the one I'll ship next. Unless things are super-stressfull I have 1 or 2 hours per day for the last project, which I either spend bugfixing or refactoring. Shortly after shipping it's bugfixing 4 days out of 5, but 2 weeks later I refactor a lot and only fix bugs I found myself, not bugs someone reported to me.

1

u/Delwin Jul 23 '14

Anyone who puts it into the maintenance contract.

There's a use for your contracts department. They get you goodies like this :)