Design first or Implementation first???
CASTalk.com Forum Index CASTalk.com
Discussion of DSP, FPGA, storage and embedded system.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web castalk.com
Design first or Implementation first???
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Computer Architecture
Author Message
Gromer
Guest





Posted: Wed Oct 12, 2005 4:15 pm    Post subject: Design first or Implementation first??? Reply with quote

Hi all,

I've always been wondering about how intellectuals design new things.
For instance if i were to design a kernel.. The first thing i wud do
is. look for a bootloader and its available... so i wud rather go &
start implementing the kernel.. Here is my dilemma... chicken & egg
question???

Should i be designing the kernel completely and then start implementing
(coding) or should i start coding as & when ideas come to me ..

Why this question crops up?? when i start designing not many ideas come
to my mind.. but when i start implementing... the ideas come as & when
the code keeps growing.. i understand the requirements of my product...


So I'm v curious to know how intellectuals really design something
new.. Do they really design ,document and then start implementing
or.... coding & design goes together...

chicken(design) or Egg(implementation) first???

Thanks,
Gromer
Back to top
Brendan
Guest





Posted: Wed Oct 12, 2005 4:15 pm    Post subject: Re: Design first or Implementation first??? Reply with quote

Hi,

I added the "alt.os.development" newgroup, as it's probably more
appropriate.

"Gromer" <osIndgy@gmail.com> wrote in message:
[quote]Should i be designing the kernel completely and then start implementing
(coding) or should i start coding as & when ideas come to me ..
[/quote]
If you need to ask this, then my (serious) suggestion is to start
implementing the OS without doing any design at all. Grab a copy of
GRUB, build a "hello world" kernel, then implement memory
management and a scheduler. Once you reach this stage consider how
you will implement device drivers.

After this, call the initial work "educational" and delete it.
Then start working on the OS design (perhaps starting with a list
of goals, then a brief overview of the OS, and then a set of
documents that describe what different parts do, how different
parts interact and where they are to be implemented).

Once you've done this you would have decided if it's a monolithic
kernel or a micro-kernel (or something else), what you'll be using
for IPC, how you'll manage memory, if it will be portable (and
how), what features it will support, intended minimum hardware
requirements, etc.

You might also get the preliminary/"educational" version done and
decide OS development isn't for you - I've seen this happen often
(once people realise what's involved for anything more than a toy).


Cheers,

Brendan
Back to top
Bill Todd
Guest





Posted: Thu Oct 13, 2005 12:15 am    Post subject: Re: Design first or Implementation first??? Reply with quote

Gromer wrote:
[quote]Hi all,

I've always been wondering about how intellectuals design new things.
[/quote]
Identifying the actual need for something new is usually a good place to
start. That focus on requirements tends to lead to at least a broad
definition of the direction in which to proceed and also serves as a
sanity-check on whether what you're doing will be useful to anyone but
yourself.

After that, it starts becoming more a matter of personal style and
preference - at least after one has developed sufficient expertise that
personal preferences are worthy of consideration. It's pretty much
*always* true that you should be prepared to 'throw the first one away'
after you've implemented it, but some people favor an 'extreme
programming' approach where you may throw away *many* implementations
while others prefer a more analytical approach with a lot more up-front
design and (hopefully) fewer implementation fiascoes along the way.

It also may depend on exactly what you're implementing: an interactive
application with complex GUI may lend itself much more to getting
something - anything! - up and running to see what kinds of problems
users have with it and react accordingly (and iteratively), while an OS
interface may be far more readily definable up front and lend itself to
correspondingly more up-front preparation before any code gets written.

"Code Complete" by Steve McConnell of Microsoft is an at least somewhat
impartial look at some approaches to development that you might find
interesting (I've never made it through his later "Rapid Development",
which is more tied to one particular approach).

- bill
Back to top
Guest






Posted: Thu Oct 13, 2005 7:25 am    Post subject: Re: Design first or Implementation first??? Reply with quote

For a nice anecdote of an extreme design-first approach:

http://www.multicians.org/andre.html

For my professional work, it usually starts with some coding &
reading-up on specifications, requirements etc. The experimental code
is usually not really structured except for clearly modularising
functions.

When I finally understand what is needed I write a new, proper main
code and cut and paste the functions I've already developed & debugged
earlier. So I guess you can call this a "structured collection of
hacks".

Some of my personal projects are like this. For example my web server.
But most of my personal projects starts with pages upon pages of
documentation building up to a final design. Then the implementation
becomes almost trivial, just typing up the code.

Why does my personal, hobbyist, spare-time projects seem to be more
professional than my "professional" work? The answer is time. My bosses
over the years will always want to see progress and will not want me to
wast time to re-implement "working code". Even if the code is
experimental. For my personal stuff, I don't mind taking two years to
design and implement something. Especially if I learn stuff along the
way.
Back to top
Phlip
Guest





Posted: Thu Oct 13, 2005 8:15 am    Post subject: Re: Design first or Implementation first??? Reply with quote

Gromer wrote:

[quote]I've always been wondering about how intellectuals design new things.
For instance if i were to design a kernel.. The first thing i wud do
is. look for a bootloader and its available... so i wud rather go &
start implementing the kernel.. Here is my dilemma... chicken & egg
question???
[/quote]
Sounds to me like you should express the test first. (That's the scientific
method.)

To specify what you want, specify how you will tell you will get it. (Then
automate that specification, and run it over and over again to make
chronically sure you still have it.)

For a kernel, write a simulator of your CPU's bootstrapping system. The same
bytecodes that boostrap a real kernel should bootstrap this simulator, in
the same way.

As you develop, you will start relying on the simulator, and you will add
the higher level features without "manual testing" in a real CPU. If the
simulator differs in opinion from a real CPU, tune it until it behaves the
same.

[quote]Should i be designing the kernel completely and then start implementing
(coding) or should i start coding as & when ideas come to me ..
[/quote]
Both those techniques add risk. Keeping tests in the loop reduces those
risks.

--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
Back to top
Guest






Posted: Thu Oct 13, 2005 1:18 pm    Post subject: Re: Design first or Implementation first??? Reply with quote

Quote:
For my professional work, it usually starts with some coding &
reading-up on specifications, requirements etc. The experimental code
is usually not really structured except for clearly modularising
functions.

I usually simpy see the code in my head, right after I start thinking
about it. However, when it comes down to actually coding it, the result
is very different.
Back to top
Alan Balmer
Guest





Posted: Thu Oct 13, 2005 10:11 pm    Post subject: Re: Design first or Implementation first??? Reply with quote

On 12 Oct 2005 07:40:59 -0700, "Gromer" <osIndgy@gmail.com> wrote:

Quote:
Hi all,

I've always been wondering about how intellectuals design new things.
For instance if i were to design a kernel.. The first thing i wud do
is. look for a bootloader and its available... so i wud rather go &
start implementing the kernel.. Here is my dilemma... chicken & egg
question???

Should i be designing the kernel completely and then start implementing
(coding) or should i start coding as & when ideas come to me ..

Why this question crops up?? when i start designing not many ideas come
to my mind.. but when i start implementing... the ideas come as & when
the code keeps growing.. i understand the requirements of my product...

Remember Knuth's algorithm for writing algorithms. The last step is

something like "Now you know how to do it, tear it up and start over
again."
Quote:

So I'm v curious to know how intellectuals really design something
new.. Do they really design ,document and then start implementing
or.... coding & design goes together...

chicken(design) or Egg(implementation) first???

Something of both, actually. Especially in a larger project, a lot of

time should be spent in up-front design. However, expect the design to
change as the project is implemented.
--
Al Balmer
Balmer Consulting
removebalmerconsultingthis@att.net
Back to top
Michael Wojcik
Guest





Posted: Thu Oct 13, 2005 11:16 pm    Post subject: Re: Design first or Implementation first??? Reply with quote

In article <1129128059.192494.230780@g49g2000cwa.googlegroups.com>, "Gromer" <osIndgy@gmail.com> writes:
Quote:

I've always been wondering about how intellectuals design new things.

Do non-intellectuals design new things? Isn't designing essentially
an intellectual function?

I've known "intellectuals" (by any reasonable definition) who were
lousy designers; some of them were also lousy programmers.

In short, intellectuals design things in all the ways that things are
designed. There is no "intellectual ways to design" proper subset of
"ways to design".

Quote:
Should i be designing the kernel completely and then start implementing
(coding) or should i start coding as & when ideas come to me ..

There's a huge and ever-growing body of literature devoted to this
question (and other alternative approaches). Despite what
evangelists for various positions may claim, no one has yet
demonstrated compelling[*] evidence that any one approach is clearly
superior. What has been demonstrated is that certain approaches
tend to have certain advantages under certain conditions.


[*] Not sufficiently compelling to produce a general consensus,
anyway - as the continued debate shows.

--
Michael Wojcik michael.wojcik@microfocus.com

It's like being shot at in an airport with all those guys running
around throwing hand grenades. Certain people function better with
hand grenades coming from all sides than other people do when the
hand grenades are only coming from inside out. -- Dick Selcer
Back to top
Bill Todd
Guest





Posted: Fri Oct 14, 2005 12:15 am    Post subject: Re: Design first or Implementation first??? Reply with quote

Robert A Duff wrote:
Quote:
Scott Moore <samiamsansspam@Sun.COM> writes:


Design is always first. Ever seen a building built before
it was designed ?


I don't buy that analogy. Writing code _is_ design, although perhaps at
a more detailed level than what we (software folks) normally call
"design". Writing code is not analogous to building a building.

I suspect that you've never built a building. I have (the largest being
our 3500 sq. ft. home), and I've also written a considerable amount of
OS-level software (primarily file systems). The two have a great deal
in common in this area: with some experience, it's possible to do
either one to a significant degree off the cuff and design as you go
along (at least if you're reasonably adept at keeping a lot of balls in
the air at once for extended periods of time), or to put in almost
limitless amounts of design effort up front with the usual somewhat
diminishing but non-zero returns (and the same propensity for still
leaving room for a few surprises during the implementation phase).

The main difference between the two is in the malleability of the result
- though even there unless your software is exceptionally
well-structured (which itself tends to require up-front design) making
significant after-the-fact changes may not be easy. My own feeling is
that both require roughly comparable amounts of up-front design to
provide any reasonable probability of a good result, save for the
simplest projects (or, as I mentioned earlier, those where some aspects
of the design, such as user interfaces, cannot be accurately laid out
without gaining some real-world experience using an early cut at the
product).

- bill
Back to top
Robert A Duff
Guest





Posted: Fri Oct 14, 2005 12:15 am    Post subject: Re: Design first or Implementation first??? Reply with quote

Bill Todd <billtodd@metrocast.net> writes:

Quote:
Robert A Duff wrote:
Scott Moore <samiamsansspam@Sun.COM> writes:

Design is always first. Ever seen a building built before
it was designed ?
I don't buy that analogy. Writing code _is_ design, although perhaps
at
a more detailed level than what we (software folks) normally call
"design". Writing code is not analogous to building a building.

I suspect that you've never built a building.

Your suspicion is correct. I built a tree house once, though,
with some help from my son. Does that count? ;-)

I still say: working with physical materials is fundamentally
different from writing code in a programming language.

Quote:
...I have (the largest being
our 3500 sq. ft. home), and I've also written a considerable amount of
OS-level software (primarily file systems). The two have a great deal
in common in this area: with some experience, it's possible to do
either one to a significant degree off the cuff and design as you go
along (at least if you're reasonably adept at keeping a lot of balls in
the air at once for extended periods of time), or to put in almost
limitless amounts of design effort up front with the usual somewhat
diminishing but non-zero returns (and the same propensity for still
leaving room for a few surprises during the implementation phase).

The main difference between the two is in the malleability of the result
- though even there unless your software is exceptionally
well-structured (which itself tends to require up-front design) making
significant after-the-fact changes may not be easy. My own feeling is
that both require roughly comparable amounts of up-front design to
provide any reasonable probability of a good result, save for the
simplest projects (or, as I mentioned earlier, those where some aspects
of the design, such as user interfaces, cannot be accurately laid out
without gaining some real-world experience using an early cut at the
product).

Well, I write compilers, and things like that, for a living.
I like to think my "software is exceptionally well-structured",
and I agree that requires up-front design. You can't just start
typing in code and debug it into submission.

- Bob
Back to top
Robert A Duff
Guest





Posted: Fri Oct 14, 2005 12:15 am    Post subject: Re: Design first or Implementation first??? Reply with quote

Scott Moore <samiamsansspam@Sun.COM> writes:

Quote:
Design is always first. Ever seen a building built before
it was designed ?

I don't buy that analogy. Writing code _is_ design, although perhaps at
a more detailed level than what we (software folks) normally call
"design". Writing code is not analogous to building a building.
Putting the bits on a CD and sticking a nice-looking sticker on it is
perhaps more analogous to building a building -- but in software, that
part of the process is trivial.

- Bob
Back to top
Scott Moore
Guest





Posted: Fri Oct 14, 2005 12:15 am    Post subject: Re: Design first or Implementation first??? Reply with quote

Design is always first. Ever seen a building built before
it was designed ?

Actually, they did exist at one time, prior to about 1900,
and they tended to fall down.

Code does not immediately fall down, so we believe its possible
to design later. However, the order tends to show in the organization
of the code, and yes, the code even falls down in the form of a
crash.

However, the true reality is there is no such animal as "implement
first, design after", for the simple reason that programs, once
implemented, are not redesigned. Its over.

The true "alternative" to design first, then implement, is "implement
while designing ad hoc concurrently". When the implementation is done,
the design is done, its just never been explicitly designed.

The programming professions refusal to use standard engineering
principles is somewhat funny. Its like someone saying:

A. I've cut off my hand, what should I do about it ?

B. You should put a bandange on it.

A. No, that's an outdated solution, what should I do about it ?

I.e., perhaps the way all of the other engineering professions
have been doing things for decades or centuries might actually
make sense for our profession as well.
Back to top
Scott Moore
Guest





Posted: Fri Oct 14, 2005 12:15 am    Post subject: Re: Design first or Implementation first??? Reply with quote

Alan Balmer wrote On 10/13/05 10:11,:

Quote:

Remember Knuth's algorithm for writing algorithms. The last step is
something like "Now you know how to do it, tear it up and start over
again."


Actually he said (in the "art of programming") that programmers should not
be afraid to rewrite code that had become unmaintainable, or needed to
be moved to a different langauge, since it would usually greatly improve
the code.
Back to top
Bill Todd
Guest





Posted: Fri Oct 14, 2005 5:30 am    Post subject: Re: Design first or Implementation first??? Reply with quote

Robert A Duff wrote:
Quote:
Bill Todd <billtodd@metrocast.net> writes:


Robert A Duff wrote:

Scott Moore <samiamsansspam@Sun.COM> writes:


Design is always first. Ever seen a building built before
it was designed ?

I don't buy that analogy. Writing code _is_ design, although perhaps
at
a more detailed level than what we (software folks) normally call
"design". Writing code is not analogous to building a building.

I suspect that you've never built a building.


Your suspicion is correct. I built a tree house once, though,
with some help from my son. Does that count? ;-)

I still say: working with physical materials is fundamentally
different from writing code in a programming language.

Right. After all, it's not as if both involved creating fairly coherent
wholes that satisfied some real-world need, or using tools (with greater
or lesser degrees of expertise at doing so), or creating high-level
internal structures with significant inter-dependencies (some necessary,
some perhaps better avoided if possible to avoid unnecessary
interactions), or the use of sub-structures which themselves have
internal dependencies which may be amenable to patch-style fixes or may
require complete tear-down and rework in different situations.

I guess it takes a true lack of familiarity with at least one of the
disciplines to really appreciate just how different they are.

Quote:


...I have (the largest being
our 3500 sq. ft. home), and I've also written a considerable amount of
OS-level software (primarily file systems). The two have a great deal
in common in this area: with some experience, it's possible to do
either one to a significant degree off the cuff and design as you go
along (at least if you're reasonably adept at keeping a lot of balls in
the air at once for extended periods of time), or to put in almost
limitless amounts of design effort up front with the usual somewhat
diminishing but non-zero returns (and the same propensity for still
leaving room for a few surprises during the implementation phase).

The main difference between the two is in the malleability of the result
- though even there unless your software is exceptionally
well-structured (which itself tends to require up-front design) making
significant after-the-fact changes may not be easy. My own feeling is
that both require roughly comparable amounts of up-front design to
provide any reasonable probability of a good result, save for the
simplest projects (or, as I mentioned earlier, those where some aspects
of the design, such as user interfaces, cannot be accurately laid out
without gaining some real-world experience using an early cut at the
product).


Well, I write compilers, and things like that, for a living.
I like to think my "software is exceptionally well-structured",
and I agree that requires up-front design. You can't just start
typing in code and debug it into submission.

Ah, but your own point initially above was that coding *is* design, not
'just typing in code and debugging it into submission'. And mine was
that building *is* design in a very similar sense (though of course it's
*possible* to pervert both by plunging in with no real grasp of the
entirety of the project).

- bill
Back to top
Terje Mathisen
Guest





Posted: Fri Oct 14, 2005 8:15 am    Post subject: Re: Design first or Implementation first??? Reply with quote

Scott Moore wrote:

Quote:
Alan Balmer wrote On 10/13/05 10:11,:


Remember Knuth's algorithm for writing algorithms. The last step is
something like "Now you know how to do it, tear it up and start over
again."

Actually he said (in the "art of programming") that programmers should not
be afraid to rewrite code that had become unmaintainable, or needed to
be moved to a different langauge, since it would usually greatly improve
the code.

In my personal experience, any code that I really care about, I always
write it at least partly on paper first, often many different versions,
before I throw away the paper and rewrite it on the computer.

I guess this would be according to Alan's interpretation of Knuth. :-)

Terje

--
- <Terje.Mathisen@hda.hydro.com>
"almost all programming can be viewed as an exercise in caching"
Back to top
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Computer Architecture All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




VoIP Electronics Powered by phpBB