We know, you've stated it in this thread several times.rdos wrote:Personally, I don't want to write the same code twice, which is why I never want to start from scratch.
Rewrite from Scratch
- Griwes
- Member
- Posts: 374
- Joined: Sat Jul 30, 2011 10:07 am
- Libera.chat IRC: Griwes
- Location: Wrocław/Racibórz, Poland
- Contact:
Re: Rewrite from Scratch
Reaver Project :: Repository :: Ohloh project page
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
Re: Rewrite from Scratch
Hi,
Cheers,
Brendan
Not necessarily. There are at least 3 causes of design change:Love4Boobies wrote:That is self-contradictory. It means your design was bad. This is the very reason for which so many software design books exist.nevar wrote:I think rewriting OS is good practice at least from my point of view. I did it many times but always because of design changes.
- bad initial design - e.g. the design wasn't very good for "foo" to begin with. Everyone makes bad design decisions sooner or later (the only people who haven't made bad design decisions are people that haven't made design decisions).
- internal scope creep - e.g. the design was perfectly fine for "foo" which is all we cared about at the time; but now we want to do "bar" and the design needs to change. A simple example of this would be saying "it's only a small hobby OS, therefore I don't want to bother with Unicode and proportional fonts" and then 3 years later thinking "it's grown beyond just a small hobby OS, therefore I actually do want Unicode and proportional fonts".
- external scope creep - e.g. the design was perfectly fine for "foo" which is all we could have known about at the time; but now someone else has introduced "bar" and the design needs to change. At the moment there's probably a lot of people looking at their "it was reasonable to assume PC BIOS at the time" boot code.
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: Rewrite from Scratch
I don't see that as a valid reason to start from scratch. I went through the process to convert from "custom" 8-bit fonts to TrueType Unicode only half a year ago. I decided against wide-character codings (because that tends to pollute all character-based code in a system) and decided to use UTF-8 throughout. I even actively disabled wide-character support in OpenWatcom's RDOS libc because I didn't want to have anything to do with wide character sets.Brendan wrote:internal scope creep - e.g. the design was perfectly fine for "foo" which is all we cared about at the time; but now we want to do "bar" and the design needs to change. A simple example of this would be saying "it's only a small hobby OS, therefore I don't want to bother with Unicode and proportional fonts" and then 3 years later thinking "it's grown beyond just a small hobby OS, therefore I actually do want Unicode and proportional fonts".
Re: Rewrite from Scratch
Hi,
Where we don't agree is that I think these smaller design changes can become a larger collection that does justify a rewrite; while you think that (for an example) it would've made more sense for Microsoft to keep polishing "MS-DOS" until it becomes something like Windows 8 without starting again (twice).
Cheers,
Brendan
And I didn't say that that alone was a valid reason to start from scratch. I was replying to Love4Boobies' "design changes mean bad design" comment.rdos wrote:I don't see that as a valid reason to start from scratch.Brendan wrote:internal scope creep - e.g. the design was perfectly fine for "foo" which is all we cared about at the time; but now we want to do "bar" and the design needs to change. A simple example of this would be saying "it's only a small hobby OS, therefore I don't want to bother with Unicode and proportional fonts" and then 3 years later thinking "it's grown beyond just a small hobby OS, therefore I actually do want Unicode and proportional fonts".
Then Love4Boobies is saying that your original (ASCII, 8-bit fonts?) design was bad. Do you agree with him? I'm saying that originally it may have been good design, and "internal scope creep" happened, causing it to need redesigning. For simplicity; I'll just assume you agree with me.rdos wrote:I went through the process to convert from "custom" 8-bit fonts to TrueType Unicode only half a year ago. I decided against wide-character codings (because that tends to pollute all character-based code in a system) and decided to use UTF-8 throughout. I even actively disabled wide-character support in OpenWatcom's RDOS libc because I didn't want to have anything to do with wide character sets.
Where we don't agree is that I think these smaller design changes can become a larger collection that does justify a rewrite; while you think that (for an example) it would've made more sense for Microsoft to keep polishing "MS-DOS" until it becomes something like Windows 8 without starting again (twice).
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.
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: Rewrite from Scratch
I don't see how the fact that everyone makes mistakes is an argument for the fact that requiring a rewrite is not a sign of a good design.Brendan wrote:
- bad initial design - e.g. the design wasn't very good for "foo" to begin with. Everyone makes bad design decisions sooner or later (the only people who haven't made bad design decisions are people that haven't made design decisions).
A good design would have to be flexible enough to allow for the requirements to change over time.Brendan wrote:
- internal scope creep - e.g. the design was perfectly fine for "foo" which is all we cared about at the time; but now we want to do "bar" and the design needs to change. A simple example of this would be saying "it's only a small hobby OS, therefore I don't want to bother with Unicode and proportional fonts" and then 3 years later thinking "it's grown beyond just a small hobby OS, therefore I actually do want Unicode and proportional fonts".
- external scope creep - e.g. the design was perfectly fine for "foo" which is all we could have known about at the time; but now someone else has introduced "bar" and the design needs to change. At the moment there's probably a lot of people looking at their "it was reasonable to assume PC BIOS at the time" boot code.
Using such a font is not a sign of bad design. Inability to switch to vector fonts because of the design on the other hand...Brendan wrote:Then Love4Boobies is saying that your original (ASCII, 8-bit fonts?) design was bad. Do you agree with him? I'm saying that originally it may have been good design, and "internal scope creep" happened, causing it to need redesigning. For simplicity; I'll just assume you agree with me.
You are starting from the assumption that their designs were good when they actually weren't. They may have seemed good at the time; that's another story.Brendan wrote:Where we don't agree is that I think these smaller design changes can become a larger collection that does justify a rewrite; while you think that (for an example) it would've made more sense for Microsoft to keep polishing "MS-DOS" until it becomes something like Windows 8 without starting again (twice).
Also, notice that my main problem with that post was that the poster was advocating rewrites as a good practice.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
Re: Rewrite from Scratch
MS-DOS is the worse piece of junk ever launched, so I don't think Microsoft should have polished on it. They should have released a multitasking system to start with, not such a piece of junk as they did. MS-DOS was the primary reason why I went into OS development. My initial design goal was to write an OS that was compatible with MS-DOS, with multithreading and multiprocess support (the "r" in RDOS stands for "realtime DOS"). Because it was already in the late 80s evident that running programs in the limited real mode environment was a dead-end approach, I designed the new OS for running in 32-bit protected mode, and running DOS applications in V86 mode. Because I planned to run multiple DOS programs at the same time, it was an requirement to use paging. Segmentation was used because it was such an elegant solution for within and between modules isolation, enforced by hardware.Brendan wrote: Where we don't agree is that I think these smaller design changes can become a larger collection that does justify a rewrite; while you think that (for an example) it would've made more sense for Microsoft to keep polishing "MS-DOS" until it becomes something like Windows 8 without starting again (twice).
Re: Rewrite from Scratch
Using raster fonts at the time this was implemented was considered an acceptable design. I'm not even sure if TrueType fonts were available at that time, but at least there were no free code to use.Love4Boobies wrote:I don't see how the fact that everyone makes mistakes is an argument for the fact that requiring a rewrite is not a sign of a good design.Brendan wrote:
- bad initial design - e.g. the design wasn't very good for "foo" to begin with. Everyone makes bad design decisions sooner or later (the only people who haven't made bad design decisions are people that haven't made design decisions).
Exactly. I had no big problems changing from GFT-based raster fonts to OpenType fonts. I simply rewrote the font device-driver from scratch in C, and integrated it into the available framework.Love4Boobies wrote:A good design would have to be flexible enough to allow for the requirements to change over time.Brendan wrote:
- internal scope creep - e.g. the design was perfectly fine for "foo" which is all we cared about at the time; but now we want to do "bar" and the design needs to change. A simple example of this would be saying "it's only a small hobby OS, therefore I don't want to bother with Unicode and proportional fonts" and then 3 years later thinking "it's grown beyond just a small hobby OS, therefore I actually do want Unicode and proportional fonts".
- external scope creep - e.g. the design was perfectly fine for "foo" which is all we could have known about at the time; but now someone else has introduced "bar" and the design needs to change. At the moment there's probably a lot of people looking at their "it was reasonable to assume PC BIOS at the time" boot code.
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: Rewrite from Scratch
@rdos: Saying that MS-DOS was the biggest piece of junk is going overboard. Back then, computers were quite slow, expensive, had rudimentary graphics hardware, and there was no protected mode. There was also limited use for them, Microsoft didn't have many resources, etc. An OS like the one you descrined could not have existed for the PC back then.
Besides, it's very easy to point out bad design in hindsight but history teaches us that people have been consistently bad at predicting the future. Not only that, but good ideas only seem natural once they're out there. Your grandchildren will probably be amused that your generation never thought of FOOBAR---after all, it was so simple!
Besides, it's very easy to point out bad design in hindsight but history teaches us that people have been consistently bad at predicting the future. Not only that, but good ideas only seem natural once they're out there. Your grandchildren will probably be amused that your generation never thought of FOOBAR---after all, it was so simple!
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
Re: Rewrite from Scratch
But there were a multitasking system back then called CP/M (look here: http://en.wikipedia.org/wiki/CP/M). CP/M was a decent operating system, but for some reason IBM let Bill Gates do his hack and used that instead. If IBM had used CP/M instead, the PC market would be very different from how it is now, and it wouldn't have taken two major rewrites by Microsoft until there was decent multitasking on PCs.Love4Boobies wrote:@rdos: Saying that MS-DOS was the biggest piece of junk is going overboard. Back then, computers were quite slow, expensive, had rudimentary graphics hardware, and there was no protected mode. There was also limited use for them, Microsoft didn't have many resources, etc. An OS like the one you descrined could not have existed for the PC back then.
And while the 386 processor didn't exist initially when MS-DOS was written, it was on the market 1988 when I started my project. And I bet the 386 processor was at least at the early design-stages when MS-DOS was written.
Re: Rewrite from Scratch
Hi,
Excluding "clones" (where an existing OS design is merely copied and no design flaws are possible) I can't think of anything that's actually good which hasn't been through at least 2 rewrites.
In practice, this argument is like saying that the person who designed the first horse-drawn cart was a fool because he should've predicted the invention of combustion engines and designed the horse-drawn cart to easily adapt to unforeseeable changes in technology.
Should Microsoft have looked deep into their crystal ball, and designed DOS for GUI and 1920*1600 wide screens and systems with 8 or more 64-bit CPUs running at several GHz back when people were pushing just to get their 8 MHz CPU to handle simple (text mode) word-processing?
Of course rewrites are not good practice when they're not justified too; which is what makes it far too easy for people to take what I've been saying out of context.
Cheers,
Brendan
Imagine someone who's never designed or implemented an OS before. Is it sane to expect them to design and implement something perfect on their first attempt?Love4Boobies wrote:I don't see how the fact that everyone makes mistakes is an argument for the fact that requiring a rewrite is not a sign of a good design.Brendan wrote:
- bad initial design - e.g. the design wasn't very good for "foo" to begin with. Everyone makes bad design decisions sooner or later (the only people who haven't made bad design decisions are people that haven't made design decisions).
Excluding "clones" (where an existing OS design is merely copied and no design flaws are possible) I can't think of anything that's actually good which hasn't been through at least 2 rewrites.
Sounds like a nice theory. Can you think of anything that has actually achieved this in practice? If both Microsoft and Apple can't do it, should we expect random hobbyists to be able to?Love4Boobies wrote:A good design would have to be flexible enough to allow for the requirements to change over time.Brendan wrote:
- internal scope creep - e.g. the design was perfectly fine for "foo" which is all we cared about at the time; but now we want to do "bar" and the design needs to change. A simple example of this would be saying "it's only a small hobby OS, therefore I don't want to bother with Unicode and proportional fonts" and then 3 years later thinking "it's grown beyond just a small hobby OS, therefore I actually do want Unicode and proportional fonts".
- external scope creep - e.g. the design was perfectly fine for "foo" which is all we could have known about at the time; but now someone else has introduced "bar" and the design needs to change. At the moment there's probably a lot of people looking at their "it was reasonable to assume PC BIOS at the time" boot code.
In practice, this argument is like saying that the person who designed the first horse-drawn cart was a fool because he should've predicted the invention of combustion engines and designed the horse-drawn cart to easily adapt to unforeseeable changes in technology.
They were (relatively) good designs at the time they were designed. For example, in the time before MS-DOS was released (before 80286 existed), it would've been unreasonable to expect Microsoft to develop a full multi-tasking OS with GUI, etc. For their next rewrite, Windows 9x was (given the need to support old DOS software that expected full control and no protection) also relatively good.Love4Boobies wrote:You are starting from the assumption that their designs were good when they actually weren't. They may have seemed good at the time; that's another story.Brendan wrote:Where we don't agree is that I think these smaller design changes can become a larger collection that does justify a rewrite; while you think that (for an example) it would've made more sense for Microsoft to keep polishing "MS-DOS" until it becomes something like Windows 8 without starting again (twice).
Should Microsoft have looked deep into their crystal ball, and designed DOS for GUI and 1920*1600 wide screens and systems with 8 or more 64-bit CPUs running at several GHz back when people were pushing just to get their 8 MHz CPU to handle simple (text mode) word-processing?
Rewrites are good practice, when they're justified. Wasting years polishing a turd just because you're not smart enough to recognise the magnitude of design changes and/or because you lack the courage necessary to do what needs to be done, and then ending up with a unmaintainable pile of scar tissue is not good practice.Love4Boobies wrote:Also, notice that my main problem with that post was that the poster was advocating rewrites as a good practice.
Of course rewrites are not good practice when they're not justified too; which is what makes it far too easy for people to take what I've been saying out of context.
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: Rewrite from Scratch
Hi,
Cheers,
Brendan
The first version of MS-DOS was released in 1981. If it took 1 year to implement then it would've been designed in 1980. Back then (before Microsoft became historically important) they would've been lucky to hear vague rumours about the 80286 (which wouldn't have been released until 1982).rdos wrote:And while the 386 processor didn't exist initially when MS-DOS was written, it was on the market 1988 when I started my project. And I bet the 386 processor was at least at the early design-stages when MS-DOS was written.
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.
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: Rewrite from Scratch
@Brendan: I didn't read the whole post because it became even more obvious that there is a misunderstanding here. Even good designers sometimes fail---I accept that reality. You seem to think that by "a design that gets in one's way is a bad design" I really meant "people should be expected to always have good designs." What I'm actually saying is that this is what they should aim for and, should they fail, they should at least try to learn something from the experience. Again, I am contradicting the point that rewriting something because of a design change is good practice; I say that it is actually a sign that something went bad.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
-
- Member
- Posts: 510
- Joined: Wed Mar 09, 2011 3:55 am
Re: Rewrite from Scratch
rdos wrote:But there were a multitasking system back then called CP/M (look here: http://en.wikipedia.org/wiki/CP/M). CP/M was a decent operating system, but for some reason IBM let Bill Gates do his hack and used that instead.Love4Boobies wrote:@rdos: Saying that MS-DOS was the biggest piece of junk is going overboard. Back then, computers were quite slow, expensive, had rudimentary graphics hardware, and there was no protected mode. There was also limited use for them, Microsoft didn't have many resources, etc. An OS like the one you descrined could not have existed for the PC back then.
They actually approached Digital Research first, and DR asked for too much money.
The original version of CP/M was single-user. I also doubt that the multiuser variants of it *were* in fact decent multitasking systems (at least, not without hardware the IBM PC didn't have), because the 8086 had no means of enforcing protection: Any process could have taken over the system.If IBM had used CP/M instead, the PC market would be very different from how it is now, and it wouldn't have taken two major rewrites by Microsoft until there was decent multitasking on PCs.
Re: Rewrite from Scratch
Back in the day, protection were not the #1 priority in multi-tasking system, but let the user perform multiple tasks smoothly (hot key pop out for TSR, or even in fg/ctrl-Z manner).
If there is a malware that take over the system, the user simply reboot and remove that software.
If there is a malware that take over the system, the user simply reboot and remove that software.
Re: Rewrite from Scratch
I just made a short video. This is my previous "OS" project (before "rewrite from scratch"):
http://www.youtube.com/watch?v=Hmxo10_ZN_s
It is easier to see the screen if you use the 720p or 1080p resolution. As you can hear, English is not my native language (I try to improve my pronunciation). This video is not very interesting because the OS itself is so basic. However, it would be really nice to see similar videos from users having something better to show.
http://www.youtube.com/watch?v=Hmxo10_ZN_s
It is easier to see the screen if you use the 720p or 1080p resolution. As you can hear, English is not my native language (I try to improve my pronunciation). This video is not very interesting because the OS itself is so basic. However, it would be really nice to see similar videos from users having something better to show.