473,378 Members | 1,594 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

classes

do people prefer to design classes for the particular job or for a rangle of
tasks they might encounter now and in the future.
i am doing some simple win32 apps and picking classes is simple, but
understanding others peoples logic isnt (that doesnt mean they are wrong).

i prefer designing classes for the currect job and making tangible 'things'
classes , not overdoing it with loads of classes or inheritance..

it seems easier to make classes and use previous work if possible. the idea
of making re-usable code to be used all the time is impractical
Also using polymorphism,inheritance etc on old code to make it usabke for
now is an overhead of simplictity to read. Again simply designing classes
from scratch with previous work as a help seems easier to do.

are there any rules of thumb for this
Jul 23 '05 #1
4 1792
"john townsley" <jo**********@optusnet.com.au> wrote...
do people prefer to design classes for the particular job or for a rangle
of tasks they might encounter now and in the future.
Yes.
i am doing some simple win32 apps and picking classes is simple, but
understanding others peoples logic isnt (that doesnt mean they are wrong).
Understanding others is never simple.
i prefer designing classes for the currect job and making tangible
'things' classes , not overdoing it with loads of classes or inheritance..
OK.
it seems easier to make classes and use previous work if possible. the
idea of making re-usable code to be used all the time is impractical
Well, that's not what the Standard Library designers thought...
Also using polymorphism,inheritance etc on old code to make it usabke for
now is an overhead of simplictity to read. Again simply designing classes
from scratch with previous work as a help seems easier to do.
'Seems' is probably the key word here.
are there any rules of thumb for this


The rule of thumb is simple: do what's easier. Of course, some understand
that rule as "do what's easier NOW", and some as "do what's easier IN THE
LONG RUN". I guess it depends on your expectation of the lifetime of your
own work. I've written a few "one-timers" myself. They did their work as
needed when they were created, and were never designed for re-use. It is
quite possible that among those I've written some more than once to do the
same essential task. If the amount of such share is below one quarter of
all "one-timers", it's probably OK. If every time you when you sit down to
write a one-timer you suddenly, half-way through implementation, realise
that "you can swear you've done it before and probably more than once",
then you ought to keep those and document them well.

It's one thing to reinvent the wheel that was invented by others. It's
totally different thing to reinvent your own wheel [all the time].

Another sentiment: when we were little, we were taught: repetition is the
mother of learning. The question is, are you still consider yourself
learning or is it really time to grow?

Re-use is the cornerstone of good design. When you don't intend something
to be re-used, you usually do not apply enough thought to its design. It
becomes a vicious circle, a catch-22: you can't re-use your old work since
it wasn't designed for it, so you start writing everything anew, and it too
comes out non-re-usable because you don't have time nor the intent to do it
right.

V
Jul 23 '05 #2

"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:Wv********************@comcast.com...
"john townsley" <jo**********@optusnet.com.au> wrote...
do people prefer to design classes for the particular job or for a rangle
of tasks they might encounter now and in the future.


Yes.
i am doing some simple win32 apps and picking classes is simple, but
understanding others peoples logic isnt (that doesnt mean they are
wrong).


Understanding others is never simple.
i prefer designing classes for the currect job and making tangible
'things' classes , not overdoing it with loads of classes or
inheritance..


OK.
it seems easier to make classes and use previous work if possible. the
idea of making re-usable code to be used all the time is impractical


Well, that's not what the Standard Library designers thought...
Also using polymorphism,inheritance etc on old code to make it usabke for
now is an overhead of simplictity to read. Again simply designing classes
from scratch with previous work as a help seems easier to do.


'Seems' is probably the key word here.
are there any rules of thumb for this


The rule of thumb is simple: do what's easier. Of course, some understand
that rule as "do what's easier NOW", and some as "do what's easier IN THE
LONG RUN". I guess it depends on your expectation of the lifetime of your
own work. I've written a few "one-timers" myself. They did their work as
needed when they were created, and were never designed for re-use. It is
quite possible that among those I've written some more than once to do the
same essential task. If the amount of such share is below one quarter of
all "one-timers", it's probably OK. If every time you when you sit down
to
write a one-timer you suddenly, half-way through implementation, realise
that "you can swear you've done it before and probably more than once",
then you ought to keep those and document them well.

It's one thing to reinvent the wheel that was invented by others. It's
totally different thing to reinvent your own wheel [all the time].

Another sentiment: when we were little, we were taught: repetition is the
mother of learning. The question is, are you still consider yourself
learning or is it really time to grow?

Re-use is the cornerstone of good design. When you don't intend something
to be re-used, you usually do not apply enough thought to its design. It
becomes a vicious circle, a catch-22: you can't re-use your old work since
it wasn't designed for it, so you start writing everything anew, and it
too
comes out non-re-usable because you don't have time nor the intent to do
it
right.

V


i agree with what you say and it was a good response

you have to know if your code is going to be re-used and have some idea
what for first. some classes are devloped by adding 100's of extra things
that might be used. you can only worry about the future so much.
of course if you have some idea then include extra functionality and put
extra work in the design.

the best thing you said compared to other on the topic is that you said 'do
what's easier' .

Jul 23 '05 #3
On Thu, 17 Feb 2005 22:47:42 -0500, Victor Bazarov
<v.********@comAcast.net> wrote:
The rule of thumb is simple: do what's easier. Of course, some understand
that rule as "do what's easier NOW", and some as "do what's easier IN THE
LONG RUN". I guess it depends on your expectation of the lifetime of your
own work. I've written a few "one-timers" myself. They did their work as
needed when they were created, and were never designed for re-use. It is
quite possible that among those I've written some more than once to do the
same essential task. If the amount of such share is below one quarter of
all "one-timers", it's probably OK. If every time you when you sit down to
write a one-timer you suddenly, half-way through implementation, realise
that "you can swear you've done it before and probably more than once",
then you ought to keep those and document them well.
There are some things I've written a number of times, each time it gets
better (it's impossible to think of all possible uses at design time,
there's a point where "rewrite from scratch" is more effective than
trying to modify the original). There are some I've had to rewrite for
different languages, as well.

On the other hand there's some code I wrote 20 years ago which I'm still
using effectively unchanged (at that time C didn't even have function
prototypes or void, so they have grown proper modern interfaces since
then, but otherwise they are effectively unchanged).
It's one thing to reinvent the wheel that was invented by others. It's
totally different thing to reinvent your own wheel [all the time].
Yup. "Write once, use often" is a general principle I go by.
Another sentiment: when we were little, we were taught: repetition is the
mother of learning. The question is, are you still consider yourself
learning or is it really time to grow?
Heh. I hope I'm still learning, since Newton and Einstein were proud of
the fact that there was still so much else to know (with a finite
lifespan it is impossible to learn everything). But relearning the same
thing all the time is (a) boring and (b) a waste of time which could be
spent learning something new...
Re-use is the cornerstone of good design. When you don't intend something
to be re-used, you usually do not apply enough thought to its design. It
becomes a vicious circle, a catch-22: you can't re-use your old work since
it wasn't designed for it, so you start writing everything anew, and it too
comes out non-re-usable because you don't have time nor the intent to do it
right.


Or worse, you try to fit the old thing into the new functionality and
end up with something which is totally unmaintainable and clunky. At
which point it's a good idea to treat the original as a prototype and
say "Now that I know more about what it should have done and what I
really wanted I can write a proper specification".

Chris C
Jul 23 '05 #4

"john townsley" <jo**********@optusnet.com.au> wrote in message
news:42**********************@news.optusnet.com.au ...

"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:Wv********************@comcast.com...
"john townsley" <jo**********@optusnet.com.au> wrote...
do people prefer to design classes for the particular job or for a rangle of tasks they might encounter now and in the future.
Yes.
i am doing some simple win32 apps and picking classes is simple, but
understanding others peoples logic isnt (that doesnt mean they are
wrong).


Understanding others is never simple.
i prefer designing classes for the currect job and making tangible
'things' classes , not overdoing it with loads of classes or
inheritance..


OK.
it seems easier to make classes and use previous work if possible. the
idea of making re-usable code to be used all the time is impractical


Well, that's not what the Standard Library designers thought...
Also using polymorphism,inheritance etc on old code to make it usabke for now is an overhead of simplictity to read. Again simply designing classes from scratch with previous work as a help seems easier to do.


'Seems' is probably the key word here.
are there any rules of thumb for this


The rule of thumb is simple: do what's easier. Of course, some understand that rule as "do what's easier NOW", and some as "do what's easier IN THE LONG RUN". I guess it depends on your expectation of the lifetime of your own work. I've written a few "one-timers" myself. They did their work as needed when they were created, and were never designed for re-use. It is quite possible that among those I've written some more than once to do the same essential task. If the amount of such share is below one quarter of all "one-timers", it's probably OK. If every time you when you sit down
to
write a one-timer you suddenly, half-way through implementation, realise
that "you can swear you've done it before and probably more than once",
then you ought to keep those and document them well.

It's one thing to reinvent the wheel that was invented by others. It's
totally different thing to reinvent your own wheel [all the time].

Another sentiment: when we were little, we were taught: repetition is the mother of learning. The question is, are you still consider yourself
learning or is it really time to grow?

Re-use is the cornerstone of good design. When you don't intend something to be re-used, you usually do not apply enough thought to its design. It becomes a vicious circle, a catch-22: you can't re-use your old work since it wasn't designed for it, so you start writing everything anew, and it
too
comes out non-re-usable because you don't have time nor the intent to do
it
right.

V


i agree with what you say and it was a good response

you have to know if your code is going to be re-used and have some idea
what for first. some classes are devloped by adding 100's of extra things
that might be used. you can only worry about the future so much.
of course if you have some idea then include extra functionality and put
extra work in the design.

the best thing you said compared to other on the topic is that you said

'do what's easier' .


I find reusing classes much simpler, when I am focused at not writing one
class, at solving a problem. And solving that problem by making a set of
classes, where each class has one responsibility. I might end up making them
part of a big class, or a couple of big classes(subsystem) at the end, but
all small factored out classes are usually reuseable..

Jesper
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking aftwerwards with ILDASM at what is visible in those assemblies from a...
9
by: Jack | last post by:
Hello I have a library of calculationally intensive classes that is used both by a GUI based authoring application and by a simpler non-interactive rendering application. Both of these...
9
by: Aguilar, James | last post by:
I know that one can define an essentially unlimited number of classes in a file. And one can declare just as many in a header file. However, the question I have is, should I? Suppose that, to...
12
by: Langy | last post by:
Hello I'm fairly new to C++ but have programmed several other languages and found most of c++ fairly easy (so far!). I've come to a tutorial on classes, could someone please tell me why you...
2
by: joye | last post by:
Hello, My question is how to use C# to call the existing libraries containing unmanaged C++ classes directly, but not use C# or managed C++ wrappers unmanaged C++ classes? Does anyone know how...
18
by: Edward Diener | last post by:
Is the packing alignment of __nogc classes stored as part of the assembly ? I think it must as the compiler, when referencing the assembly, could not know how the original data is packed otherwise....
6
by: ivan.leben | last post by:
I want to write a Mesh class using half-edges. This class uses three other classes: Vertex, HalfEdge and Face. These classes should be linked properly in the process of building up the mesh by...
0
by: ivan.leben | last post by:
I am writing this in a new thread to alert that I found a solution to the problem mentioned here: http://groups.google.com/group/comp.lang.c++/browse_thread/thread/7970afaa089fd5b8 and to avoid...
2
by: Amu | last post by:
i have a dll ( template class) ready which is written in VC++6. But presently i need to inherit its classes into my new C#.net project.so if there is some better solution with u then please give me...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.