Discussion:
where to put code to reduce rational
(too old to reply)
Asimo
2005-01-18 23:47:14 UTC
Permalink
should rationals be reduced in the constructor right at the beginning or
would creating a private method to reduce them be better (more modular for
future use)?

Also, is performance marked on this project?
Douglas Harder
2005-01-19 13:57:55 UTC
Permalink
Preformance is not marked, but you should keep it in mind. It would make
more sense, from a software engineering point-of-view, to, for example,
create a private method which returns the gcd of two int's, but this is not
the only way to do it. How you do it is up to you. If you put everything
into the constructor, it will make it more difficult to read your own code.

Douglas
Post by Asimo
should rationals be reduced in the constructor right at the beginning or
would creating a private method to reduce them be better (more modular for
future use)?
Also, is performance marked on this project?
Loading...