 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
shawn Guest
|
Posted: Wed Apr 20, 2005 3:53 pm Post subject: Starting with big projects in C++ |
|
|
Hi!
I am new to C++ and I am working on a C++ project. Part of my job
is to create C++ Library. I read books like The C++ Programming
Language 3'rd edt, Thinking in C++ , The C++ Standard Library etc. But
I did'nt really get the concept to make use in my project, because none
of the books gives example of any big projects and ideas of how to
start and handle them. I am having trouble thinking in abstraction. Can
someone suggest me how to handle big projects in C++ and is there any
book or resources I can go though to get a hold of C++.
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Bronek Kozicki Guest
|
Posted: Thu Apr 21, 2005 1:56 am Post subject: Re: Starting with big projects in C++ |
|
|
shawn <sshakir56 (AT) gmail (DOT) com> wrote:
| Quote: | Hi!
I am new to C++ and I am working on a C++ project. Part of my job
is to create C++ Library. I read books like The C++ Programming
Language 3'rd edt, Thinking in C++ , The C++ Standard Library etc. But
I did'nt really get the concept to make use in my project, because
none of the books gives example of any big projects and ideas of how
to start and handle them. I am having trouble thinking in
abstraction. Can someone suggest me how to handle big projects in C++
and is there any book or resources I can go though to get a hold of
C++.
|
Try to define minimal set of functionality that will demonstrate your
understanding of problem, then deliver it using as simple means as
possible. Do not use inheritance if you really do not have clean "is-a"
situation; in most cases containment is better, and obviously it is
simpler. Use exceptions when appropriate; I recommend "Exceptional C++"
and "Exceptional C++ Style" by Herb Sutter if you want to learn more
about them. Always keep in mind how easy your library will be to use, do
not waste time on corner cases (yet). Once you feel more comfortable on
the subject you can explore them. I would also suggest that you read
some books about test driven development or agile development; this will
help you to develop code that is easy to test and to change.
B.
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Voltron Beta 2 Guest
|
Posted: Thu Apr 21, 2005 2:30 am Post subject: Re: Starting with big projects in C++ |
|
|
Well, I am assuming you have some experience developing reusable
components and libraries in C, Java or some other language. A lot of
thought goes into designing libraries that are truly useful, especially
in a large project and part of your experience as designer and user of
libraries goes into making design and coding choices that will impact
large either number of users (developers), potentially for a long time
to come. Initially you should set your goal to giving your users as
much flexibility as they need and as time goes by, with more experience
(in C++, library design, grasp of domain), you can spread your wings
and provide your users as much flexibility as the want.
The eventual goal here is to make your users' life easier, while
ensuring long term maintainability for the project as a whole including
library and user codebase. I know these ideas are not specific to c++,
but that is my point, the task of library design is much more human
than just writing c++, it involves managing expectations, having
foresight and ensuring quality above all.
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
mzdude Guest
|
Posted: Thu Apr 21, 2005 8:40 am Post subject: Re: Starting with big projects in C++ |
|
|
I've read John Lakos "Large-Scale C++ Software Design". It has some
good ideas and the mechanics behind packaging software and dividing
functionality. It might be a bit dated by now, but still worth looking
at.
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
galathaea Guest
|
Posted: Thu Apr 21, 2005 8:43 am Post subject: Re: Starting with big projects in C++ |
|
|
shawn said:
"I am having trouble thinking in abstraction. Can
someone suggest me how to handle big projects in C++ and is there any
book or resources I can go though to get a hold of C++."
i find it is best not to try to force the abstractions
start with the minimum objects your system needs
define how this really simple collection of objects interact
usually you have some type of io for the system
so there is often already a good classification structure of your input
and output objects
(are you an algebraic topology library, a financial reporting library,
a serialisation library, ..?)
now how does your system transform the inputs to outputs
usually there is some little ecology here you can describe with objects
and morphisms in some kind of term calculus
it is often a very good idea to have mostly lightweight objects
(but don't stress it at first - you can pull apart classes that have
grown too busy later)
that usually starts a system off pretty quickly with functionality
then
once you've had some familiarity with what your system does and how it
integrates as a library to its clients
you look for more useful abstractions
try to add functionality
feature points often show up as some form of polymorphism (static or
runtime)
the books you have read show you many good guidelines for building
these objects safely (RAII, exception safety, good coding practices)
but you are looking for more architectural knowledge
in software architecture, common design choices are communicated in
patterns
there are many good books out there that demonstrate common object
interactions, often in a diagrammatic pattern language like UML
a book i like to recommend is "generative programming by czarnecki and
eisenecker" because it really stresses the relationship between useful
models and appropriate domain languages
online and libraries provide many free resources
but the problem is that starting out, it is often difficult to see the
correct patterns for a particular task and it is common to see very
complicated logic used to try to use patterns that were not ever needed
for a system
the best pattern is simplicity
so instead of using pattern books to give ideas for a design at first
i prefer to start with io and the natural ways i talk about it
the patterns emerge during refactoring of the initial system into a
leaner, more flexible expression of the domain language
if you are into mathematical explanations
you might enjoy reading about how logic and type theory are related
through the curry-howard isomorphism, which provides a connection
between the logic of a domain language and natural typed models through
an algebraic system that expresses type dynamics and patterns
like all engineering sciences, though
it takes experience to build the right heuristics
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// galathaea: prankster fablist, magician, liar
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Alex Beluga Guest
|
Posted: Thu Apr 21, 2005 8:46 am Post subject: Re: Starting with big projects in C++ |
|
|
Maybe you need something that's project-construction related. In
common, principles of architecture of all languages are the same. Maybe
some technical and communication implementations differ.
For example: I'm reading now UML:Distilled and Fowler (author) explains
stuff on examples of Java&C#, but I'll goin' to use it in my C++
project.
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Pavel Vozenilek Guest
|
Posted: Thu Apr 21, 2005 8:51 am Post subject: Re: Starting with big projects in C++ |
|
|
"shawn"
| Quote: | Can
someone suggest me how to handle big projects in C++
There's one time proven method: start from small ones |
and learn in the process.
/Pavel
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
|
|
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
|
|