Alright, I'm thinking about rewriting my OS.
I started about 2 weeks ago, and to be honest, I didn't really have a crystal clear plan on how'd I go, and the steps. But now that I have a extremely basic operating system with a CLI and such, with basic program loading, exception handling, dumping etc, I have a much better idea on how things should be.
I think not knowing how things will be will cause a bad foundation, and building on top of a bad foundation is asking to fail, IMO.
Over the time I've been devving, I've gained knowledge and stuff that I didn't have before, and I realize now, that my code is getting somewhat redundant and harder to maintain the more I add stuff.
I'm thinking about restarting, because honestly, 2 weeks is not much, and now that I have a clearer vision, I think I can implement things in a more orderly and efficient way.
Any ideas on restarting, or any people have restarted a project? Opinions please.
Restarting a project
- supershirobon
- Posts: 5
- Joined: Sun Feb 10, 2013 10:03 am
- Location: Japan
Restarting a project
己は汝の空虚なる友
Re: Restarting a project
Hi,
This is a natural and unavoidable cycle - the knowledge and experience you gain while writing "version n" can be used to write a "version n+1" that has better code and/or has increased scope. There's only 4 ways to break the cycle:
For example, if your existing code doesn't support multi-CPU, then you might want to slap some crappy multi-CPU support into the existing code (it doesn't need to be good), just to gain knowledge and experience that can be used in the next version of the OS. For another example, you might want to design an interface (function declarations, API, whatever) for a complex/high performance/scalable physical memory manager and then just implement a "quick and dirty" simple physical memory manager that uses this interface, so that later on you can replace the physical memory manager with something better (without touching any code that relies on the physical memory manager's interface).
Cheers,
Brendan
If you restart, what will prevent you from learning more while writing the new version and then wanting to restart again in another 2 weeks?supershirobon wrote:Any ideas on restarting, or any people have restarted a project? Opinions please.
This is a natural and unavoidable cycle - the knowledge and experience you gain while writing "version n" can be used to write a "version n+1" that has better code and/or has increased scope. There's only 4 ways to break the cycle:
- be happy (learn to accept code that is worse than you are capable of now)
- be stupid (don't learn anything or gain any experience, so that you're not capable of doing better next time)
- be perfect (almost impossible)
- be prepared (risk minimisation)
For example, if your existing code doesn't support multi-CPU, then you might want to slap some crappy multi-CPU support into the existing code (it doesn't need to be good), just to gain knowledge and experience that can be used in the next version of the OS. For another example, you might want to design an interface (function declarations, API, whatever) for a complex/high performance/scalable physical memory manager and then just implement a "quick and dirty" simple physical memory manager that uses this interface, so that later on you can replace the physical memory manager with something better (without touching any code that relies on the physical memory manager's interface).
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: Restarting a project
Be happy sounds like a good way, although I prefer the (unlisted) option of "accept non-optimal code, perfectionism won't get you anywhere". If something is less than optimal, you don't throw it all out, but implement a better algorithm incrementally. In the end you will reach similar functionality and code quality, but in far shorter time.
In order for incremental changes to work the code must be written in a good way (isolation and clean interfaces), and if you have a lot of badly written code you will need to start over again instead. Learning to develop with incremental changes requires better code quality, which makes for less bugs (a positive feedback loop).
For a OS project with only 2 weeks of work I'd say just go for a rewrite. It really doesn't matter in that case.
In order for incremental changes to work the code must be written in a good way (isolation and clean interfaces), and if you have a lot of badly written code you will need to start over again instead. Learning to develop with incremental changes requires better code quality, which makes for less bugs (a positive feedback loop).
For a OS project with only 2 weeks of work I'd say just go for a rewrite. It really doesn't matter in that case.
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: Restarting a project
Well said, except I'd go with "be good enough" as the third option.Brendan wrote:There's only 4 ways to break the cycle:
- be happy (learn to accept code that is worse than you are capable of now)
- be stupid (don't learn anything or gain any experience, so that you're not capable of doing better next time)
- be perfect (almost impossible)
- be prepared (risk minimisation)
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
Re: Restarting a project
I don't mean to sound rude, but is there really so much to re-write after just two weeks of development? I think, that a code base started two weeks ago would still be malleable. Though, it may be just me - I don't consider myself a very fast programmer.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Restarting a project
I can very well imagine several situations that you want to throw away code that you've just completed. It doesn't even need two weeks:
I've had two full rewrites since I started, and typically every component I add gets written twice: once to see how it works, and once to make it maintainable.Michael Abrash wrote:In fact, I’ll take this opportunity to coin Carmack’s Law, as follows: Fight code entropy. If you have a new fundamental assumption, throw away your old code and rewrite it from scratch. Incremental patching and modifying seems easier at first, and is the normal course of things in software development, but ends up being much harder and producing bulkier, markedly inferior code in the long run
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: Restarting a project
Sometimes you don't really know what problem it is you're really solving until you get your hands dirty with it.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]