Topic: Dream: Embedded GRAPHICS in my SOURCE CODE (possible ?)
Author: sriram@glock.tcs.com (Sriram Srinivasan)
Date: 28 Mar 1994 19:40:09 GMT Raw View
In article <k136377.764502026@ee.tut.fi>, k136377@ee.tut.fi (Kauppi Asko) writes:
> I wish...
> ...I was able to insert pictures, math formulas and other OLE
> objects in the middle of my C++ source code and still compile
> the programs the normal way.
>
> The embedded objects would not affect the compilation in any way
> (they would be 'graphical comments') but they would provide an
> invaluable help in visualizing the purpose of the subroutines
> for me and for my colleagues.
Check the comp.programming.literate group for more information.
The solutions suggested in this newsgroup use tex and CWEB, and my
problem was that I ended up spending too much time in formatting related
issues.
Instead, I did the following ...
I use FrameMaker on Sun workstations, but this approach is possible on
Word for Windows, on the PC.
1. Have a paragraph template (style on Word) named "Code", say.
2. Write your document any way you want, with graphics, and with enuf
fonts to make it look like a ransom note.
3. All pieces of code that you intend to compile are tagged "Code".
I turn autonumbering on, and have cross-references in my comments, so
that comments do not get out of date.
4. Whenever I want to compile, I convert the Framemaker format file to a
an intermediate text format (.MIF), using Frame's tools, and extract the
code pieces out of it, and compile it, all in the Makefile.
This is obviously a much slower process, but I end up having much better
documented code, more well thought out, and equally importantly,
fewer edit-compile cycles.
Now the problems :
1. I'm still working on getting the line number information correct.
2. One has to keep a copy of the code itself seperately, because you
want to use tools like Perl, egrep etc. There is currently no
way for me to make changes in the code file (text) and to have it
integrated back in the framemaker document, but it doesn't seem very
difficult to me.
Hope this helps.
Sriram
Author: k136377@ee.tut.fi (Kauppi Asko)
Date: 24 Mar 94 09:40:26 GMT Raw View
I wish...
...I was able to insert pictures, math formulas and other OLE
objects in the middle of my C++ source code and still compile
the programs the normal way.
The embedded objects would not affect the compilation in any way
(they would be 'graphical comments') but they would provide an
invaluable help in visualizing the purpose of the subroutines
for me and for my colleagues.
I'm using BC++ and think that adding such a feature would not
demand major changes in the windows-based IDE they have.
The object could be created with whatever OLE-compiliant program
so no drawing program is required by Borland.
Is this already a reality, a feature planned for future versions
or is just a dream at the moment.
Do you others agree on the usefulness of such a feature ?
How to send Borland such requests/tips to help them further
develop their programming platform? Which email address?
Hope you others share my dream, too! :-) / Asko /
--
/ Asko Kauppi / k136377@ee.tut.fi ( Tampere University of Technology )
Kuoppamaentie 37f50 ! "Happy are those, who put their trust in the Lord."
33800 Tre, Finland ! (Is.30:18)
Author: miket@world.std.com (Michael Trachtman)
Date: Thu, 24 Mar 1994 13:18:21 GMT Raw View
Kauppi Asko (k136377@ee.tut.fi) wrote:
: I wish...
: ...I was able to insert pictures, math formulas and other OLE
: objects in the middle of my C++ source code and still compile
: the programs the normal way.
: The embedded objects would not affect the compilation in any way
: (they would be 'graphical comments') but they would provide an
: invaluable help in visualizing the purpose of the subroutines
: for me and for my colleagues.
I have wanted even more. I have wanted the C compilers of the world
to allow you to use Word 4 Windows, Framemaker or other such word
processor for input.
The compiler would be given a list of "styles" that contain code.
Only those paragraphs that have one of those styles would be compiled.
Everything else would be treated as comments by the compiler.
This would allow us to really have a literary style of coding.
We could put each subroutine in its own chapter. We could use fonts
in any way. And, most importantly, we could write long descriptions
of how something worked using the word processor.
And, as you mention, we could insert diagrams
(Micrografx Designer or Corel Draw) to describe things. In fact,
if the program you were writing was itself an OLE server, and
especially if it did OLE 2.0 Automation, then you could put demos of
the program directly into the program itself. I.e. the program.doc
file would contain (many) embedded instances of the executable, together with
Visual Basic scripts which illustrate features.
Of course, the spell checker would work only on those parts which are
not code, while lint like tools would work only on those parts which
are code.
In fact, an entire methodology could be based on such an approach.
You start with textual descriptions. Then add pseudo code. Then
add real code. Then add demos.
Michael Trachtman