3 ms·
Throw away your first draft of your code
- 8chanAnon 3y agoMaybe it's different when working with a team but I've never thrown away code. It's not that I'm so smart that I get it right the first time but there's usually a lot of little bits of housekeeping code that goes along with the package that it doesn't make much sense to just throw it all away. Refactor the parts the don't work as well as intended. Maybe rethink the overall structure and reorganize it. But just throwing it all away? That's like gutting a house because you forgot that the bathroom needs a toilet.
- simonblack 3y agoOtherwise known as "Build one to throw away". The article is good as far as it goes. Yes you do start off knowing nothing about a project. Along the way you run into roadblocks, and you learn something when you work your way around those roadblocks. Then you strike another roadblock, and work your way around that one too. Rinse, repeat. By the time you're a good way into the project, you will probably think "I should have done all that foundational work at the start differently". It's often said that you should build three houses before you get the basics right enough. Been there, done that. I built one large, expensive house. Made so many mistakes that I won't do that again. Hence the reasons behind 'Build one (cheaply!) to throw away." We all should have a 'pet project'. That's a project you do for fun and learning. Every now and then you haul that project out and rewrite it from scratch. You may rewrite it in a new programming language or two, thus adding whole languages with their good bits and 'gotchas' to your repertoire. You may rewrite it several times so that your project changes at every stage from being a plain old text-based project that writes to a terminal, to one using curses and different ways of writing and displaying stuff on a 'panel', to being a GUI-based project using GTK+ with call-backs, bitmaps and idle-timeouts.